Commit c8de1677 authored by koz@chromium.org's avatar koz@chromium.org

Add a drop shadow to the fullscreen exit bubble on windows.

BUG=100879
TEST=Visually confirm that when entering fullscreen, the exit bubble has a drop shadow.


Review URL: http://codereview.chromium.org/8565034

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110465 0039d316-1c4b-4281-b951-d872f2087c98
parent 8c9f5ea5
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/rect.h" #include "ui/gfx/rect.h"
const int FullscreenExitBubble::kPaddingPx = 8; const int FullscreenExitBubble::kPaddingPx = 0;
const int FullscreenExitBubble::kInitialDelayMs = 3800; const int FullscreenExitBubble::kInitialDelayMs = 3800;
const int FullscreenExitBubble::kIdleTimeMs = 2300; const int FullscreenExitBubble::kIdleTimeMs = 2300;
const int FullscreenExitBubble::kPositionCheckHz = 10; const int FullscreenExitBubble::kPositionCheckHz = 10;
......
...@@ -226,7 +226,8 @@ AutocompletePopupContentsView::AutocompletePopupContentsView( ...@@ -226,7 +226,8 @@ AutocompletePopupContentsView::AutocompletePopupContentsView(
// The following little dance is required because set_border() requires a // The following little dance is required because set_border() requires a
// pointer to a non-const object. // pointer to a non-const object.
views::BubbleBorder* bubble_border = views::BubbleBorder* bubble_border =
new views::BubbleBorder(views::BubbleBorder::NONE); new views::BubbleBorder(views::BubbleBorder::NONE,
views::BubbleBorder::NO_SHADOW);
bubble_border_ = bubble_border; bubble_border_ = bubble_border;
set_border(bubble_border); set_border(bubble_border);
// The contents is owned by the LocationBarView. // The contents is owned by the LocationBarView.
......
...@@ -76,7 +76,8 @@ FullscreenExitBubbleViews::FullscreenExitView::FullscreenExitView( ...@@ -76,7 +76,8 @@ FullscreenExitBubbleViews::FullscreenExitView::FullscreenExitView(
deny_button_(NULL), deny_button_(NULL),
browser_fullscreen_exit_accelerator_(accelerator) { browser_fullscreen_exit_accelerator_(accelerator) {
views::BubbleBorder* bubble_border = views::BubbleBorder* bubble_border =
new views::BubbleBorder(views::BubbleBorder::NONE); new views::BubbleBorder(views::BubbleBorder::NONE,
views::BubbleBorder::SHADOW);
set_background(new views::BubbleBackground(bubble_border)); set_background(new views::BubbleBackground(bubble_border));
set_border(bubble_border); set_border(bubble_border);
set_focusable(false); set_focusable(false);
......
...@@ -109,7 +109,8 @@ BalloonViewImpl::BalloonViewImpl(BalloonCollection* collection) ...@@ -109,7 +109,8 @@ BalloonViewImpl::BalloonViewImpl(BalloonCollection* collection)
set_parent_owned(false); set_parent_owned(false);
views::BubbleBorder* bubble_border = views::BubbleBorder* bubble_border =
new views::BubbleBorder(views::BubbleBorder::FLOAT); new views::BubbleBorder(views::BubbleBorder::FLOAT,
views::BubbleBorder::NO_SHADOW);
set_border(bubble_border); set_border(bubble_border);
} }
......
...@@ -26,6 +26,15 @@ ...@@ -26,6 +26,15 @@
<include name="IDR_BUBBLE_TL" file="large_bubble_tl.png" type="BINDATA" /> <include name="IDR_BUBBLE_TL" file="large_bubble_tl.png" type="BINDATA" />
<include name="IDR_BUBBLE_TR" file="large_bubble_tr.png" type="BINDATA" /> <include name="IDR_BUBBLE_TR" file="large_bubble_tr.png" type="BINDATA" />
<include name="IDR_BUBBLE_T_ARROW" file="large_bubble_pointer_t.png" type="BINDATA" /> <include name="IDR_BUBBLE_T_ARROW" file="large_bubble_pointer_t.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_B" file="large_bubble_shadow_b.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_BL" file="large_bubble_shadow_bl.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_BR" file="large_bubble_shadow_br.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_L" file="large_bubble_shadow_l.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_R" file="large_bubble_shadow_r.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_T" file="large_bubble_shadow_t.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_TL" file="large_bubble_shadow_tl.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_TR" file="large_bubble_shadow_tr.png" type="BINDATA" />
</includes> </includes>
</release> </release>
</grit> </grit>
...@@ -26,6 +26,15 @@ ...@@ -26,6 +26,15 @@
<include name="IDR_BUBBLE_TL" file="bubble_tl.png" type="BINDATA" /> <include name="IDR_BUBBLE_TL" file="bubble_tl.png" type="BINDATA" />
<include name="IDR_BUBBLE_TR" file="bubble_tr.png" type="BINDATA" /> <include name="IDR_BUBBLE_TR" file="bubble_tr.png" type="BINDATA" />
<include name="IDR_BUBBLE_T_ARROW" file="bubble_pointer_t.png" type="BINDATA" /> <include name="IDR_BUBBLE_T_ARROW" file="bubble_pointer_t.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_B" file="bubble_shadow_b.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_BL" file="bubble_shadow_bl.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_BR" file="bubble_shadow_br.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_L" file="bubble_shadow_l.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_R" file="bubble_shadow_r.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_T" file="bubble_shadow_t.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_TL" file="bubble_shadow_tl.png" type="BINDATA" />
<include name="IDR_BUBBLE_SHADOW_TR" file="bubble_shadow_tr.png" type="BINDATA" />
</includes> </includes>
</release> </release>
</grit> </grit>
...@@ -78,7 +78,10 @@ void BorderContentsView::Init() { ...@@ -78,7 +78,10 @@ void BorderContentsView::Init() {
arrow_location = BubbleBorder::horizontal_mirror(arrow_location); arrow_location = BubbleBorder::horizontal_mirror(arrow_location);
DCHECK(!bubble_border_); DCHECK(!bubble_border_);
bubble_border_ = new BubbleBorder(arrow_location); // TODO(alicet): Expose the shadow option in BorderContentsView when we make
// the fullscreen exit bubble use the new bubble code.
bubble_border_ = new BubbleBorder(arrow_location,
views::BubbleBorder::NO_SHADOW);
set_border(bubble_border_); set_border(bubble_border_);
set_background(new BubbleBackground(bubble_border_)); set_background(new BubbleBackground(bubble_border_));
} }
......
This diff is collapsed.
...@@ -34,6 +34,11 @@ class VIEWS_EXPORT BubbleBorder : public views::Border { ...@@ -34,6 +34,11 @@ class VIEWS_EXPORT BubbleBorder : public views::Border {
FLOAT = 9 // No arrow. Centered over the supplied rect. FLOAT = 9 // No arrow. Centered over the supplied rect.
}; };
enum Shadow {
SHADOW = 0,
NO_SHADOW = 1
};
// The position of the bubble in relation to the anchor. // The position of the bubble in relation to the anchor.
enum BubbleAlignment { enum BubbleAlignment {
// The tip of the arrow points to the middle of the anchor. // The tip of the arrow points to the middle of the anchor.
...@@ -42,13 +47,7 @@ class VIEWS_EXPORT BubbleBorder : public views::Border { ...@@ -42,13 +47,7 @@ class VIEWS_EXPORT BubbleBorder : public views::Border {
ALIGN_EDGE_TO_ANCHOR_EDGE ALIGN_EDGE_TO_ANCHOR_EDGE
}; };
explicit BubbleBorder(ArrowLocation arrow_location) BubbleBorder(ArrowLocation arrow_location, Shadow shadow);
: override_arrow_offset_(0),
arrow_location_(arrow_location),
alignment_(ALIGN_ARROW_TO_MID_ANCHOR),
background_color_(SK_ColorWHITE) {
InitClass();
}
// Returns the radius of the corner of the border. // Returns the radius of the corner of the border.
static int GetCornerRadius() { static int GetCornerRadius() {
...@@ -117,8 +116,10 @@ class VIEWS_EXPORT BubbleBorder : public views::Border { ...@@ -117,8 +116,10 @@ class VIEWS_EXPORT BubbleBorder : public views::Border {
virtual void GetInsets(gfx::Insets* insets) const; virtual void GetInsets(gfx::Insets* insets) const;
private: private:
struct BorderImages;
// Loads images if necessary. // Loads images if necessary.
static void InitClass(); static BorderImages* GetBorderImages(Shadow shadow);
virtual ~BubbleBorder(); virtual ~BubbleBorder();
...@@ -143,21 +144,14 @@ class VIEWS_EXPORT BubbleBorder : public views::Border { ...@@ -143,21 +144,14 @@ class VIEWS_EXPORT BubbleBorder : public views::Border {
int shift_y) const; int shift_y) const;
// Border graphics. // Border graphics.
static SkBitmap* left_; struct BorderImages* images_;
static SkBitmap* top_left_;
static SkBitmap* top_; // Image bundles.
static SkBitmap* top_right_; static struct BorderImages* normal_images_;
static SkBitmap* right_; static struct BorderImages* shadow_images_;
static SkBitmap* bottom_right_;
static SkBitmap* bottom_;
static SkBitmap* bottom_left_;
static SkBitmap* left_arrow_;
static SkBitmap* top_arrow_;
static SkBitmap* right_arrow_;
static SkBitmap* bottom_arrow_;
// Minimal offset of the arrow from the closet edge of bounding rect. // Minimal offset of the arrow from the closet edge of bounding rect.
static int arrow_offset_; int arrow_offset_;
// If specified, overrides the pre-calculated |arrow_offset_| of the arrow. // If specified, overrides the pre-calculated |arrow_offset_| of the arrow.
int override_arrow_offset_; int override_arrow_offset_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment