Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Unified Diff: ui/views/bubble/bubble_delegate.cc

Issue 10905311: Consolidate bubble border code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/bubble/bubble_delegate.cc
diff --git a/ui/views/bubble/bubble_delegate.cc b/ui/views/bubble/bubble_delegate.cc
index ea2d7842ddf8ef341c6033552345b7db3ac38e66..4c2fa6da8a083a4d9cc50e450fb809442efbd389 100644
--- a/ui/views/bubble/bubble_delegate.cc
+++ b/ui/views/bubble/bubble_delegate.cc
@@ -111,13 +111,14 @@ BubbleDelegateView::BubbleDelegateView()
anchor_widget_(NULL),
move_with_anchor_(false),
arrow_location_(BubbleBorder::TOP_LEFT),
+ border_shadow_(BubbleBorder::NO_SHADOW),
color_(kBackgroundColor),
margins_(kDefaultMargin, kDefaultMargin, kDefaultMargin, kDefaultMargin),
original_opacity_(255),
border_widget_(NULL),
use_focusless_(false),
accept_events_(true),
- try_mirroring_arrow_(true),
+ try_fit_bubble_(true),
parent_window_(NULL) {
set_background(Background::CreateSolidBackground(color_));
AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
@@ -132,13 +133,14 @@ BubbleDelegateView::BubbleDelegateView(
anchor_widget_(NULL),
move_with_anchor_(false),
arrow_location_(arrow_location),
+ border_shadow_(BubbleBorder::NO_SHADOW),
color_(kBackgroundColor),
margins_(kDefaultMargin, kDefaultMargin, kDefaultMargin, kDefaultMargin),
original_opacity_(255),
border_widget_(NULL),
use_focusless_(false),
accept_events_(true),
- try_mirroring_arrow_(true),
+ try_fit_bubble_(true),
parent_window_(NULL) {
set_background(Background::CreateSolidBackground(color_));
AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
@@ -194,9 +196,7 @@ NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView(
BubbleBorder::ArrowLocation arrow_loc = arrow_location();
if (base::i18n::IsRTL())
arrow_loc = BubbleBorder::horizontal_mirror(arrow_loc);
- // TODO(alicet): Expose the shadow option in BorderContentsView when we make
- // the fullscreen exit bubble use the new bubble code.
- BubbleBorder* border = new BubbleBorder(arrow_loc, BubbleBorder::NO_SHADOW);
+ BubbleBorder* border = new BubbleBorder(arrow_loc, border_shadow_);
border->set_background_color(color());
BubbleFrameView* frame_view = new BubbleFrameView(margins(), border);
frame_view->set_background(new BubbleBackground(border));
@@ -350,7 +350,7 @@ gfx::Rect BubbleDelegateView::GetBubbleBounds() {
// The argument rect has its origin at the bubble's arrow anchor point;
// its size is the preferred size of the bubble's client view (this view).
return GetBubbleFrameView()->GetUpdatedWindowBounds(GetAnchorRect(),
- GetPreferredSize(), try_mirroring_arrow_);
+ GetPreferredSize(), try_fit_bubble_);
}
#if defined(OS_WIN) && !defined(USE_AURA)

Powered by Google App Engine
This is Rietveld 408576698