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

Unified Diff: chrome/browser/ui/views/bubble/bubble.cc

Issue 8493011: Merge 108537 - Align avatar bubble with edge of anchor control (Closed) Base URL: svn://svn.chromium.org/chrome/branches/912/src/
Patch Set: Created 9 years, 1 month 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: chrome/browser/ui/views/bubble/bubble.cc
===================================================================
--- chrome/browser/ui/views/bubble/bubble.cc (revision 108874)
+++ chrome/browser/ui/views/bubble/bubble.cc (working copy)
@@ -51,10 +51,11 @@
Bubble* Bubble::Show(views::Widget* parent,
const gfx::Rect& position_relative_to,
views::BubbleBorder::ArrowLocation arrow_location,
+ views::BubbleBorder::BubbleAlignment alignment,
views::View* contents,
BubbleDelegate* delegate) {
Bubble* bubble = new Bubble;
- bubble->InitBubble(parent, position_relative_to, arrow_location,
+ bubble->InitBubble(parent, position_relative_to, arrow_location, alignment,
contents, delegate);
// Register the Escape accelerator for closing.
@@ -72,12 +73,13 @@
views::Widget* parent,
const gfx::Rect& position_relative_to,
views::BubbleBorder::ArrowLocation arrow_location,
+ views::BubbleBorder::BubbleAlignment alignment,
views::View* contents,
BubbleDelegate* delegate,
bool show_while_screen_is_locked) {
Bubble* bubble = new Bubble(views::Widget::InitParams::TYPE_POPUP,
show_while_screen_is_locked);
- bubble->InitBubble(parent, position_relative_to, arrow_location,
+ bubble->InitBubble(parent, position_relative_to, arrow_location, alignment,
contents, delegate);
return bubble;
}
@@ -191,6 +193,7 @@
void Bubble::InitBubble(views::Widget* parent,
const gfx::Rect& position_relative_to,
views::BubbleBorder::ArrowLocation arrow_location,
+ views::BubbleBorder::BubbleAlignment alignment,
views::View* contents,
BubbleDelegate* delegate) {
delegate_ = delegate;
@@ -220,6 +223,7 @@
border_->InitBorderWidgetWin(CreateBorderContents(), parent->GetNativeView());
border_->border_contents()->SetBackgroundColor(kBackgroundColor);
+ border_->border_contents()->SetAlignment(alignment);
// We make the BorderWidgetWin the owner of the Bubble HWND, so that the
// latter is displayed on top of the former.
@@ -288,6 +292,7 @@
border_contents_ = CreateBorderContents();
border_contents_->Init();
border_contents_->SetBackgroundColor(kBackgroundColor);
+ border_contents_->SetAlignment(alignment);
gfx::Rect contents_bounds;
border_contents_->SizeAndGetBounds(position_relative_to,
arrow_location, false, contents->GetPreferredSize(),
« no previous file with comments | « chrome/browser/ui/views/bubble/bubble.h ('k') | chrome/browser/ui/views/extensions/extension_installed_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698