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 CHROME_BROWSER_EXTENSIONS_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class Display; | 15 class Display; |
| 16 class Screen; |
16 } | 17 } |
17 | 18 |
18 namespace extensions { | 19 namespace extensions { |
19 | 20 |
20 namespace api { | 21 namespace api { |
21 namespace system_display { | 22 namespace system_display { |
22 struct DisplayProperties; | 23 struct DisplayProperties; |
23 struct DisplayUnitInfo; | 24 struct DisplayUnitInfo; |
24 } | 25 } |
25 } | 26 } |
(...skipping 13 matching lines...) Expand all Loading... |
39 // Using this in other tests (e.g. unit_tests) will result in DCHECK failure. | 40 // Using this in other tests (e.g. unit_tests) will result in DCHECK failure. |
40 static void InitializeForTesting(DisplayInfoProvider* display_info_provider); | 41 static void InitializeForTesting(DisplayInfoProvider* display_info_provider); |
41 | 42 |
42 // Updates the display with |display_id| according to |info|. Returns whether | 43 // Updates the display with |display_id| according to |info|. Returns whether |
43 // the display was successfully updated. On failure, no display parameters | 44 // the display was successfully updated. On failure, no display parameters |
44 // should be changed, and |error| should be set to the error string. | 45 // should be changed, and |error| should be set to the error string. |
45 virtual bool SetInfo(const std::string& display_id, | 46 virtual bool SetInfo(const std::string& display_id, |
46 const api::system_display::DisplayProperties& info, | 47 const api::system_display::DisplayProperties& info, |
47 std::string* error) = 0; | 48 std::string* error) = 0; |
48 | 49 |
| 50 // Get the screen that is always active, which will be used for monitoring |
| 51 // display changes events. |
| 52 virtual gfx::Screen* GetActiveScreen() = 0; |
| 53 |
49 DisplayInfo GetAllDisplaysInfo(); | 54 DisplayInfo GetAllDisplaysInfo(); |
50 | 55 |
51 protected: | 56 protected: |
52 DisplayInfoProvider(); | 57 DisplayInfoProvider(); |
53 | 58 |
54 private: | 59 private: |
55 static DisplayInfoProvider* Create(); | 60 static DisplayInfoProvider* Create(); |
56 | 61 |
57 // Update the content of the |unit| obtained for |display| using | 62 // Update the content of the |unit| obtained for |display| using |
58 // platform specific method. | 63 // platform specific method. |
59 virtual void UpdateDisplayUnitInfoForPlatform( | 64 virtual void UpdateDisplayUnitInfoForPlatform( |
60 const gfx::Display& display, | 65 const gfx::Display& display, |
61 api::system_display::DisplayUnitInfo* unit) = 0; | 66 api::system_display::DisplayUnitInfo* unit) = 0; |
62 | 67 |
63 DISALLOW_COPY_AND_ASSIGN(DisplayInfoProvider); | 68 DISALLOW_COPY_AND_ASSIGN(DisplayInfoProvider); |
64 }; | 69 }; |
65 | 70 |
66 } // namespace extensions | 71 } // namespace extensions |
67 | 72 |
68 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ | 73 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ |
OLD | NEW |