| 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/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/shelf/shelf_types.h" | 9 #include "ash/shelf/shelf_types.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "grit/ash_strings.h" | 11 #include "grit/ash_strings.h" |
| 12 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" |
| 13 | 13 |
| 14 namespace ash { | 14 namespace ash { |
| 15 namespace shell { | 15 namespace shell { |
| 16 | 16 |
| 17 ContextMenu::ContextMenu(aura::RootWindow* root) | 17 ContextMenu::ContextMenu(aura::RootWindow* root) |
| 18 : ui::SimpleMenuModel(NULL), | 18 : ui::SimpleMenuModel(NULL), |
| 19 root_window_(root), | 19 root_window_(root), |
| 20 alignment_menu_(root) { | 20 alignment_menu_(root) { |
| 21 DCHECK(root_window_); | 21 DCHECK(root_window_); |
| 22 set_delegate(this); | 22 set_delegate(this); |
| 23 AddCheckItemWithStringId(MENU_AUTO_HIDE, | 23 AddCheckItemWithStringId(MENU_AUTO_HIDE, |
| 24 IDS_AURA_LAUNCHER_CONTEXT_MENU_AUTO_HIDE); | 24 IDS_ASH_SHELF_CONTEXT_MENU_AUTO_HIDE); |
| 25 AddSubMenuWithStringId(MENU_ALIGNMENT_MENU, | 25 AddSubMenuWithStringId(MENU_ALIGNMENT_MENU, |
| 26 IDS_AURA_LAUNCHER_CONTEXT_MENU_POSITION, | 26 IDS_ASH_SHELF_CONTEXT_MENU_POSITION, |
| 27 &alignment_menu_); | 27 &alignment_menu_); |
| 28 } | 28 } |
| 29 | 29 |
| 30 ContextMenu::~ContextMenu() { | 30 ContextMenu::~ContextMenu() { |
| 31 } | 31 } |
| 32 | 32 |
| 33 bool ContextMenu::IsCommandIdChecked(int command_id) const { | 33 bool ContextMenu::IsCommandIdChecked(int command_id) const { |
| 34 switch (command_id) { | 34 switch (command_id) { |
| 35 case MENU_AUTO_HIDE: | 35 case MENU_AUTO_HIDE: |
| 36 return Shell::GetInstance()->GetShelfAutoHideBehavior(root_window_) == | 36 return Shell::GetInstance()->GetShelfAutoHideBehavior(root_window_) == |
| (...skipping 24 matching lines...) Expand all Loading... |
| 61 SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, | 61 SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, |
| 62 root_window_); | 62 root_window_); |
| 63 break; | 63 break; |
| 64 case MENU_ALIGNMENT_MENU: | 64 case MENU_ALIGNMENT_MENU: |
| 65 break; | 65 break; |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace shell | 69 } // namespace shell |
| 70 } // namespace ash | 70 } // namespace ash |
| OLD | NEW |