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

Unified Diff: chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller.cc

Issue 2603563002: Plumbs touch calibration API to the display manager (Closed)
Patch Set: It works. The plumbing! Created 3 years, 12 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 | « no previous file | chrome/browser/extensions/display_info_provider_chromeos.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller.cc
diff --git a/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller.cc b/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller.cc
index 29a99197c774dca1d40200e063a5ba4f225a3e3b..df8a9d3860fb7b18ecdd44f5648d54c564a03b2e 100644
--- a/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller.cc
+++ b/chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller.cc
@@ -20,12 +20,9 @@ const base::TimeDelta TouchCalibratorController::kTouchIntervalThreshold =
base::TimeDelta::FromMilliseconds(200);
TouchCalibratorController::TouchCalibratorController()
- : last_touch_timestamp_(base::Time::Now()) {
- ash::Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
-}
+ : last_touch_timestamp_(base::Time::Now()) {}
TouchCalibratorController::~TouchCalibratorController() {
- ash::Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
touch_calibrator_views_.clear();
StopCalibration();
}
@@ -38,6 +35,7 @@ void TouchCalibratorController::OnDisplayConfigurationChanged() {
void TouchCalibratorController::StartCalibration(
const display::Display& target_display) {
is_calibrating_ = true;
+ ash::Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
target_display_ = target_display;
// Clear all touch calibrator views used in any previous calibration.
@@ -65,6 +63,7 @@ void TouchCalibratorController::StopCalibration() {
if (!is_calibrating_)
return;
is_calibrating_ = false;
+ ash::Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
// TODO(malaykeshav): Call TouchTransformerController::SetForCalibration()
« no previous file with comments | « no previous file | chrome/browser/extensions/display_info_provider_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698