| Index: ash/system/chromeos/rotation/tray_rotation_lock.cc
|
| diff --git a/ash/system/chromeos/rotation/tray_rotation_lock.cc b/ash/system/chromeos/rotation/tray_rotation_lock.cc
|
| index 36c2929949ea3b9f54de368accf485bbe22d41eb..87cd8794d56bc0cc017d253eb81c863ced8d15d5 100644
|
| --- a/ash/system/chromeos/rotation/tray_rotation_lock.cc
|
| +++ b/ash/system/chromeos/rotation/tray_rotation_lock.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "ash/system/chromeos/rotation/tray_rotation_lock.h"
|
|
|
| +#include "ash/content/display/screen_orientation_delegate_chromeos.h"
|
| #include "ash/shell.h"
|
| #include "ash/system/tray/system_tray.h"
|
| #include "ash/system/tray/tray_item_more.h"
|
| @@ -54,10 +55,10 @@ RotationLockDefaultView::~RotationLockDefaultView() {
|
| }
|
|
|
| bool RotationLockDefaultView::PerformAction(const ui::Event& event) {
|
| - MaximizeModeController* maximize_mode_controller = Shell::GetInstance()->
|
| - maximize_mode_controller();
|
| - maximize_mode_controller->SetRotationLocked(
|
| - !maximize_mode_controller->rotation_locked());
|
| + ScreenOrientationDelegate* screen_orientation_delegate =
|
| + Shell::GetInstance()->screen_orientation_delegate();
|
| + screen_orientation_delegate->SetRotationLocked(
|
| + !screen_orientation_delegate->rotation_locked());
|
| UpdateImage();
|
| return true;
|
| }
|
| @@ -74,7 +75,7 @@ void RotationLockDefaultView::OnMaximizeModeEnded() {
|
| void RotationLockDefaultView::UpdateImage() {
|
| base::string16 label;
|
| ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
|
| - if (Shell::GetInstance()->maximize_mode_controller()->rotation_locked()) {
|
| + if (Shell::GetInstance()->screen_orientation_delegate()->rotation_locked()) {
|
| SetImage(bundle.GetImageNamed(
|
| IDR_AURA_UBER_TRAY_AUTO_ROTATION_LOCKED_DARK).ToImageSkia());
|
| label = l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ROTATION_LOCK_LOCKED);
|
| @@ -121,13 +122,13 @@ views::View* TrayRotationLock::CreateDefaultView(user::LoginStatus status) {
|
|
|
| void TrayRotationLock::OnMaximizeModeStarted() {
|
| tray_view()->SetVisible(
|
| - Shell::GetInstance()->maximize_mode_controller()->rotation_locked());
|
| - Shell::GetInstance()->maximize_mode_controller()->AddObserver(this);
|
| + Shell::GetInstance()->screen_orientation_delegate()->rotation_locked());
|
| + Shell::GetInstance()->screen_orientation_delegate()->AddObserver(this);
|
| }
|
|
|
| void TrayRotationLock::OnMaximizeModeEnded() {
|
| tray_view()->SetVisible(false);
|
| - Shell::GetInstance()->maximize_mode_controller()->RemoveObserver(this);
|
| + Shell::GetInstance()->screen_orientation_delegate()->RemoveObserver(this);
|
| }
|
|
|
| bool TrayRotationLock::GetInitialVisibility() {
|
| @@ -135,11 +136,11 @@ bool TrayRotationLock::GetInitialVisibility() {
|
| }
|
|
|
| bool TrayRotationLock::ShouldBeVisible() {
|
| - MaximizeModeController* controller = Shell::GetInstance()->
|
| - maximize_mode_controller();
|
| return on_primary_display_ &&
|
| - controller->IsMaximizeModeWindowManagerEnabled() &&
|
| - controller->rotation_locked();
|
| + Shell::GetInstance()
|
| + ->maximize_mode_controller()
|
| + ->IsMaximizeModeWindowManagerEnabled() &&
|
| + Shell::GetInstance()->screen_orientation_delegate()->rotation_locked();
|
| }
|
|
|
| } // namespace ash
|
|
|