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

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

Issue 2505403003: TouchView Mojom (Closed)
Patch Set: Minor param rename Created 4 years 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/maximize_mode/maximize_mode_controller.h ('k') | ash/mus/manifest.json » ('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 e2d4e0c286fd3bf7ab6d6c9d7dfd93436a2bca30..6901481c6edd6f9ace32ee383a1321e0087160dd 100644
--- a/ash/common/wm/maximize_mode/maximize_mode_controller.cc
+++ b/ash/common/wm/maximize_mode/maximize_mode_controller.cc
@@ -163,10 +163,19 @@ void MaximizeModeController::EnableMaximizeModeWindowManager(
// to MaximizeModeController::Observer
shell->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_ENABLED);
shell->OnMaximizeModeStarted();
+
+ observers_.ForAllPtrs([](mojom::TouchViewObserver* observer) {
+ observer->OnTouchViewToggled(true);
+ });
+
} else {
maximize_mode_window_manager_.reset();
shell->RecordUserMetricsAction(UMA_MAXIMIZE_MODE_DISABLED);
shell->OnMaximizeModeEnded();
+
+ observers_.ForAllPtrs([](mojom::TouchViewObserver* observer) {
+ observer->OnTouchViewToggled(false);
+ });
}
}
@@ -179,6 +188,11 @@ void MaximizeModeController::AddWindow(WmWindow* window) {
maximize_mode_window_manager_->AddWindow(window);
}
+void MaximizeModeController::BindRequest(
+ mojom::TouchViewManagerRequest request) {
+ bindings_.AddBinding(this, std::move(request));
+}
+
#if defined(OS_CHROMEOS)
void MaximizeModeController::OnAccelerometerUpdated(
scoped_refptr<const chromeos::AccelerometerUpdate> update) {
@@ -391,6 +405,11 @@ MaximizeModeController::CurrentTouchViewIntervalType() {
return TOUCH_VIEW_INTERVAL_INACTIVE;
}
+void MaximizeModeController::AddObserver(mojom::TouchViewObserverPtr observer) {
+ observer->OnTouchViewToggled(IsMaximizeModeWindowManagerEnabled());
+ observers_.AddPtr(std::move(observer));
+}
+
void MaximizeModeController::OnAppTerminating() {
// The system is about to shut down, so record TouchView usage interval
// metrics based on whether TouchView mode is currently active.
« no previous file with comments | « ash/common/wm/maximize_mode/maximize_mode_controller.h ('k') | ash/mus/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698