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

Unified Diff: ash/shelf/shelf_view.cc

Issue 486193004: Ash: Fix browser icon menu model lifetime (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (menu-leak) simplify Created 6 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 | « ash/shelf/shelf_view.h ('k') | chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_view.cc
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc
index 5e4f00255c028296401e34233c241e8af1e0803f..86049ad0d5baaf08bc2d3b2d7b823f09c053e074 100644
--- a/ash/shelf/shelf_view.cc
+++ b/ash/shelf/shelf_view.cc
@@ -1715,14 +1715,15 @@ bool ShelfView::ShowListMenuForView(const ShelfItem& item,
const ui::Event& event) {
ShelfItemDelegate* item_delegate =
item_manager_->GetShelfItemDelegate(item.id);
- list_menu_model_.reset(item_delegate->CreateApplicationMenu(event.flags()));
+ scoped_ptr<ui::MenuModel> list_menu_model(
+ item_delegate->CreateApplicationMenu(event.flags()));
// Make sure we have a menu and it has at least two items in addition to the
// application title and the 3 spacing separators.
- if (!list_menu_model_.get() || list_menu_model_->GetItemCount() <= 5)
+ if (!list_menu_model.get() || list_menu_model->GetItemCount() <= 5)
return false;
- ShowMenu(list_menu_model_.get(),
+ ShowMenu(list_menu_model.get(),
source,
gfx::Point(),
false,
« no previous file with comments | « ash/shelf/shelf_view.h ('k') | chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698