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

Side by Side Diff: services/ui/display/screen_manager.h

Issue 2645093003: [WIP] ScreenManager: Add an external window mode (Closed)
Patch Set: Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 SERVICES_UI_DISPLAY_SCREEN_MANAGER_H_ 5 #ifndef SERVICES_UI_DISPLAY_SCREEN_MANAGER_H_
6 #define SERVICES_UI_DISPLAY_SCREEN_MANAGER_H_ 6 #define SERVICES_UI_DISPLAY_SCREEN_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "services/ui/display/screen_manager_delegate.h" 11 #include "services/ui/display/screen_manager_delegate.h"
12 12
13 namespace service_manager { 13 namespace service_manager {
14 class InterfaceRegistry; 14 class InterfaceRegistry;
15 } 15 }
16 16
17 namespace display { 17 namespace display {
18 18
19 // ScreenManager provides the necessary functionality to configure all 19 // ScreenManager provides the necessary functionality to configure all
20 // attached physical displays. 20 // attached physical displays.
21 class ScreenManager { 21 class ScreenManager {
22 public: 22 public:
23 enum WindowMode {
24 WINDOW_MODE_EXTERNAL,
rjkroege 2017/01/23 21:19:43 We've emailed enough to know what these mean but I
fwang 2017/01/24 17:11:51 Done.
25 WINDOW_MODE_INTERNAL,
26 };
27
23 ScreenManager(); 28 ScreenManager();
24 virtual ~ScreenManager(); 29 virtual ~ScreenManager();
25 30
26 // Creates a singleton ScreenManager instance. 31 // Creates a singleton ScreenManager instance.
27 static std::unique_ptr<ScreenManager> Create(); 32 static std::unique_ptr<ScreenManager> Create();
28 static ScreenManager* GetInstance(); 33 static ScreenManager* GetInstance();
29 34
30 // Registers Mojo interfaces provided. 35 // Registers Mojo interfaces provided.
31 virtual void AddInterfaces(service_manager::InterfaceRegistry* registry) = 0; 36 virtual void AddInterfaces(service_manager::InterfaceRegistry* registry) = 0;
32 37
33 // Triggers initial display configuration to start. On device this will 38 // If |window_mode| == WINDOW_MODE_EXTERNAL, no initial displays are created
34 // configuration the connected displays. Off device this will create one or 39 // or initialized. Otherwise, triggers initial display configuration to
35 // more fake displays and pretend to configure them. A non-null |delegate| 40 // start. On device this will configure the connected displays. Off device
36 // must be provided that will receive notifications when displays are added, 41 // this will create one or more fake displays and pretend to configure them. A
37 // removed or modified. 42 // non-null |delegate| must be provided that will receive notifications when
38 virtual void Init(ScreenManagerDelegate* delegate) = 0; 43 // displays are added, removed or modified.
rjkroege 2017/01/23 21:19:43 Does external mode need a delegate? I don't rememb
fwang 2017/01/24 17:11:51 Mmh, code in screen manager seems to assume the de
44 virtual void Init(ScreenManagerDelegate* delegate,
45 WindowMode window_mode) = 0;
39 46
40 // Handle requests from the platform to close a display. 47 // Handle requests from the platform to close a display.
41 virtual void RequestCloseDisplay(int64_t display_id) = 0; 48 virtual void RequestCloseDisplay(int64_t display_id) = 0;
42 49
43 virtual int64_t GetPrimaryDisplayId() const = 0; 50 virtual int64_t GetPrimaryDisplayId() const = 0;
44 51
45 private: 52 private:
46 static ScreenManager* instance_; // Instance is not owned. 53 static ScreenManager* instance_; // Instance is not owned.
47 54
48 DISALLOW_COPY_AND_ASSIGN(ScreenManager); 55 DISALLOW_COPY_AND_ASSIGN(ScreenManager);
49 }; 56 };
50 57
51 } // namespace display 58 } // namespace display
52 59
53 #endif // SERVICES_UI_DISPLAY_SCREEN_MANAGER_H_ 60 #endif // SERVICES_UI_DISPLAY_SCREEN_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | services/ui/display/screen_manager_ozone.h » ('j') | services/ui/display/screen_manager_ozone.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698