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

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

Issue 2760453003: Work In Progess
Patch Set: convert local_state to use pre_client_store_ Created 3 years, 9 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_OZONE_INTERNAL_H_ 5 #ifndef SERVICES_UI_DISPLAY_SCREEN_MANAGER_OZONE_INTERNAL_H_
6 #define SERVICES_UI_DISPLAY_SCREEN_MANAGER_OZONE_INTERNAL_H_ 6 #define SERVICES_UI_DISPLAY_SCREEN_MANAGER_OZONE_INTERNAL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "mojo/public/cpp/bindings/binding_set.h" 13 #include "mojo/public/cpp/bindings/binding_set.h"
14 #include "services/service_manager/public/cpp/connection.h" 14 #include "services/service_manager/public/cpp/connection.h"
15 #include "services/service_manager/public/cpp/interface_factory.h" 15 #include "services/service_manager/public/cpp/interface_factory.h"
16 #include "services/ui/display/screen_manager.h" 16 #include "services/ui/display/screen_manager.h"
17 #include "services/ui/display/viewport_metrics.h" 17 #include "services/ui/display/viewport_metrics.h"
18 #include "services/ui/public/interfaces/display/display_controller.mojom.h" 18 #include "services/ui/public/interfaces/display/display_controller.mojom.h"
19 #include "services/ui/public/interfaces/display/output_protection.mojom.h" 19 #include "services/ui/public/interfaces/display/output_protection.mojom.h"
20 #include "services/ui/public/interfaces/display/test_display_controller.mojom.h" 20 #include "services/ui/public/interfaces/display/test_display_controller.mojom.h"
21 #include "ui/display/display.h" 21 #include "ui/display/display.h"
22 #include "ui/display/display_observer.h" 22 #include "ui/display/display_observer.h"
23 #include "ui/display/manager/chromeos/display_configurator.h" 23 #include "ui/display/manager/chromeos/display_configurator.h"
24 #include "ui/display/manager/display_manager.h" 24 #include "ui/display/manager/display_manager.h"
25 #include "ui/display/types/display_constants.h" 25 #include "ui/display/types/display_constants.h"
26 26
27 #include "components/prefs/pref_store.h"
28 #include "services/preferences/public/cpp/pref_client_store.h"
29 #include "services/service_manager/public/cpp/connector.h"
30
27 namespace display { 31 namespace display {
28 32
29 class DisplayChangeObserver; 33 class DisplayChangeObserver;
30 class FakeDisplayController; 34 class FakeDisplayController;
31 class ScreenBase; 35 class ScreenBase;
32 class TouchTransformController; 36 class TouchTransformController;
37 class WindowManager;
33 38
34 // ScreenManagerOzoneInternal provides the necessary functionality to configure 39 // ScreenManagerOzoneInternal provides the necessary functionality to configure
35 // all attached physical displays on the the ozone platform when operating in 40 // all attached physical displays on the the ozone platform when operating in
36 // internal window mode. 41 // internal window mode.
37 class ScreenManagerOzoneInternal 42 class ScreenManagerOzoneInternal
38 : public ScreenManager, 43 : public ScreenManager,
39 public mojom::TestDisplayController, 44 public mojom::TestDisplayController,
40 public mojom::DisplayController, 45 public mojom::DisplayController,
41 public DisplayObserver, 46 public DisplayObserver,
42 public DisplayManager::Delegate, 47 public DisplayManager::Delegate,
43 public service_manager::InterfaceFactory<mojom::DisplayController>, 48 public service_manager::InterfaceFactory<mojom::DisplayController>,
44 public service_manager::InterfaceFactory<mojom::OutputProtection>, 49 public service_manager::InterfaceFactory<mojom::OutputProtection>,
45 public service_manager::InterfaceFactory<mojom::TestDisplayController> { 50 public service_manager::InterfaceFactory<mojom::TestDisplayController>,
51 public PrefStore::Observer {
46 public: 52 public:
47 ScreenManagerOzoneInternal(); 53 ScreenManagerOzoneInternal();
48 ~ScreenManagerOzoneInternal() override; 54 ~ScreenManagerOzoneInternal() override;
49 55
50 void SetPrimaryDisplayId(int64_t display_id); 56 void SetPrimaryDisplayId(int64_t display_id);
51 57
52 // ScreenManager: 58 // ScreenManager:
53 void AddInterfaces(service_manager::InterfaceRegistry* registry) override; 59 void AddInterfaces(service_manager::InterfaceRegistry* registry) override;
54 void Init(ScreenManagerDelegate* delegate) override; 60 void Init(ScreenManagerDelegate* delegate,
61 service_manager::Connector* connector) override;
55 void RequestCloseDisplay(int64_t display_id) override; 62 void RequestCloseDisplay(int64_t display_id) override;
56 63
57 // mojom::TestDisplayController: 64 // mojom::TestDisplayController:
58 void ToggleAddRemoveDisplay() override; 65 void ToggleAddRemoveDisplay() override;
59 void ToggleDisplayResolution() override; 66 void ToggleDisplayResolution() override;
60 67
61 // mojom::DisplayController: 68 // mojom::DisplayController:
62 void IncreaseInternalDisplayZoom() override; 69 void IncreaseInternalDisplayZoom() override;
63 void DecreaseInternalDisplayZoom() override; 70 void DecreaseInternalDisplayZoom() override;
64 void ResetInternalDisplayZoom() override; 71 void ResetInternalDisplayZoom() override;
65 void RotateCurrentDisplayCW() override; 72 void RotateCurrentDisplayCW() override;
66 void SwapPrimaryDisplay() override; 73 void SwapPrimaryDisplay() override;
67 void ToggleMirrorMode() override; 74 void ToggleMirrorMode() override;
68 void SetDisplayWorkArea(int64_t display_id, 75 void SetDisplayWorkArea(int64_t display_id,
69 const gfx::Size& size, 76 const gfx::Size& size,
70 const gfx::Insets& insets) override; 77 const gfx::Insets& insets) override;
71 void TakeDisplayControl(const TakeDisplayControlCallback& callback) override; 78 void TakeDisplayControl(const TakeDisplayControlCallback& callback) override;
72 void RelinquishDisplayControl( 79 void RelinquishDisplayControl(
73 const RelinquishDisplayControlCallback& callback) override; 80 const RelinquishDisplayControlCallback& callback) override;
74 81
82 void OnPrefValueChanged(const std::string& key) override;
83 void OnInitializationCompleted(bool succeeded) override;
84 base::DictionaryValue* changed_prefs() { return &changed_prefs_; }
85
75 private: 86 private:
76 friend class ScreenManagerOzoneInternalTest; 87 friend class ScreenManagerOzoneInternalTest;
77 88
78 ViewportMetrics GetViewportMetricsForDisplay(const Display& display); 89 ViewportMetrics GetViewportMetricsForDisplay(const Display& display);
79 90
80 // DisplayObserver: 91 // DisplayObserver:
81 void OnDisplayAdded(const Display& new_display) override; 92 void OnDisplayAdded(const Display& new_display) override;
82 void OnDisplayRemoved(const Display& old_display) override; 93 void OnDisplayRemoved(const Display& old_display) override;
83 void OnDisplayMetricsChanged(const Display& display, 94 void OnDisplayMetricsChanged(const Display& display,
84 uint32_t changed_metrics) override; 95 uint32_t changed_metrics) override;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 133
123 // If not null it provides a way to modify the display state when running off 134 // If not null it provides a way to modify the display state when running off
124 // device (eg. running mustash on Linux). 135 // device (eg. running mustash on Linux).
125 FakeDisplayController* fake_display_controller_ = nullptr; 136 FakeDisplayController* fake_display_controller_ = nullptr;
126 137
127 int64_t primary_display_id_ = kInvalidDisplayId; 138 int64_t primary_display_id_ = kInvalidDisplayId;
128 139
129 mojo::BindingSet<mojom::DisplayController> controller_bindings_; 140 mojo::BindingSet<mojom::DisplayController> controller_bindings_;
130 mojo::BindingSet<mojom::TestDisplayController> test_bindings_; 141 mojo::BindingSet<mojom::TestDisplayController> test_bindings_;
131 142
143 service_manager::Connector* connector_;
144 prefs::mojom::PreferencesServiceFactoryPtr pref_factory_ptr;
145 scoped_refptr<preferences::PrefClientStore> pref_client_store_;
146 base::DictionaryValue changed_prefs_;
147 bool initialization_completed_ = false;
148 WindowManager* window_manager_;
149
132 DISALLOW_COPY_AND_ASSIGN(ScreenManagerOzoneInternal); 150 DISALLOW_COPY_AND_ASSIGN(ScreenManagerOzoneInternal);
133 }; 151 };
134 152
135 } // namespace display 153 } // namespace display
136 154
137 #endif // SERVICES_UI_DISPLAY_SCREEN_MANAGER_OZONE_INTERNAL_H_ 155 #endif // SERVICES_UI_DISPLAY_SCREEN_MANAGER_OZONE_INTERNAL_H_
OLDNEW
« no previous file with comments | « services/ui/display/screen_manager.h ('k') | services/ui/display/screen_manager_ozone_internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698