OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf/shelf_alignment_menu.h" | 5 #include "ash/shelf/shelf_alignment_menu.h" |
6 | 6 |
7 #include "ash/metrics/user_metrics_recorder.h" | 7 #include "ash/metrics/user_metrics_recorder.h" |
8 #include "ash/shelf/shelf.h" | 8 #include "ash/shelf/shelf.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shelf/shelf_types.h" | 10 #include "ash/shelf/shelf_types.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 IDS_ASH_SHELF_CONTEXT_MENU_ALIGN_BOTTOM, | 27 IDS_ASH_SHELF_CONTEXT_MENU_ALIGN_BOTTOM, |
28 align_group_id); | 28 align_group_id); |
29 AddRadioItemWithStringId(MENU_ALIGN_RIGHT, | 29 AddRadioItemWithStringId(MENU_ALIGN_RIGHT, |
30 IDS_ASH_SHELF_CONTEXT_MENU_ALIGN_RIGHT, | 30 IDS_ASH_SHELF_CONTEXT_MENU_ALIGN_RIGHT, |
31 align_group_id); | 31 align_group_id); |
32 } | 32 } |
33 | 33 |
34 ShelfAlignmentMenu::~ShelfAlignmentMenu() {} | 34 ShelfAlignmentMenu::~ShelfAlignmentMenu() {} |
35 | 35 |
36 bool ShelfAlignmentMenu::IsCommandIdChecked(int command_id) const { | 36 bool ShelfAlignmentMenu::IsCommandIdChecked(int command_id) const { |
37 return shelf_->SelectValueForShelfAlignment( | 37 return shelf_->SelectValueForShelfAlignment(MENU_ALIGN_BOTTOM == command_id, |
38 MENU_ALIGN_BOTTOM == command_id, MENU_ALIGN_LEFT == command_id, | 38 MENU_ALIGN_LEFT == command_id, |
39 MENU_ALIGN_RIGHT == command_id, false); | 39 MENU_ALIGN_RIGHT == command_id); |
40 } | 40 } |
41 | 41 |
42 bool ShelfAlignmentMenu::IsCommandIdEnabled(int command_id) const { | 42 bool ShelfAlignmentMenu::IsCommandIdEnabled(int command_id) const { |
43 return true; | 43 return true; |
44 } | 44 } |
45 | 45 |
46 bool ShelfAlignmentMenu::GetAcceleratorForCommandId( | 46 bool ShelfAlignmentMenu::GetAcceleratorForCommandId( |
47 int command_id, | 47 int command_id, |
48 ui::Accelerator* accelerator) { | 48 ui::Accelerator* accelerator) { |
49 return false; | 49 return false; |
(...skipping 12 matching lines...) Expand all Loading... |
62 manager->SetAlignment(SHELF_ALIGNMENT_BOTTOM); | 62 manager->SetAlignment(SHELF_ALIGNMENT_BOTTOM); |
63 break; | 63 break; |
64 case MENU_ALIGN_RIGHT: | 64 case MENU_ALIGN_RIGHT: |
65 shell->metrics()->RecordUserMetricsAction(UMA_SHELF_ALIGNMENT_SET_RIGHT); | 65 shell->metrics()->RecordUserMetricsAction(UMA_SHELF_ALIGNMENT_SET_RIGHT); |
66 manager->SetAlignment(SHELF_ALIGNMENT_RIGHT); | 66 manager->SetAlignment(SHELF_ALIGNMENT_RIGHT); |
67 break; | 67 break; |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 } // namespace ash | 71 } // namespace ash |
OLD | NEW |