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

Unified Diff: chrome/browser/ui/ash/launcher/launcher_context_menu.cc

Issue 2391253004: Use mojo Shelf interfaces for both mash and classic ash. (Closed)
Patch Set: Address comments. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
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 1dd2301efdb22440a1fbfd0e312c5717e8a0abe6..1e6efb3fa47d6cbf6bc05abaf94420e9d48c2868 100644
--- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
@@ -8,7 +8,6 @@
#include "ash/common/session/session_state_delegate.h"
#include "ash/common/shelf/shelf_model.h"
-#include "ash/common/shelf/shelf_widget.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/strings/grit/ash_strings.h"
#include "ash/common/wallpaper/wallpaper_delegate.h"
@@ -50,7 +49,7 @@ LauncherContextMenu* LauncherContextMenu::Create(
// Create ArcLauncherContextMenu if the item is an Arc app.
const std::string& app_id = controller->GetAppIDForShelfID(item->id);
- ArcAppListPrefs* arc_prefs = ArcAppListPrefs::Get(controller->GetProfile());
+ ArcAppListPrefs* arc_prefs = ArcAppListPrefs::Get(controller->profile());
if (arc_prefs && arc_prefs->IsRegistered(app_id))
return new ArcLauncherContextMenu(controller, item, wm_shelf);
@@ -100,7 +99,7 @@ bool LauncherContextMenu::IsCommandIdEnabled(int command_id) const {
->wallpaper_delegate()
->CanOpenSetWallpaperPage();
case MENU_AUTO_HIDE:
- return CanUserModifyShelfAutoHideBehavior(controller_->GetProfile());
+ return CanUserModifyShelfAutoHideBehavior(controller_->profile());
default:
DCHECK(command_id < MENU_ITEM_COUNT);
return true;
@@ -150,7 +149,7 @@ void LauncherContextMenu::AddPinMenu() {
DCHECK(item_.id);
int menu_pin_string_id;
const std::string app_id = controller_->GetAppIDForShelfID(item_.id);
- switch (GetPinnableForAppID(app_id, controller_->GetProfile())) {
+ switch (GetPinnableForAppID(app_id, controller_->profile())) {
case AppListControllerDelegate::PIN_EDITABLE:
menu_pin_string_id = controller_->IsPinned(item_.id)
? IDS_LAUNCHER_CONTEXT_MENU_UNPIN
@@ -174,17 +173,17 @@ void LauncherContextMenu::AddShelfOptionsMenu() {
// while in fullscreen because it is confusing when the preference appears
// not to apply.
if (!IsFullScreenMode() &&
- CanUserModifyShelfAutoHideBehavior(controller_->GetProfile())) {
+ CanUserModifyShelfAutoHideBehavior(controller_->profile())) {
AddCheckItemWithStringId(MENU_AUTO_HIDE,
IDS_ASH_SHELF_CONTEXT_MENU_AUTO_HIDE);
}
- if (ash::ShelfWidget::ShelfAlignmentAllowed() &&
+ if (ash::WmShelf::CanChangeShelfAlignment() &&
!ash::WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked()) {
AddSubMenuWithStringId(MENU_ALIGNMENT_MENU,
IDS_ASH_SHELF_CONTEXT_MENU_POSITION,
&shelf_alignment_menu_);
}
- if (!controller_->GetProfile()->IsGuestSession())
+ if (!controller_->profile()->IsGuestSession())
AddItemWithStringId(MENU_CHANGE_WALLPAPER, IDS_AURA_SET_DESKTOP_WALLPAPER);
}

Powered by Google App Engine
This is Rietveld 408576698