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

Unified Diff: chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.cc

Issue 1838263002: Arc app integration in shelf launcher context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/desktop_shell_launcher_context_menu.cc
diff --git a/chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f8c85cd1d9d339d66995d2b974ff3d2d90f8706d
--- /dev/null
+++ b/chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.h"
+
+#include <string>
+
+#include "ash/desktop_background/user_wallpaper_delegate.h"
+#include "ash/shelf/shelf.h"
+#include "ash/shelf/shelf_item_types.h"
+#include "ash/shell.h"
+#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
+
+DesktopShellLauncherContextMenu::DesktopShellLauncherContextMenu(
+ ChromeLauncherController* controller,
+ const ash::ShelfItem* item,
+ ash::Shelf* shelf)
+ : LauncherContextMenu(controller, item, shelf) {
+ Init();
+}
+
+DesktopShellLauncherContextMenu::~DesktopShellLauncherContextMenu() {}
+
+void DesktopShellLauncherContextMenu::Init() {
+ AddAutohideAlignmentWallpaperMenu();
+}
+
+bool DesktopShellLauncherContextMenu::IsCommandIdEnabled(int command_id) const {
+ switch (command_id) {
+ case MENU_CHANGE_WALLPAPER:
+ return ash::Shell::GetInstance()
+ ->user_wallpaper_delegate()
+ ->CanOpenSetWallpaperPage();
+ case MENU_AUTO_HIDE:
+ return CanUserModifyShelfAutoHideBehavior();
+ case MENU_ALIGNMENT_MENU:
+ return true;
+ default:
+ NOTREACHED();
+ return false;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698