| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/ash/launcher/desktop_shell_launcher_context_menu.h" |
| 6 |
| 7 #include <string> |
| 8 |
| 9 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| 10 #include "ash/shelf/shelf.h" |
| 11 #include "ash/shelf/shelf_item_types.h" |
| 12 #include "ash/shell.h" |
| 13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 14 |
| 15 DesktopShellLauncherContextMenu::DesktopShellLauncherContextMenu( |
| 16 ChromeLauncherController* controller, |
| 17 const ash::ShelfItem* item, |
| 18 ash::Shelf* shelf) |
| 19 : LauncherContextMenu(controller, item, shelf) { |
| 20 Init(); |
| 21 } |
| 22 |
| 23 DesktopShellLauncherContextMenu::~DesktopShellLauncherContextMenu() {} |
| 24 |
| 25 void DesktopShellLauncherContextMenu::Init() { |
| 26 AddAutohideAlignmentWallpaperMenu(); |
| 27 } |
| 28 |
| 29 bool DesktopShellLauncherContextMenu::IsCommandIdEnabled(int command_id) const { |
| 30 switch (command_id) { |
| 31 case MENU_CHANGE_WALLPAPER: |
| 32 return ash::Shell::GetInstance() |
| 33 ->user_wallpaper_delegate() |
| 34 ->CanOpenSetWallpaperPage(); |
| 35 case MENU_AUTO_HIDE: |
| 36 return CanUserModifyShelfAutoHideBehavior(); |
| 37 case MENU_ALIGNMENT_MENU: |
| 38 return true; |
| 39 default: |
| 40 NOTREACHED(); |
| 41 return false; |
| 42 } |
| 43 } |
| OLD | NEW |