Index: ash/shell_context_menu.cc |
diff --git a/ash/shell_context_menu.cc b/ash/shell_context_menu.cc |
index 4c0ab852a45aeb922efbf535fe0f7d66332e4da2..3adcb95ed04758178e0c744d7699d58a98ab387f 100644 |
--- a/ash/shell_context_menu.cc |
+++ b/ash/shell_context_menu.cc |
@@ -22,9 +22,6 @@ ShellContextMenu::~ShellContextMenu() { |
void ShellContextMenu::ShowMenu(views::Widget* widget, |
const gfx::Point& location) { |
- if (!Shell::GetInstance()->user_wallpaper_delegate()-> |
- CanOpenSetWallpaperPage()) |
- return; |
ui::SimpleMenuModel menu_model(this); |
menu_model.AddItem(MENU_CHANGE_WALLPAPER, |
l10n_util::GetStringUTF16(IDS_AURA_SET_DESKTOP_WALLPAPER)); |
@@ -42,7 +39,14 @@ bool ShellContextMenu::IsCommandIdChecked(int command_id) const { |
} |
bool ShellContextMenu::IsCommandIdEnabled(int command_id) const { |
- return true; |
+ switch (static_cast<MenuItem>(command_id)) { |
+ case MENU_CHANGE_WALLPAPER: { |
+ return Shell::GetInstance()->user_wallpaper_delegate()-> |
+ CanOpenSetWallpaperPage(); |
+ } |
+ default: |
+ return true; |
+ } |
} |
void ShellContextMenu::ExecuteCommand(int command_id) { |