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/common/shelf/shelf_types.h" | 7 #include "ash/common/shelf/shelf_types.h" |
8 #include "ash/common/shelf/wm_shelf.h" | 8 #include "ash/common/shelf/wm_shelf.h" |
9 #include "grit/ash_strings.h" | 9 #include "grit/ash_strings.h" |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 bool ContextMenu::IsCommandIdChecked(int command_id) const { | 28 bool ContextMenu::IsCommandIdChecked(int command_id) const { |
29 if (command_id == MENU_AUTO_HIDE) | 29 if (command_id == MENU_AUTO_HIDE) |
30 return wm_shelf_->GetAutoHideBehavior() == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; | 30 return wm_shelf_->GetAutoHideBehavior() == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; |
31 return false; | 31 return false; |
32 } | 32 } |
33 | 33 |
34 bool ContextMenu::IsCommandIdEnabled(int command_id) const { | 34 bool ContextMenu::IsCommandIdEnabled(int command_id) const { |
35 return true; | 35 return true; |
36 } | 36 } |
37 | 37 |
38 bool ContextMenu::GetAcceleratorForCommandId( | |
39 int command_id, | |
40 ui::Accelerator* accelerator) const { | |
41 return false; | |
42 } | |
43 | |
44 void ContextMenu::ExecuteCommand(int command_id, int event_flags) { | 38 void ContextMenu::ExecuteCommand(int command_id, int event_flags) { |
45 if (command_id == MENU_AUTO_HIDE) { | 39 if (command_id == MENU_AUTO_HIDE) { |
46 wm_shelf_->SetAutoHideBehavior(wm_shelf_->GetAutoHideBehavior() == | 40 wm_shelf_->SetAutoHideBehavior(wm_shelf_->GetAutoHideBehavior() == |
47 SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS | 41 SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS |
48 ? SHELF_AUTO_HIDE_BEHAVIOR_NEVER | 42 ? SHELF_AUTO_HIDE_BEHAVIOR_NEVER |
49 : SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 43 : SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
50 } | 44 } |
51 } | 45 } |
52 | 46 |
53 } // namespace shell | 47 } // namespace shell |
54 } // namespace ash | 48 } // namespace ash |
OLD | NEW |