diff options
author | bshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-13 14:43:20 +0000 |
---|---|---|
committer | bshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-13 14:43:20 +0000 |
commit | afa9468b1bdcdfddd5e54d2ed157ed24daefb8fc (patch) | |
tree | 569c038158b59cac8f92a3f86bb1034baf602326 /ash | |
parent | 2d9eaf912e437935b382cc26c59c22cc9a86e6dd (diff) | |
download | chromium_src-afa9468b1bdcdfddd5e54d2ed157ed24daefb8fc.zip chromium_src-afa9468b1bdcdfddd5e54d2ed157ed24daefb8fc.tar.gz chromium_src-afa9468b1bdcdfddd5e54d2ed157ed24daefb8fc.tar.bz2 |
Disable Set wallpaper option in context menu for guest user instead of remove it
and change "Set Wallpaper..." string to "Set wallpaper..."
BUG=120763, 122728
TEST=Loggin as guest, close all browser windows, right click on desktop background,
verify the "Set wallpaper..." option in the context menu is disabled.
Review URL: https://chromiumcodereview.appspot.com/10038020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132187 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/ash_strings.grd | 2 | ||||
-rw-r--r-- | ash/shell_context_menu.cc | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index 7150e9a..5edf645 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd @@ -181,7 +181,7 @@ This file contains the strings for ash. </message> <message name="IDS_AURA_SET_DESKTOP_WALLPAPER" desc="The label used for change wallpaper in context menu"> - Set Wallpaper... + Set wallpaper... </message> <message name="IDS_FRAME_MAXIMIZE_BUTTON_TOOLTIP" desc="Tooltip for the maximize/restore button in window frames in aura"> diff --git a/ash/shell_context_menu.cc b/ash/shell_context_menu.cc index 4c0ab85..3adcb95 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) { |