OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ |
6 #define EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ | 6 #define EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 | 14 |
15 namespace display { | 15 namespace display { |
16 class Display; | 16 class Display; |
17 } | 17 } |
18 | 18 |
19 namespace extensions { | 19 namespace extensions { |
20 | 20 |
21 namespace api { | 21 namespace api { |
22 namespace system_display { | 22 namespace system_display { |
| 23 struct Bounds; |
23 struct DisplayLayout; | 24 struct DisplayLayout; |
24 struct DisplayProperties; | 25 struct DisplayProperties; |
25 struct DisplayUnitInfo; | 26 struct DisplayUnitInfo; |
26 struct Insets; | 27 struct Insets; |
| 28 struct TouchCalibrationPairQuad; |
27 } | 29 } |
28 } | 30 } |
29 | 31 |
30 class DisplayInfoProvider { | 32 class DisplayInfoProvider { |
31 public: | 33 public: |
32 using DisplayUnitInfoList = std::vector<api::system_display::DisplayUnitInfo>; | 34 using DisplayUnitInfoList = std::vector<api::system_display::DisplayUnitInfo>; |
33 using DisplayLayoutList = std::vector<api::system_display::DisplayLayout>; | 35 using DisplayLayoutList = std::vector<api::system_display::DisplayLayout>; |
34 | 36 |
35 virtual ~DisplayInfoProvider(); | 37 virtual ~DisplayInfoProvider(); |
36 | 38 |
(...skipping 27 matching lines...) Expand all Loading... |
64 | 66 |
65 // Implements overscan calbiration methods. See system_display.idl. These | 67 // Implements overscan calbiration methods. See system_display.idl. These |
66 // return false if |id| is invalid. | 68 // return false if |id| is invalid. |
67 virtual bool OverscanCalibrationStart(const std::string& id); | 69 virtual bool OverscanCalibrationStart(const std::string& id); |
68 virtual bool OverscanCalibrationAdjust( | 70 virtual bool OverscanCalibrationAdjust( |
69 const std::string& id, | 71 const std::string& id, |
70 const api::system_display::Insets& delta); | 72 const api::system_display::Insets& delta); |
71 virtual bool OverscanCalibrationReset(const std::string& id); | 73 virtual bool OverscanCalibrationReset(const std::string& id); |
72 virtual bool OverscanCalibrationComplete(const std::string& id); | 74 virtual bool OverscanCalibrationComplete(const std::string& id); |
73 | 75 |
| 76 // Implements touch calibration methods. See system_display.idl. This returns |
| 77 // false if |id| is invalid. |
| 78 virtual bool TouchCalibrationStart(const std::string& id); |
| 79 virtual bool TouchCalibrationSet( |
| 80 const std::string& id, |
| 81 const api::system_display::TouchCalibrationPairQuad& pairs, |
| 82 const api::system_display::Bounds& bounds); |
| 83 virtual bool TouchCalibrationReset(const std::string& id); |
| 84 |
74 protected: | 85 protected: |
75 DisplayInfoProvider(); | 86 DisplayInfoProvider(); |
76 | 87 |
77 // Create a DisplayUnitInfo from a display::Display for implementations of | 88 // Create a DisplayUnitInfo from a display::Display for implementations of |
78 // GetAllDisplaysInfo() | 89 // GetAllDisplaysInfo() |
79 static api::system_display::DisplayUnitInfo CreateDisplayUnitInfo( | 90 static api::system_display::DisplayUnitInfo CreateDisplayUnitInfo( |
80 const display::Display& display, | 91 const display::Display& display, |
81 int64_t primary_display_id); | 92 int64_t primary_display_id); |
82 | 93 |
83 private: | 94 private: |
84 static DisplayInfoProvider* Create(); | 95 static DisplayInfoProvider* Create(); |
85 | 96 |
86 // Update the content of the |unit| obtained for |display| using | 97 // Update the content of the |unit| obtained for |display| using |
87 // platform specific method. | 98 // platform specific method. |
88 virtual void UpdateDisplayUnitInfoForPlatform( | 99 virtual void UpdateDisplayUnitInfoForPlatform( |
89 const display::Display& display, | 100 const display::Display& display, |
90 api::system_display::DisplayUnitInfo* unit) = 0; | 101 api::system_display::DisplayUnitInfo* unit) = 0; |
91 | 102 |
92 DISALLOW_COPY_AND_ASSIGN(DisplayInfoProvider); | 103 DISALLOW_COPY_AND_ASSIGN(DisplayInfoProvider); |
93 }; | 104 }; |
94 | 105 |
95 } // namespace extensions | 106 } // namespace extensions |
96 | 107 |
97 #endif // EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ | 108 #endif // EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ |
OLD | NEW |