Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: ash/launcher/launcher_alignment_menu.cc

Issue 22007003: ash: Rename "Autohide launcher" item. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_alignment_menu.h" 5 #include "ash/launcher/launcher_alignment_menu.h"
6 6
7 #include "ash/shelf/shelf_layout_manager.h" 7 #include "ash/shelf/shelf_layout_manager.h"
8 #include "ash/shelf/shelf_types.h" 8 #include "ash/shelf/shelf_types.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "grit/ash_strings.h" 10 #include "grit/ash_strings.h"
11 #include "ui/aura/root_window.h" 11 #include "ui/aura/root_window.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 15
16 LauncherAlignmentMenu::LauncherAlignmentMenu( 16 LauncherAlignmentMenu::LauncherAlignmentMenu(aura::RootWindow* root)
17 aura::RootWindow* root) 17 : ui::SimpleMenuModel(NULL), root_window_(root) {
tfarina 2013/08/03 02:33:56 all these formatting changes was clang-format, not
xiyuan 2013/08/03 04:44:40 clang-format does not always do the right thing. P
tfarina 2013/08/03 06:53:15 Done.
18 : ui::SimpleMenuModel(NULL),
19 root_window_(root) {
20 DCHECK(root_window_); 18 DCHECK(root_window_);
21 int align_group_id = 1; 19 int align_group_id = 1;
22 set_delegate(this); 20 set_delegate(this);
23 AddRadioItemWithStringId(MENU_ALIGN_LEFT, 21 AddRadioItemWithStringId(MENU_ALIGN_LEFT,
24 IDS_AURA_LAUNCHER_CONTEXT_MENU_ALIGN_LEFT, 22 IDS_ASH_SHELF_CONTEXT_MENU_ALIGN_LEFT,
25 align_group_id); 23 align_group_id);
26 AddRadioItemWithStringId(MENU_ALIGN_BOTTOM, 24 AddRadioItemWithStringId(MENU_ALIGN_BOTTOM,
27 IDS_AURA_LAUNCHER_CONTEXT_MENU_ALIGN_BOTTOM, 25 IDS_ASH_SHELF_CONTEXT_MENU_ALIGN_BOTTOM,
28 align_group_id); 26 align_group_id);
29 AddRadioItemWithStringId(MENU_ALIGN_RIGHT, 27 AddRadioItemWithStringId(MENU_ALIGN_RIGHT,
30 IDS_AURA_LAUNCHER_CONTEXT_MENU_ALIGN_RIGHT, 28 IDS_ASH_SHELF_CONTEXT_MENU_ALIGN_RIGHT,
31 align_group_id); 29 align_group_id);
32 } 30 }
33 31
34 LauncherAlignmentMenu::~LauncherAlignmentMenu() { 32 LauncherAlignmentMenu::~LauncherAlignmentMenu() {}
35 }
36 33
37 bool LauncherAlignmentMenu::IsCommandIdChecked(int command_id) const { 34 bool LauncherAlignmentMenu::IsCommandIdChecked(int command_id) const {
38 return internal::ShelfLayoutManager::ForLauncher(root_window_)-> 35 return internal::ShelfLayoutManager::ForLauncher(root_window_)->
39 SelectValueForShelfAlignment( 36 SelectValueForShelfAlignment(
40 MENU_ALIGN_BOTTOM == command_id, 37 MENU_ALIGN_BOTTOM == command_id,
41 MENU_ALIGN_LEFT == command_id, 38 MENU_ALIGN_LEFT == command_id,
42 MENU_ALIGN_RIGHT == command_id, 39 MENU_ALIGN_RIGHT == command_id,
43 false); 40 false);
44 } 41 }
45 42
(...skipping 18 matching lines...) Expand all
64 root_window_); 61 root_window_);
65 break; 62 break;
66 case MENU_ALIGN_RIGHT: 63 case MENU_ALIGN_RIGHT:
67 Shell::GetInstance()->SetShelfAlignment(SHELF_ALIGNMENT_RIGHT, 64 Shell::GetInstance()->SetShelfAlignment(SHELF_ALIGNMENT_RIGHT,
68 root_window_); 65 root_window_);
69 break; 66 break;
70 } 67 }
71 } 68 }
72 69
73 } // namespace ash 70 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698