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

Unified Diff: ash/common/wm/maximize_mode/maximize_mode_controller.cc

Issue 2739763003: Moves maintaining ShellObservers back to Shell (Closed)
Patch Set: merge Created 3 years, 9 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
« no previous file with comments | « ash/common/wm/lock_layout_manager.cc ('k') | ash/common/wm/maximize_mode/maximize_mode_window_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/maximize_mode/maximize_mode_controller.cc
diff --git a/ash/common/wm/maximize_mode/maximize_mode_controller.cc b/ash/common/wm/maximize_mode/maximize_mode_controller.cc
index 6ea28beb58a2532df56232fde1be6721f866c5d6..3a8030668be117db1ede78fdbbcfb6c3ae3a558f 100644
--- a/ash/common/wm/maximize_mode/maximize_mode_controller.cc
+++ b/ash/common/wm/maximize_mode/maximize_mode_controller.cc
@@ -10,6 +10,7 @@
#include "ash/common/wm/maximize_mode/maximize_mode_window_manager.h"
#include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard.h"
#include "ash/common/wm_shell.h"
+#include "ash/shell.h"
#include "base/command_line.h"
#include "base/metrics/histogram_macros.h"
#include "base/time/default_tick_clock.h"
@@ -91,7 +92,7 @@ MaximizeModeController::MaximizeModeController()
tick_clock_(new base::DefaultTickClock()),
tablet_mode_switch_is_on_(false),
lid_is_closed_(false) {
- WmShell::Get()->AddShellObserver(this);
+ Shell::GetInstance()->AddShellObserver(this);
WmShell::Get()->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_INITIALLY_DISABLED);
// TODO(jonross): Do not create MaximizeModeController if the flag is
@@ -107,7 +108,7 @@ MaximizeModeController::MaximizeModeController()
}
MaximizeModeController::~MaximizeModeController() {
- WmShell::Get()->RemoveShellObserver(this);
+ Shell::GetInstance()->RemoveShellObserver(this);
if (IsEnabled()) {
WmShell::Get()->RemoveDisplayObserver(this);
@@ -139,17 +140,17 @@ void MaximizeModeController::EnableMaximizeModeWindowManager(
// TODO(jonross): Move the maximize mode notifications from ShellObserver
// to MaximizeModeController::Observer
shell->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_ENABLED);
- shell->OnMaximizeModeStarted();
+ Shell::GetInstance()->NotifyMaximizeModeStarted();
observers_.ForAllPtrs([](mojom::TouchViewObserver* observer) {
observer->OnTouchViewToggled(true);
});
} else {
- shell->OnMaximizeModeEnding();
+ Shell::GetInstance()->NotifyMaximizeModeEnding();
maximize_mode_window_manager_.reset();
shell->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_DISABLED);
- shell->OnMaximizeModeEnded();
+ Shell::GetInstance()->NotifyMaximizeModeEnded();
observers_.ForAllPtrs([](mojom::TouchViewObserver* observer) {
observer->OnTouchViewToggled(false);
« no previous file with comments | « ash/common/wm/lock_layout_manager.cc ('k') | ash/common/wm/maximize_mode/maximize_mode_window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698