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

Side by Side Diff: extensions/browser/api/system_display/display_info_provider.h

Issue 1842953002: [Extensions] Convert APIs to use movable types [13] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
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 #include "base/memory/linked_ptr.h"
15 14
16 namespace gfx { 15 namespace gfx {
17 class Display; 16 class Display;
18 } 17 }
19 18
20 namespace extensions { 19 namespace extensions {
21 20
22 namespace api { 21 namespace api {
23 namespace system_display { 22 namespace system_display {
24 struct DisplayProperties; 23 struct DisplayProperties;
25 struct DisplayUnitInfo; 24 struct DisplayUnitInfo;
26 } 25 }
27 } 26 }
28 27
29 typedef std::vector<linked_ptr<api::system_display::DisplayUnitInfo>> 28 typedef std::vector<api::system_display::DisplayUnitInfo> DisplayInfo;
30 DisplayInfo;
31 29
32 class DisplayInfoProvider { 30 class DisplayInfoProvider {
33 public: 31 public:
34 virtual ~DisplayInfoProvider(); 32 virtual ~DisplayInfoProvider();
35 33
36 // Returns a pointer to DisplayInfoProvider or NULL if Create() 34 // Returns a pointer to DisplayInfoProvider or NULL if Create()
37 // or InitializeForTesting() or not called yet. 35 // or InitializeForTesting() or not called yet.
38 static DisplayInfoProvider* Get(); 36 static DisplayInfoProvider* Get();
39 37
40 // This is for tests that run in its own process (e.g. browser_tests). 38 // This is for tests that run in its own process (e.g. browser_tests).
(...skipping 11 matching lines...) Expand all
52 virtual void EnableUnifiedDesktop(bool enable); 50 virtual void EnableUnifiedDesktop(bool enable);
53 51
54 // Get display information. 52 // Get display information.
55 virtual DisplayInfo GetAllDisplaysInfo(); 53 virtual DisplayInfo GetAllDisplaysInfo();
56 54
57 protected: 55 protected:
58 DisplayInfoProvider(); 56 DisplayInfoProvider();
59 57
60 // Create a DisplayUnitInfo from a gfx::Display for implementations of 58 // Create a DisplayUnitInfo from a gfx::Display for implementations of
61 // GetAllDisplaysInfo() 59 // GetAllDisplaysInfo()
62 static api::system_display::DisplayUnitInfo* CreateDisplayUnitInfo( 60 static api::system_display::DisplayUnitInfo CreateDisplayUnitInfo(
63 const gfx::Display& display, 61 const gfx::Display& display,
64 int64_t primary_display_id); 62 int64_t primary_display_id);
65 63
66 private: 64 private:
67 static DisplayInfoProvider* Create(); 65 static DisplayInfoProvider* Create();
68 66
69 // Update the content of the |unit| obtained for |display| using 67 // Update the content of the |unit| obtained for |display| using
70 // platform specific method. 68 // platform specific method.
71 virtual void UpdateDisplayUnitInfoForPlatform( 69 virtual void UpdateDisplayUnitInfoForPlatform(
72 const gfx::Display& display, 70 const gfx::Display& display,
73 api::system_display::DisplayUnitInfo* unit) = 0; 71 api::system_display::DisplayUnitInfo* unit) = 0;
74 72
75 DISALLOW_COPY_AND_ASSIGN(DisplayInfoProvider); 73 DISALLOW_COPY_AND_ASSIGN(DisplayInfoProvider);
76 }; 74 };
77 75
78 } // namespace extensions 76 } // namespace extensions
79 77
80 #endif // EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_ 78 #endif // EXTENSIONS_BROWSER_API_SYSTEM_DISPLAY_DISPLAY_INFO_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698