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

Side by Side Diff: chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller.h

Issue 2656433004: - Plumbs through native touch calibration from MD settings to display manager via the system dis… (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_DISPLAY_TOUCH_CALIBRATOR_TOUCH_CALIBRATOR_CONTRO LLER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_DISPLAY_TOUCH_CALIBRATOR_TOUCH_CALIBRATOR_CONTRO LLER_H_
6 #define CHROME_BROWSER_CHROMEOS_DISPLAY_TOUCH_CALIBRATOR_TOUCH_CALIBRATOR_CONTRO LLER_H_ 6 #define CHROME_BROWSER_CHROMEOS_DISPLAY_TOUCH_CALIBRATOR_TOUCH_CALIBRATOR_CONTRO LLER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "ash/display/window_tree_host_manager.h" 10 #include "ash/display/window_tree_host_manager.h"
(...skipping 13 matching lines...) Expand all
24 24
25 // TouchCalibratorController is responsible for collecting the touch calibration 25 // TouchCalibratorController is responsible for collecting the touch calibration
26 // associated data from the user. It instantiates TouchCalibratorView classes to 26 // associated data from the user. It instantiates TouchCalibratorView classes to
27 // present an interface the user can interact with for calibration. 27 // present an interface the user can interact with for calibration.
28 // Touch calibration is restricted to calibrate only one display at a time. 28 // Touch calibration is restricted to calibrate only one display at a time.
29 class TouchCalibratorController : public ui::EventHandler, 29 class TouchCalibratorController : public ui::EventHandler,
30 public ash::WindowTreeHostManager::Observer { 30 public ash::WindowTreeHostManager::Observer {
31 public: 31 public:
32 using CalibrationPointPairQuad = 32 using CalibrationPointPairQuad =
33 display::TouchCalibrationData::CalibrationPointPairQuad; 33 display::TouchCalibrationData::CalibrationPointPairQuad;
34 using TouchCalibrationCallback = base::Callback<void(bool)>;
34 35
35 static const base::TimeDelta kTouchIntervalThreshold; 36 static const base::TimeDelta kTouchIntervalThreshold;
36 37
37 TouchCalibratorController(); 38 TouchCalibratorController();
38 ~TouchCalibratorController() override; 39 ~TouchCalibratorController() override;
39 40
40 // ui::EventHandler 41 // ui::EventHandler
41 void OnKeyEvent(ui::KeyEvent* event) override; 42 void OnKeyEvent(ui::KeyEvent* event) override;
42 void OnTouchEvent(ui::TouchEvent* event) override; 43 void OnTouchEvent(ui::TouchEvent* event) override;
43 44
44 // WindowTreeHostManager::Observer 45 // WindowTreeHostManager::Observer
45 void OnDisplayConfigurationChanged() override; 46 void OnDisplayConfigurationChanged() override;
46 47
47 // Starts the calibration process for the given |target_display|. 48 // Starts the calibration process for the given |target_display|.
48 void StartCalibration(const display::Display& target_display); 49 void StartCalibration(const display::Display& target_display,
50 const TouchCalibrationCallback& callback);
49 51
50 // Stops any ongoing calibration process. 52 // Stops any ongoing calibration process.
51 void StopCalibration(); 53 void StopCalibration();
52 54
53 bool is_calibrating() { return is_calibrating_; } 55 bool is_calibrating() { return is_calibrating_; }
54 56
55 private: 57 private:
56 friend class TouchCalibratorControllerTest; 58 friend class TouchCalibratorControllerTest;
57 FRIEND_TEST_ALL_PREFIXES(TouchCalibratorControllerTest, StartCalibration); 59 FRIEND_TEST_ALL_PREFIXES(TouchCalibratorControllerTest, StartCalibration);
58 FRIEND_TEST_ALL_PREFIXES(TouchCalibratorControllerTest, KeyEventIntercept); 60 FRIEND_TEST_ALL_PREFIXES(TouchCalibratorControllerTest, KeyEventIntercept);
(...skipping 12 matching lines...) Expand all
71 // was received. 73 // was received.
72 base::Time last_touch_timestamp_; 74 base::Time last_touch_timestamp_;
73 75
74 // Is true if a touch calibration is already underprocess. 76 // Is true if a touch calibration is already underprocess.
75 bool is_calibrating_ = false; 77 bool is_calibrating_ = false;
76 78
77 // An array of Calibration point pairs. This stores all the 4 display and 79 // An array of Calibration point pairs. This stores all the 4 display and
78 // touch input point pairs that will be used for calibration. 80 // touch input point pairs that will be used for calibration.
79 CalibrationPointPairQuad touch_point_quad_; 81 CalibrationPointPairQuad touch_point_quad_;
80 82
83 // A callback to be called when touch calibration completes.
84 TouchCalibrationCallback callback_;
85
81 DISALLOW_COPY_AND_ASSIGN(TouchCalibratorController); 86 DISALLOW_COPY_AND_ASSIGN(TouchCalibratorController);
82 }; 87 };
83 88
84 } // namespace chromeos 89 } // namespace chromeos
85 #endif // CHROME_BROWSER_CHROMEOS_DISPLAY_TOUCH_CALIBRATOR_TOUCH_CALIBRATOR_CON TROLLER_H_ 90 #endif // CHROME_BROWSER_CHROMEOS_DISPLAY_TOUCH_CALIBRATOR_TOUCH_CALIBRATOR_CON TROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698