| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EXTENSIONS_DISPLAY_INFO_PROVIDER_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_DISPLAY_INFO_PROVIDER_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_DISPLAY_INFO_PROVIDER_CHROMEOS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_DISPLAY_INFO_PROVIDER_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "extensions/browser/api/system_display/display_info_provider.h" | 12 #include "extensions/browser/api/system_display/display_info_provider.h" |
| 13 | 13 |
| 14 namespace chromeos { | 14 namespace chromeos { |
| 15 class OverscanCalibrator; | 15 class OverscanCalibrator; |
| 16 class TouchCalibratorController; | 16 class TouchCalibratorController; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace extensions { | 19 namespace extensions { |
| 20 | 20 |
| 21 class DisplayInfoProviderChromeOS : public DisplayInfoProvider { | 21 class DisplayInfoProviderChromeOS : public DisplayInfoProvider { |
| 22 public: | 22 public: |
| 23 static const char kCustomTouchCalibrationInProgressError[]; |
| 24 static const char kCompleteCalibrationCalledBeforeStartError[]; |
| 25 static const char kTouchBoundsNegativeError[]; |
| 26 static const char kTouchCalibrationPointsNegativeError[]; |
| 27 static const char kTouchCalibrationPointsTooLargeError[]; |
| 28 static const char kNativeTouchCalibrationActiveError[]; |
| 29 |
| 23 DisplayInfoProviderChromeOS(); | 30 DisplayInfoProviderChromeOS(); |
| 24 ~DisplayInfoProviderChromeOS() override; | 31 ~DisplayInfoProviderChromeOS() override; |
| 25 | 32 |
| 26 // DisplayInfoProvider implementation. | 33 // DisplayInfoProvider implementation. |
| 27 bool SetInfo(const std::string& display_id, | 34 bool SetInfo(const std::string& display_id, |
| 28 const api::system_display::DisplayProperties& info, | 35 const api::system_display::DisplayProperties& info, |
| 29 std::string* error) override; | 36 std::string* error) override; |
| 30 bool SetDisplayLayout(const DisplayLayoutList& layouts) override; | 37 bool SetDisplayLayout(const DisplayLayoutList& layouts) override; |
| 31 void UpdateDisplayUnitInfoForPlatform( | 38 void UpdateDisplayUnitInfoForPlatform( |
| 32 const display::Display& display, | 39 const display::Display& display, |
| 33 api::system_display::DisplayUnitInfo* unit) override; | 40 api::system_display::DisplayUnitInfo* unit) override; |
| 34 void EnableUnifiedDesktop(bool enable) override; | 41 void EnableUnifiedDesktop(bool enable) override; |
| 35 DisplayUnitInfoList GetAllDisplaysInfo() override; | 42 DisplayUnitInfoList GetAllDisplaysInfo() override; |
| 36 DisplayLayoutList GetDisplayLayout() override; | 43 DisplayLayoutList GetDisplayLayout() override; |
| 37 bool OverscanCalibrationStart(const std::string& id) override; | 44 bool OverscanCalibrationStart(const std::string& id) override; |
| 38 bool OverscanCalibrationAdjust( | 45 bool OverscanCalibrationAdjust( |
| 39 const std::string& id, | 46 const std::string& id, |
| 40 const api::system_display::Insets& delta) override; | 47 const api::system_display::Insets& delta) override; |
| 41 bool OverscanCalibrationReset(const std::string& id) override; | 48 bool OverscanCalibrationReset(const std::string& id) override; |
| 42 bool OverscanCalibrationComplete(const std::string& id) override; | 49 bool OverscanCalibrationComplete(const std::string& id) override; |
| 43 bool TouchCalibrationSet( | 50 bool ShowNativeTouchCalibration( |
| 44 const std::string& id, | 51 const std::string& id, std::string* error, |
| 52 const TouchCalibrationCallback& callback) override; |
| 53 bool StartCustomTouchCalibration(const std::string& id, |
| 54 std::string* error) override; |
| 55 bool CompleteCustomTouchCalibration( |
| 45 const api::system_display::TouchCalibrationPairQuad& pairs, | 56 const api::system_display::TouchCalibrationPairQuad& pairs, |
| 46 const api::system_display::Bounds& bounds, | 57 const api::system_display::Bounds& bounds, |
| 47 std::string* error) override; | 58 std::string* error) override; |
| 48 bool TouchCalibrationReset(const std::string& id, | 59 bool ClearTouchCalibration(const std::string& id, |
| 49 std::string* error) override; | 60 std::string* error) override; |
| 50 bool IsTouchCalibrationActive(std::string* error) override; | 61 bool IsNativeTouchCalibrationActive(std::string* error) override; |
| 51 | 62 |
| 52 private: | 63 private: |
| 53 chromeos::TouchCalibratorController* GetTouchCalibrator(); | 64 chromeos::TouchCalibratorController* GetTouchCalibrator(); |
| 54 | 65 |
| 55 chromeos::OverscanCalibrator* GetOverscanCalibrator(const std::string& id); | 66 chromeos::OverscanCalibrator* GetOverscanCalibrator(const std::string& id); |
| 56 | 67 |
| 57 std::map<std::string, std::unique_ptr<chromeos::OverscanCalibrator>> | 68 std::map<std::string, std::unique_ptr<chromeos::OverscanCalibrator>> |
| 58 overscan_calibrators_; | 69 overscan_calibrators_; |
| 59 | 70 |
| 60 std::unique_ptr<chromeos::TouchCalibratorController> touch_calibrator_; | 71 std::unique_ptr<chromeos::TouchCalibratorController> touch_calibrator_; |
| 61 | 72 |
| 73 std::string touch_calibration_target_id_; |
| 74 bool custom_touch_calibration_active_ = false; |
| 75 |
| 62 DISALLOW_COPY_AND_ASSIGN(DisplayInfoProviderChromeOS); | 76 DISALLOW_COPY_AND_ASSIGN(DisplayInfoProviderChromeOS); |
| 63 }; | 77 }; |
| 64 | 78 |
| 65 } // namespace extensions | 79 } // namespace extensions |
| 66 | 80 |
| 67 #endif // CHROME_BROWSER_EXTENSIONS_DISPLAY_INFO_PROVIDER_CHROMEOS_H_ | 81 #endif // CHROME_BROWSER_EXTENSIONS_DISPLAY_INFO_PROVIDER_CHROMEOS_H_ |
| OLD | NEW |