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

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

Issue 7622001: Revert 96306 - Multi-Profiles: Change avatar menu to bubble view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
===================================================================
--- chrome/browser/ui/views/avatar_menu_button.cc (revision 96308)
+++ chrome/browser/ui/views/avatar_menu_button.cc (working copy)
@@ -6,8 +6,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/profile_menu_model.h"
-#include "chrome/browser/ui/views/avatar_menu_bubble_view.h"
-#include "chrome/browser/ui/views/frame/browser_view.h"
+#include "chrome/browser/ui/views/avatar_menu.h"
#include "ui/gfx/canvas_skia.h"
#include "views/widget/widget.h"
@@ -63,16 +62,9 @@
if (!has_menu_)
return;
- 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);
+ 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);
}
« 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