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

Unified Diff: ash/shell_context_menu.cc

Issue 10038020: Disable Set wallpaper option in context menu for guest user instead of remove it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 8 years, 8 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
« no previous file with comments | « ash/ash_strings.grd ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « ash/ash_strings.grd ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698