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: chrome/browser/ui/ash/launcher/launcher_context_menu.h

Issue 1812013003: Pass shelf instances, not root windows, for ash context menus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call OnShelfAlignmentChanged after LayoutShelf. Created 4 years, 9 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
Index: chrome/browser/ui/ash/launcher/launcher_context_menu.h
diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu.h b/chrome/browser/ui/ash/launcher/launcher_context_menu.h
index 159ea7735887dfc35995845b1ae44755622270bc..f7006c95b84ac7cd84f3838028b23dd40df8e866 100644
--- a/chrome/browser/ui/ash/launcher/launcher_context_menu.h
+++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.h
@@ -14,30 +14,21 @@
class ChromeLauncherController;
-namespace aura {
-class Window;
-}
-
namespace extensions {
class ContextMenuMatcher;
}
-// Context menu shown for a launcher item.
+// Context menu shown for the ash shell desktop, or for an item in the shelf.
class LauncherContextMenu : public ui::SimpleMenuModel,
public ui::SimpleMenuModel::Delegate {
public:
- // Creates a context menu for the desktop, or shelf |item|, in |root_window|.
LauncherContextMenu(ChromeLauncherController* controller,
const ash::ShelfItem* item,
- aura::Window* root_window);
-
+ ash::Shelf* shelf);
~LauncherContextMenu() override;
void Init();
- // ID of the item we're showing the context menu for.
- ash::ShelfID id() const { return item_.id; }
-
// ui::SimpleMenuModel::Delegate overrides:
bool IsItemForCommandIdDynamic(int command_id) const override;
base::string16 GetLabelForCommandId(int command_id) const override;
@@ -74,10 +65,6 @@ class LauncherContextMenu : public ui::SimpleMenuModel,
MENU_ITEM_COUNT
};
- // Does |item_| represent a valid item? See description of constructor for
- // details on why it may not be valid.
- bool is_valid_item() const { return item_.id != 0; }
-
ChromeLauncherController* controller_;
ash::ShelfItem item_;
@@ -86,7 +73,7 @@ class LauncherContextMenu : public ui::SimpleMenuModel,
scoped_ptr<extensions::ContextMenuMatcher> extension_items_;
- aura::Window* root_window_;
+ ash::Shelf* shelf_;
DISALLOW_COPY_AND_ASSIGN(LauncherContextMenu);
};
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc ('k') | chrome/browser/ui/ash/launcher/launcher_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698