Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_FORWARDING_H_ | 5 #ifndef SERVICES_UI_DISPLAY_SCREEN_MANAGER_FORWARDING_H_ | 
| 6 #define SERVICES_UI_DISPLAY_SCREEN_MANAGER_FORWARDING_H_ | 6 #define SERVICES_UI_DISPLAY_SCREEN_MANAGER_FORWARDING_H_ | 
| 7 | 7 | 
| 8 #include <memory> | 8 #include <memory> | 
| 9 #include <unordered_map> | 9 #include <unordered_map> | 
| 10 #include <vector> | 10 #include <vector> | 
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 | 23 | 
| 24 class NativeDisplayDelegate; | 24 class NativeDisplayDelegate; | 
| 25 | 25 | 
| 26 // ScreenManager implementation that implements mojom::NativeDisplayDelegate. | 26 // ScreenManager implementation that implements mojom::NativeDisplayDelegate. | 
| 27 // This will own a real NativeDisplayDelegate and forwards calls to and | 27 // This will own a real NativeDisplayDelegate and forwards calls to and | 
| 28 // responses from it over Mojo. | 28 // responses from it over Mojo. | 
| 29 class ScreenManagerForwarding : public ScreenManager, | 29 class ScreenManagerForwarding : public ScreenManager, | 
| 30 public NativeDisplayObserver, | 30 public NativeDisplayObserver, | 
| 31 public mojom::NativeDisplayDelegate { | 31 public mojom::NativeDisplayDelegate { | 
| 32 public: | 32 public: | 
| 33 ScreenManagerForwarding(); | 33 // |in_process| is true if the UI Service runs inside WM's process, false if | 
| 
 
sky
2017/06/27 19:58:56
optional: The boolean parameter isn't particularly
 
mfomitchev
2017/07/11 21:46:59
Done.
 
 | |
| 34 // it runs inside its own process. | |
| 35 ScreenManagerForwarding(bool in_process); | |
| 
 
sky
2017/06/27 19:58:56
explicit
 
mfomitchev
2017/07/11 21:46:59
Done.
 
 | |
| 34 ~ScreenManagerForwarding() override; | 36 ~ScreenManagerForwarding() override; | 
| 35 | 37 | 
| 36 // ScreenManager: | 38 // ScreenManager: | 
| 37 void AddInterfaces(service_manager::BinderRegistry* registry) override; | 39 void AddInterfaces(service_manager::BinderRegistry* registry) override; | 
| 38 void Init(ScreenManagerDelegate* delegate) override; | 40 void Init(ScreenManagerDelegate* delegate) override; | 
| 39 void RequestCloseDisplay(int64_t display_id) override; | 41 void RequestCloseDisplay(int64_t display_id) override; | 
| 40 display::ScreenBase* GetScreen() override; | 42 display::ScreenBase* GetScreen() override; | 
| 41 | 43 | 
| 42 // NativeDisplayObserver: | 44 // NativeDisplayObserver: | 
| 43 void OnConfigurationChanged() override; | 45 void OnConfigurationChanged() override; | 
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 const std::vector<DisplaySnapshot*>& displays); | 77 const std::vector<DisplaySnapshot*>& displays); | 
| 76 | 78 | 
| 77 // Forwards results from call to Configure() back with |callback|. | 79 // Forwards results from call to Configure() back with |callback|. | 
| 78 void ForwardConfigure( | 80 void ForwardConfigure( | 
| 79 DisplaySnapshot* snapshot, | 81 DisplaySnapshot* snapshot, | 
| 80 const DisplayMode* mode, | 82 const DisplayMode* mode, | 
| 81 const gfx::Point& origin, | 83 const gfx::Point& origin, | 
| 82 const mojom::NativeDisplayDelegate::ConfigureCallback& callback, | 84 const mojom::NativeDisplayDelegate::ConfigureCallback& callback, | 
| 83 bool status); | 85 bool status); | 
| 84 | 86 | 
| 87 // True if the UI Service runs inside WM's process, false if it runs inside | |
| 88 // its own process. | |
| 89 bool in_process_; | |
| 
 
sky
2017/06/27 19:58:56
const.
 
mfomitchev
2017/07/11 21:46:59
Done.
 
 | |
| 85 std::unique_ptr<display::ScreenBase> screen_; | 90 std::unique_ptr<display::ScreenBase> screen_; | 
| 86 mojo::Binding<mojom::NativeDisplayDelegate> binding_; | 91 mojo::Binding<mojom::NativeDisplayDelegate> binding_; | 
| 87 mojom::NativeDisplayObserverPtr observer_; | 92 mojom::NativeDisplayObserverPtr observer_; | 
| 88 | 93 | 
| 89 std::unique_ptr<display::NativeDisplayDelegate> native_display_delegate_; | 94 std::unique_ptr<display::NativeDisplayDelegate> native_display_delegate_; | 
| 90 | 95 | 
| 91 // Cached pointers to snapshots owned by the |native_display_delegate_|. | 96 // Cached pointers to snapshots owned by the |native_display_delegate_|. | 
| 92 std::unordered_map<int64_t, DisplaySnapshot*> snapshot_map_; | 97 std::unordered_map<int64_t, DisplaySnapshot*> snapshot_map_; | 
| 93 | 98 | 
| 94 DISALLOW_COPY_AND_ASSIGN(ScreenManagerForwarding); | 99 DISALLOW_COPY_AND_ASSIGN(ScreenManagerForwarding); | 
| 95 }; | 100 }; | 
| 96 | 101 | 
| 97 } // namespace display | 102 } // namespace display | 
| 98 | 103 | 
| 99 #endif // SERVICES_UI_DISPLAY_SCREEN_MANAGER_FORWARDING_H_ | 104 #endif // SERVICES_UI_DISPLAY_SCREEN_MANAGER_FORWARDING_H_ | 
| OLD | NEW |