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

Side by Side Diff: chrome/browser/ui/views/avatar_menu_button.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/avatar_menu_button.h" 5 #include "chrome/browser/ui/views/avatar_menu_button.h"
6 6
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h" 8 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h"
9 #include "chrome/browser/ui/views/frame/browser_view.h" 9 #include "chrome/browser/ui/views/frame/browser_view.h"
10 #include "ui/gfx/canvas_skia.h" 10 #include "ui/gfx/canvas_skia.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 151
152 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); 152 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_);
153 gfx::Point origin; 153 gfx::Point origin;
154 views::View::ConvertPointToScreen(this, &origin); 154 views::View::ConvertPointToScreen(this, &origin);
155 gfx::Rect bounds(0, 0, width(), height()); 155 gfx::Rect bounds(0, 0, width(), height());
156 bounds.set_origin(origin); 156 bounds.set_origin(origin);
157 157
158 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_); 158 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_);
159 // Bubble::Show() takes ownership of the view. 159 // Bubble::Show() takes ownership of the view.
160 bubble_ = Bubble::Show(browser_view->GetWidget(), bounds, 160 bubble_ = Bubble::Show(browser_view->GetWidget(), bounds,
161 views::BubbleBorder::TOP_LEFT, bubble_view, bubble_view); 161 views::BubbleBorder::TOP_LEFT,
162 views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR, bubble_view, bubble_view);
162 bubble_->AddObserver(this); 163 bubble_->AddObserver(this);
163 } 164 }
164 165
165 void AvatarMenuButton::OnBubbleClosing() { 166 void AvatarMenuButton::OnBubbleClosing() {
166 bubble_->RemoveObserver(this); 167 bubble_->RemoveObserver(this);
167 bubble_ = NULL; 168 bubble_ = NULL;
168 } 169 }
OLDNEW
« no previous file with comments | « chrome/browser/speech/speech_input_bubble_views.cc ('k') | chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698