Index: ash/shell_context_menu.cc |
diff --git a/ash/shell_context_menu.cc b/ash/shell_context_menu.cc |
index 4c0ab852a45aeb922efbf535fe0f7d66332e4da2..dc67f842e64992f9e21b824954e689425cb2e5e4 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,17 @@ 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: { |
+ if (Shell::GetInstance()->user_wallpaper_delegate()-> |
sky
2012/04/12 16:08:35
nit: no need for the conditional:
return Shell::
bshe
2012/04/12 17:49:55
Done.
|
+ CanOpenSetWallpaperPage()) |
+ return true; |
+ else |
+ return false; |
+ } |
+ default: |
+ return true; |
+ } |
} |
void ShellContextMenu::ExecuteCommand(int command_id) { |