Simplify ash context menu creation.
Remove ash::ShelfItemDelegate::CreateContextMenu.
Use ash::ShellDelegate::CreateContextMenu instead.
(this is what all the impls do anyway...)
Don't pass the ShelfItemDelegate, look up as needed.
Only create |extension_items_| as needed.
Don't ask |extension_items_| for local enabled/checked state.
Remove non-cros logic from LauncherContextMenu.
Support null in GetAppIDForShelfID for app list button.
TODO: Refine menu model creation pattern to support mash.
BUG=557406
TEST=No behavior changes or regressions.
[email protected]
Review URL: https://codereview.chromium.org/1762813002
Cr-Commit-Position: refs/heads/master@{#379158}
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 1ae8355..4d021bfe 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -558,10 +558,10 @@
void RootWindowController::ShowContextMenu(const gfx::Point& location_in_screen,
ui::MenuSourceType source_type) {
- DCHECK(Shell::GetInstance()->delegate());
+ ShellDelegate* delegate = Shell::GetInstance()->delegate();
+ DCHECK(delegate);
scoped_ptr<ui::MenuModel> menu_model(
- Shell::GetInstance()->delegate()->CreateContextMenu(
- GetRootWindow(), NULL, NULL));
+ delegate->CreateContextMenu(GetRootWindow(), nullptr));
if (!menu_model)
return;