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

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

Issue 7566050: Multi-Profiles: Change avatar menu to bubble view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build Created 9 years, 4 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
« no previous file with comments | « chrome/browser/ui/views/avatar_menu_bubble_view.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/avatar_menu_button.cc
diff --git a/chrome/browser/ui/views/avatar_menu_button.cc b/chrome/browser/ui/views/avatar_menu_button.cc
index efe86a8ffa87ba5d3fc77645f444936edce20cbc..7b99ee009a4194141d1a28eb86163afc5e8137f1 100644
--- a/chrome/browser/ui/views/avatar_menu_button.cc
+++ b/chrome/browser/ui/views/avatar_menu_button.cc
@@ -6,7 +6,8 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/profile_menu_model.h"
-#include "chrome/browser/ui/views/avatar_menu.h"
+#include "chrome/browser/ui/views/avatar_menu_bubble_view.h"
+#include "chrome/browser/ui/views/frame/browser_view.h"
#include "ui/gfx/canvas_skia.h"
#include "views/widget/widget.h"
@@ -62,9 +63,16 @@ void AvatarMenuButton::RunMenu(views::View* source, const gfx::Point& pt) {
if (!has_menu_)
return;
- menu_model_.reset(new ProfileMenuModel(browser_));
- // The avatar menu will automatically delete itself when done.
- AvatarMenu* avatar_menu =
- new AvatarMenu(menu_model_.get(), browser_->profile());
- avatar_menu->RunMenu(this);
+ BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow(
+ browser_->window()->GetNativeHandle());
+
+ gfx::Point origin;
+ views::View::ConvertPointToScreen(this, &origin);
+ gfx::Rect bounds(0, 0, width(), height());
+ bounds.set_origin(origin);
+
+ AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_);
+ // Bubble::Show() takes ownership of the view.
+ Bubble::Show(browser_view->GetWidget(), bounds, BubbleBorder::TOP_LEFT,
+ bubble_view, bubble_view);
}
« no previous file with comments | « chrome/browser/ui/views/avatar_menu_bubble_view.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698