| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/shell_context_menu.h" | 5 #include "ash/shell_context_menu.h" |
| 6 | 6 |
| 7 #include "ash/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
| 8 #include "ash/display/display_controller.h" | 8 #include "ash/display/display_controller.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "grit/ash_strings.h" | 10 #include "grit/ash_strings.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 void ShellContextMenu::ShowMenu(views::Widget* widget, | 26 void ShellContextMenu::ShowMenu(views::Widget* widget, |
| 27 const gfx::Point& location) { | 27 const gfx::Point& location) { |
| 28 ui::SimpleMenuModel menu_model(this); | 28 ui::SimpleMenuModel menu_model(this); |
| 29 menu_model.AddItem(MENU_CHANGE_WALLPAPER, | 29 menu_model.AddItem(MENU_CHANGE_WALLPAPER, |
| 30 l10n_util::GetStringUTF16(IDS_AURA_SET_DESKTOP_WALLPAPER)); | 30 l10n_util::GetStringUTF16(IDS_AURA_SET_DESKTOP_WALLPAPER)); |
| 31 views::MenuModelAdapter menu_model_adapter(&menu_model); | 31 views::MenuModelAdapter menu_model_adapter(&menu_model); |
| 32 menu_runner_.reset(new views::MenuRunner(menu_model_adapter.CreateMenu())); | 32 menu_runner_.reset(new views::MenuRunner(menu_model_adapter.CreateMenu())); |
| 33 if (menu_runner_->RunMenuAt( | 33 if (menu_runner_->RunMenuAt( |
| 34 widget, NULL, gfx::Rect(location, gfx::Size()), | 34 widget, NULL, gfx::Rect(location, gfx::Size()), |
| 35 views::MenuItemView::TOPLEFT, views::MenuRunner::HAS_MNEMONICS) == | 35 views::MenuItemView::TOPLEFT, views::MenuRunner::HAS_MNEMONICS | |
| 36 views::MenuRunner::MENU_DELETED) | 36 views::MenuRunner::CONTEXT_MENU) == views::MenuRunner::MENU_DELETED) |
| 37 return; | 37 return; |
| 38 } | 38 } |
| 39 | 39 |
| 40 bool ShellContextMenu::IsCommandIdChecked(int command_id) const { | 40 bool ShellContextMenu::IsCommandIdChecked(int command_id) const { |
| 41 return false; | 41 return false; |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool ShellContextMenu::IsCommandIdEnabled(int command_id) const { | 44 bool ShellContextMenu::IsCommandIdEnabled(int command_id) const { |
| 45 switch (static_cast<MenuItem>(command_id)) { | 45 switch (static_cast<MenuItem>(command_id)) { |
| 46 case MENU_CHANGE_WALLPAPER: { | 46 case MENU_CHANGE_WALLPAPER: { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool ShellContextMenu::GetAcceleratorForCommandId( | 65 bool ShellContextMenu::GetAcceleratorForCommandId( |
| 66 int command_id, | 66 int command_id, |
| 67 ui::Accelerator* accelerator) { | 67 ui::Accelerator* accelerator) { |
| 68 return false; | 68 return false; |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace internal | 71 } // namespace internal |
| 72 } // namespace ash | 72 } // namespace ash |
| OLD | NEW |