| Index: chrome/browser/ui/ash/launcher/launcher_context_menu.cc
|
| diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
|
| index e946dd44beed426485b6b68301a98259aa11d0ea..67e397a5f4af86cbaee16cd3931e2b680860a411 100644
|
| --- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
|
| +++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
|
| @@ -6,8 +6,8 @@
|
|
|
| #include <string>
|
|
|
| +#include "ash/shelf/shelf.h"
|
| #include "ash/shelf/shelf_model.h"
|
| -#include "ash/shelf/wm_shelf.h"
|
| #include "ash/shell.h"
|
| #include "ash/shell_port.h"
|
| #include "ash/strings/grit/ash_strings.h"
|
| @@ -44,29 +44,29 @@ bool CanUserModifyShelfAutoHideBehavior(const Profile* profile) {
|
| LauncherContextMenu* LauncherContextMenu::Create(
|
| ChromeLauncherController* controller,
|
| const ash::ShelfItem* item,
|
| - ash::WmShelf* wm_shelf) {
|
| + ash::Shelf* shelf) {
|
| DCHECK(controller);
|
| - DCHECK(wm_shelf);
|
| + DCHECK(shelf);
|
| // Create DesktopShellLauncherContextMenu if no item is selected.
|
| if (!item || item->id.IsNull())
|
| - return new DesktopShellLauncherContextMenu(controller, item, wm_shelf);
|
| + return new DesktopShellLauncherContextMenu(controller, item, shelf);
|
|
|
| // Create ArcLauncherContextMenu if the item is an ARC app.
|
| if (arc::IsArcItem(controller->profile(), item->id.app_id))
|
| - return new ArcLauncherContextMenu(controller, item, wm_shelf);
|
| + return new ArcLauncherContextMenu(controller, item, shelf);
|
|
|
| // Create ExtensionLauncherContextMenu for the item.
|
| - return new ExtensionLauncherContextMenu(controller, item, wm_shelf);
|
| + return new ExtensionLauncherContextMenu(controller, item, shelf);
|
| }
|
|
|
| LauncherContextMenu::LauncherContextMenu(ChromeLauncherController* controller,
|
| const ash::ShelfItem* item,
|
| - ash::WmShelf* wm_shelf)
|
| + ash::Shelf* shelf)
|
| : ui::SimpleMenuModel(nullptr),
|
| controller_(controller),
|
| item_(item ? *item : ash::ShelfItem()),
|
| - shelf_alignment_menu_(wm_shelf),
|
| - wm_shelf_(wm_shelf) {
|
| + shelf_alignment_menu_(shelf),
|
| + shelf_(shelf) {
|
| set_delegate(this);
|
| }
|
|
|
| @@ -83,8 +83,7 @@ base::string16 LauncherContextMenu::GetLabelForCommandId(int command_id) const {
|
|
|
| bool LauncherContextMenu::IsCommandIdChecked(int command_id) const {
|
| if (command_id == MENU_AUTO_HIDE) {
|
| - return wm_shelf_->auto_hide_behavior() ==
|
| - ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
|
| + return shelf_->auto_hide_behavior() == ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
|
| }
|
| DCHECK(command_id < MENU_ITEM_COUNT);
|
| return false;
|
| @@ -131,11 +130,10 @@ void LauncherContextMenu::ExecuteCommand(int command_id, int event_flags) {
|
| controller_->PinAppWithID(item_.id.app_id);
|
| break;
|
| case MENU_AUTO_HIDE:
|
| - wm_shelf_->SetAutoHideBehavior(
|
| - wm_shelf_->auto_hide_behavior() ==
|
| - ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS
|
| - ? ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER
|
| - : ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
|
| + shelf_->SetAutoHideBehavior(shelf_->auto_hide_behavior() ==
|
| + ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS
|
| + ? ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER
|
| + : ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
|
| break;
|
| case MENU_ALIGNMENT_MENU:
|
| break;
|
| @@ -174,13 +172,13 @@ void LauncherContextMenu::AddShelfOptionsMenu() {
|
| // on the type of fullscreen. Do not show the auto-hide menu item while in
|
| // fullscreen per display because it is confusing when the preference appears
|
| // not to apply.
|
| - int64_t display_id = wm_shelf_->GetWindow()->GetDisplayNearestWindow().id();
|
| + int64_t display_id = shelf_->GetWindow()->GetDisplayNearestWindow().id();
|
| if (!IsFullScreenMode(display_id) &&
|
| CanUserModifyShelfAutoHideBehavior(controller_->profile())) {
|
| AddCheckItemWithStringId(MENU_AUTO_HIDE,
|
| IDS_ASH_SHELF_CONTEXT_MENU_AUTO_HIDE);
|
| }
|
| - if (ash::WmShelf::CanChangeShelfAlignment() &&
|
| + if (ash::Shelf::CanChangeShelfAlignment() &&
|
| !session_manager::SessionManager::Get()->IsScreenLocked()) {
|
| AddSubMenuWithStringId(MENU_ALIGNMENT_MENU,
|
| IDS_ASH_SHELF_CONTEXT_MENU_POSITION,
|
|
|