diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-05 01:47:23 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-05 01:47:23 +0000 |
commit | 1fcfb9986bb54e8a8b8f98b3eefcf99486f70bf7 (patch) | |
tree | 7f8d2de39c9774a1f45afda0345b3aee83f38025 /ash/launcher/launcher_alignment_menu.cc | |
parent | 51772fa550db198e7741414aeded8848191b6308 (diff) | |
download | chromium_src-1fcfb9986bb54e8a8b8f98b3eefcf99486f70bf7.zip chromium_src-1fcfb9986bb54e8a8b8f98b3eefcf99486f70bf7.tar.gz chromium_src-1fcfb9986bb54e8a8b8f98b3eefcf99486f70bf7.tar.bz2 |
Use the correct launcher assets for shelf alignment.
Cleanup: remove redundant shelf code.
- replaces switch to get values for alignment with template
- eliminate alignment member variables and use shelf_layout_manager where possible.
other minor clean ups: remove unnecessary namespace, use member variable.
BUG=151417
TEST=none
Review URL: https://chromiumcodereview.appspot.com/11434099
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171120 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/launcher/launcher_alignment_menu.cc')
-rw-r--r-- | ash/launcher/launcher_alignment_menu.cc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/ash/launcher/launcher_alignment_menu.cc b/ash/launcher/launcher_alignment_menu.cc index cfa242c..1136baa 100644 --- a/ash/launcher/launcher_alignment_menu.cc +++ b/ash/launcher/launcher_alignment_menu.cc @@ -6,7 +6,9 @@ #include "ash/shelf_types.h" #include "ash/shell.h" +#include "ash/wm/shelf_layout_manager.h" #include "grit/ash_strings.h" +#include "ui/aura/root_window.h" #include "ui/base/l10n/l10n_util.h" namespace ash { @@ -33,19 +35,11 @@ LauncherAlignmentMenu::~LauncherAlignmentMenu() { } bool LauncherAlignmentMenu::IsCommandIdChecked(int command_id) const { - switch (command_id) { - case MENU_ALIGN_LEFT: - return Shell::GetInstance()->GetShelfAlignment(root_window_) == - SHELF_ALIGNMENT_LEFT; - case MENU_ALIGN_BOTTOM: - return Shell::GetInstance()->GetShelfAlignment(root_window_) == - SHELF_ALIGNMENT_BOTTOM; - case MENU_ALIGN_RIGHT: - return Shell::GetInstance()->GetShelfAlignment(root_window_) == - SHELF_ALIGNMENT_RIGHT; - default: - return false; - } + return internal::ShelfLayoutManager::ForLauncher(root_window_)-> + SelectValueForShelfAlignment( + MENU_ALIGN_BOTTOM == command_id, + MENU_ALIGN_LEFT == command_id, + MENU_ALIGN_RIGHT == command_id); } bool LauncherAlignmentMenu::IsCommandIdEnabled(int command_id) const { |