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 |
James Cook
2014/08/15 19:58:42
nit: #include "base/macros.h" for DISALLOW_COPY_AN
| |
11 #include "chrome/common/extensions/api/system_display.h" | 11 #include "chrome/common/extensions/api/system_display.h" |
James Cook
2014/08/15 19:58:42
nit: Can you forward declare api::system_display::
| |
12 | 12 |
13 namespace gfx { | 13 namespace gfx { |
14 class Display; | 14 class Display; |
15 } | 15 } |
16 | 16 |
17 namespace extensions { | 17 namespace extensions { |
18 | 18 |
19 typedef std::vector<linked_ptr< | 19 typedef std::vector<linked_ptr< |
20 api::system_display::DisplayUnitInfo> > DisplayInfo; | 20 api::system_display::DisplayUnitInfo> > DisplayInfo; |
21 | 21 |
22 class DisplayInfoProvider { | 22 class DisplayInfoProvider { |
23 public : | 23 public : |
24 static DisplayInfoProvider* Get(); | 24 static DisplayInfoProvider* Get(); |
25 | 25 |
26 DisplayInfoProvider(); | |
27 virtual ~DisplayInfoProvider(); | 26 virtual ~DisplayInfoProvider(); |
28 | 27 |
29 // This is for tests that run in its own process (e.g. browser_tests). | 28 // This is for tests that run in its own process (e.g. browser_tests). |
30 // Using this in other tests (e.g. unit_tests) will result in DCHECK failure. | 29 // Using this in other tests (e.g. unit_tests) will result in DCHECK failure. |
31 static void InitializeForTesting(DisplayInfoProvider* display_info_provider); | 30 static void InitializeForTesting(DisplayInfoProvider* display_info_provider); |
32 | 31 |
33 DisplayInfo GetAllDisplaysInfo(); | 32 DisplayInfo GetAllDisplaysInfo(); |
34 | 33 |
35 virtual bool SetInfo(const std::string& display_id, | 34 virtual bool SetInfo(const std::string& display_id, |
James Cook
2014/08/15 19:58:42
Please document this method.
| |
36 const api::system_display::DisplayProperties& info, | 35 const api::system_display::DisplayProperties& info, |
37 std::string* error); | 36 std::string* error) = 0; |
37 | |
38 protected: | |
39 DisplayInfoProvider(); | |
38 | 40 |
39 private: | 41 private: |
40 // Update the content of the |unit| obtained for |display| using | 42 // Update the content of the |unit| obtained for |display| using |
41 // platform specific method. | 43 // platform specific method. |
42 virtual void UpdateDisplayUnitInfoForPlatform( | 44 virtual void UpdateDisplayUnitInfoForPlatform( |
43 const gfx::Display& display, | 45 const gfx::Display& display, |
44 extensions::api::system_display::DisplayUnitInfo* unit); | 46 extensions::api::system_display::DisplayUnitInfo* unit) = 0; |
45 | 47 |
46 DISALLOW_COPY_AND_ASSIGN(DisplayInfoProvider); | 48 DISALLOW_COPY_AND_ASSIGN(DisplayInfoProvider); |
47 }; | 49 }; |
48 | 50 |
49 } // namespace extensions | 51 } // namespace extensions |
50 | 52 |
51 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ | 53 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ |
OLD | NEW |