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/launcher/launcher_context_menu.h" | 5 #include "ash/launcher/launcher_context_menu.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/shelf_auto_hide_behavior.h" |
8 #include "grit/ash_strings.h" | 9 #include "grit/ash_strings.h" |
9 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
10 | 11 |
11 namespace ash { | 12 namespace ash { |
12 | 13 |
13 LauncherContextMenu::LauncherContextMenu() : ui::SimpleMenuModel(NULL) { | 14 LauncherContextMenu::LauncherContextMenu() : ui::SimpleMenuModel(NULL) { |
14 set_delegate(this); | 15 set_delegate(this); |
15 AddCheckItemWithStringId(MENU_AUTO_HIDE, GetAutoHideResourceStringId()); | 16 AddCheckItemWithStringId(MENU_AUTO_HIDE, GetAutoHideResourceStringId()); |
| 17 AddSubMenuWithStringId(MENU_ALIGNMENT_MENU, |
| 18 IDS_AURA_LAUNCHER_CONTEXT_MENU_POSITION, |
| 19 &alignment_menu_); |
16 } | 20 } |
17 | 21 |
18 LauncherContextMenu::~LauncherContextMenu() { | 22 LauncherContextMenu::~LauncherContextMenu() { |
19 } | 23 } |
20 | 24 |
21 // static | 25 // static |
22 bool LauncherContextMenu::IsAutoHideMenuHideChecked() { | 26 bool LauncherContextMenu::IsAutoHideMenuHideChecked() { |
23 ash::Shell* shell = ash::Shell::GetInstance(); | 27 ash::Shell* shell = ash::Shell::GetInstance(); |
24 ash::ShelfAutoHideBehavior auto_hide_behavior = | 28 ash::ShelfAutoHideBehavior auto_hide_behavior = |
25 shell->GetShelfAutoHideBehavior(); | 29 shell->GetShelfAutoHideBehavior(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 ui::Accelerator* accelerator) { | 76 ui::Accelerator* accelerator) { |
73 return false; | 77 return false; |
74 } | 78 } |
75 | 79 |
76 void LauncherContextMenu::ExecuteCommand(int command_id) { | 80 void LauncherContextMenu::ExecuteCommand(int command_id) { |
77 switch (static_cast<MenuItem>(command_id)) { | 81 switch (static_cast<MenuItem>(command_id)) { |
78 case MENU_AUTO_HIDE: | 82 case MENU_AUTO_HIDE: |
79 ash::Shell::GetInstance()->SetShelfAutoHideBehavior( | 83 ash::Shell::GetInstance()->SetShelfAutoHideBehavior( |
80 GetToggledAutoHideBehavior()); | 84 GetToggledAutoHideBehavior()); |
81 break; | 85 break; |
| 86 case MENU_ALIGNMENT_MENU: |
| 87 break; |
82 } | 88 } |
83 } | 89 } |
84 | 90 |
85 } // namespace ash | 91 } // namespace ash |
OLD | NEW |