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

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

Issue 2272793005: ash: Move alignment and autohide behavior from Shelf to WmShelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
index b86d5cafd6ca1863e3c9e8faa02cf1091513702a..35577969e894d47cc10ee68ebad9497743a7869e 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
@@ -12,6 +12,7 @@
#include "ash/common/multi_profile_uma.h"
#include "ash/common/shelf/shelf.h"
#include "ash/common/shelf/shelf_model.h"
+#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/system/tray/system_tray_delegate.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
@@ -866,25 +867,28 @@ void ChromeLauncherControllerImpl::OnShelfCreated(ash::Shelf* shelf) {
PrefService* prefs = profile_->GetPrefs();
const int64_t display = GetDisplayIDForShelf(shelf);
- shelf->SetAutoHideBehavior(
+ shelf->wm_shelf()->SetAutoHideBehavior(
ash::launcher::GetShelfAutoHideBehaviorPref(prefs, display));
- if (ash::ShelfWidget::ShelfAlignmentAllowed())
- shelf->SetAlignment(ash::launcher::GetShelfAlignmentPref(prefs, display));
+ if (ash::ShelfWidget::ShelfAlignmentAllowed()) {
+ shelf->wm_shelf()->SetAlignment(
+ ash::launcher::GetShelfAlignmentPref(prefs, display));
+ }
}
void ChromeLauncherControllerImpl::OnShelfDestroyed(ash::Shelf* shelf) {}
void ChromeLauncherControllerImpl::OnShelfAlignmentChanged(ash::Shelf* shelf) {
- ash::launcher::SetShelfAlignmentPref(
- profile_->GetPrefs(), GetDisplayIDForShelf(shelf), shelf->alignment());
+ ash::launcher::SetShelfAlignmentPref(profile_->GetPrefs(),
+ GetDisplayIDForShelf(shelf),
+ shelf->wm_shelf()->alignment());
}
void ChromeLauncherControllerImpl::OnShelfAutoHideBehaviorChanged(
ash::Shelf* shelf) {
- ash::launcher::SetShelfAutoHideBehaviorPref(profile_->GetPrefs(),
- GetDisplayIDForShelf(shelf),
- shelf->auto_hide_behavior());
+ ash::launcher::SetShelfAutoHideBehaviorPref(
+ profile_->GetPrefs(), GetDisplayIDForShelf(shelf),
+ shelf->wm_shelf()->auto_hide_behavior());
}
void ChromeLauncherControllerImpl::OnShelfAutoHideStateChanged(
@@ -1313,8 +1317,9 @@ void ChromeLauncherControllerImpl::SetShelfAutoHideBehaviorFromPrefs() {
for (ash::WmWindow* window : ash::WmShell::Get()->GetAllRootWindows()) {
ash::Shelf* shelf = ash::Shelf::ForWindow(window);
if (shelf) {
- shelf->SetAutoHideBehavior(ash::launcher::GetShelfAutoHideBehaviorPref(
- profile_->GetPrefs(), GetDisplayIDForShelf(shelf)));
+ shelf->wm_shelf()->SetAutoHideBehavior(
+ ash::launcher::GetShelfAutoHideBehaviorPref(
+ profile_->GetPrefs(), GetDisplayIDForShelf(shelf)));
}
}
}
@@ -1326,7 +1331,7 @@ void ChromeLauncherControllerImpl::SetShelfAlignmentFromPrefs() {
for (ash::WmWindow* window : ash::WmShell::Get()->GetAllRootWindows()) {
ash::Shelf* shelf = ash::Shelf::ForWindow(window);
if (shelf) {
- shelf->SetAlignment(ash::launcher::GetShelfAlignmentPref(
+ shelf->wm_shelf()->SetAlignment(ash::launcher::GetShelfAlignmentPref(
profile_->GetPrefs(), GetDisplayIDForShelf(shelf)));
}
}
@@ -1647,7 +1652,8 @@ void ChromeLauncherControllerImpl::OnDisplayConfigurationChanged() {
// Because it might be called by some operations, like crbug.com/627040
// rotating screen.
ash::Shelf* shelf = ash::Shelf::ForPrimaryDisplay();
- if (!shelf || shelf->alignment() != ash::SHELF_ALIGNMENT_BOTTOM_LOCKED)
+ if (!shelf ||
+ shelf->wm_shelf()->alignment() != ash::SHELF_ALIGNMENT_BOTTOM_LOCKED)
SetShelfBehaviorsFromPrefs();
}

Powered by Google App Engine
This is Rietveld 408576698