diff options
author | saintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-11 20:27:28 +0000 |
---|---|---|
committer | saintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-11 20:27:28 +0000 |
commit | cb054f97d1ba2b7c11b05697ddb46bf3f50ff9a4 (patch) | |
tree | 3edf609873567e663a5d7f55f49750af574a51e2 /ash/shell_context_menu.cc | |
parent | 98648a35e54bf7c4ba7564ebae9e43a109554639 (diff) | |
download | chromium_src-cb054f97d1ba2b7c11b05697ddb46bf3f50ff9a4.zip chromium_src-cb054f97d1ba2b7c11b05697ddb46bf3f50ff9a4.tar.gz chromium_src-cb054f97d1ba2b7c11b05697ddb46bf3f50ff9a4.tar.bz2 |
Add Wallpaper option to launcher context menu
BUG=143015
Review URL: https://codereview.chromium.org/11092034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161391 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell_context_menu.cc')
-rw-r--r-- | ash/shell_context_menu.cc | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/ash/shell_context_menu.cc b/ash/shell_context_menu.cc deleted file mode 100644 index 5e190c3..0000000 --- a/ash/shell_context_menu.cc +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/shell_context_menu.h" - -#include "ash/desktop_background/desktop_background_controller.h" -#include "ash/display/display_controller.h" -#include "ash/shell.h" -#include "grit/ash_strings.h" -#include "ui/aura/window.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/views/controls/menu/menu_model_adapter.h" -#include "ui/views/controls/menu/menu_runner.h" -#include "ui/views/widget/widget.h" - -namespace ash { -namespace internal { - -ShellContextMenu::ShellContextMenu() { -} - -ShellContextMenu::~ShellContextMenu() { -} - -void ShellContextMenu::ShowMenu(views::Widget* widget, - const gfx::Point& location) { - ui::SimpleMenuModel menu_model(this); - menu_model.AddItem(MENU_CHANGE_WALLPAPER, - l10n_util::GetStringUTF16(IDS_AURA_SET_DESKTOP_WALLPAPER)); - views::MenuModelAdapter menu_model_adapter(&menu_model); - menu_runner_.reset(new views::MenuRunner(menu_model_adapter.CreateMenu())); - if (menu_runner_->RunMenuAt( - widget, NULL, gfx::Rect(location, gfx::Size()), - views::MenuItemView::TOPLEFT, views::MenuRunner::HAS_MNEMONICS | - views::MenuRunner::CONTEXT_MENU) == views::MenuRunner::MENU_DELETED) - return; -} - -bool ShellContextMenu::IsCommandIdChecked(int command_id) const { - return false; -} - -bool ShellContextMenu::IsCommandIdEnabled(int command_id) const { - 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) { - switch (static_cast<MenuItem>(command_id)) { - case MENU_CHANGE_WALLPAPER: { - Shell::GetInstance()->user_wallpaper_delegate()-> - OpenSetWallpaperPage(); - break; - } - } -} - -bool ShellContextMenu::GetAcceleratorForCommandId( - int command_id, - ui::Accelerator* accelerator) { - return false; -} - -} // namespace internal -} // namespace ash |