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

Unified Diff: ash/launcher/launcher_alignment_menu.cc

Issue 11434099: Use the correct launcher assets for shelf alignment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up Created 8 years 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 side-by-side diff with in-line comments
Download patch
Index: ash/launcher/launcher_alignment_menu.cc
diff --git a/ash/launcher/launcher_alignment_menu.cc b/ash/launcher/launcher_alignment_menu.cc
index 304c239c08c3d5b4996bdf0f27f39a5a92581d9e..54e12d57ddd834bc4ab228d088891eff1726d0bc 100644
--- a/ash/launcher/launcher_alignment_menu.cc
+++ b/ash/launcher/launcher_alignment_menu.cc
@@ -5,8 +5,10 @@
#include "ash/launcher/launcher_alignment_menu.h"
#include "ash/shell.h"
+#include "ash/wm/shelf_layout_manager.h"
#include "ash/wm/shelf_types.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 {

Powered by Google App Engine
This is Rietveld 408576698