OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
6 #define ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 6 #define ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "ash/ash_export.h" | 14 #include "ash/ash_export.h" |
15 #include "ash/display/display_manager.h" | |
16 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
17 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
18 #include "base/macros.h" | 17 #include "base/macros.h" |
19 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
20 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
21 #include "base/time/time.h" | 20 #include "base/time/time.h" |
22 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
23 #include "ui/aura/window_tree_host_observer.h" | 22 #include "ui/aura/window_tree_host_observer.h" |
24 #include "ui/base/ime/input_method.h" | 23 #include "ui/base/ime/input_method.h" |
25 #include "ui/base/ime/input_method_delegate.h" | 24 #include "ui/base/ime/input_method_delegate.h" |
26 #include "ui/display/display_observer.h" | 25 #include "ui/display/display_observer.h" |
| 26 #include "ui/display/manager/display_manager.h" |
27 #include "ui/gfx/geometry/point.h" | 27 #include "ui/gfx/geometry/point.h" |
28 | 28 |
29 namespace aura { | 29 namespace aura { |
30 class WindowTreeHost; | 30 class WindowTreeHost; |
31 } | 31 } |
32 | 32 |
33 namespace base { | 33 namespace base { |
34 class Value; | 34 class Value; |
35 template <typename T> | 35 template <typename T> |
36 class JSONValueConverter; | 36 class JSONValueConverter; |
37 } | 37 } |
38 | 38 |
39 namespace gfx { | 39 namespace gfx { |
40 class Insets; | 40 class Insets; |
41 } | 41 } |
42 | 42 |
43 namespace ash { | 43 namespace ash { |
44 class AshWindowTreeHost; | 44 class AshWindowTreeHost; |
45 struct AshWindowTreeHostInitParams; | 45 struct AshWindowTreeHostInitParams; |
46 class CursorWindowController; | 46 class CursorWindowController; |
47 class DisplayManager; | |
48 class FocusActivationStore; | 47 class FocusActivationStore; |
49 class InputMethodEventHandler; | 48 class InputMethodEventHandler; |
50 class MirrorWindowController; | 49 class MirrorWindowController; |
51 class RootWindowController; | 50 class RootWindowController; |
52 | 51 |
53 // WindowTreeHostManager owns and maintains RootWindows for each attached | 52 // WindowTreeHostManager owns and maintains RootWindows for each attached |
54 // display, keeping them in sync with display configuration changes. | 53 // display, keeping them in sync with display configuration changes. |
55 class ASH_EXPORT WindowTreeHostManager | 54 class ASH_EXPORT WindowTreeHostManager |
56 : public display::DisplayObserver, | 55 : public display::DisplayObserver, |
57 public aura::WindowTreeHostObserver, | 56 public aura::WindowTreeHostObserver, |
58 public DisplayManager::Delegate, | 57 public display::DisplayManager::Delegate, |
59 public ui::internal::InputMethodDelegate { | 58 public ui::internal::InputMethodDelegate { |
60 public: | 59 public: |
61 // TODO(oshima): Consider moving this to display::DisplayObserver. | 60 // TODO(oshima): Consider moving this to display::DisplayObserver. |
62 class ASH_EXPORT Observer { | 61 class ASH_EXPORT Observer { |
63 public: | 62 public: |
64 // Invoked only once after all displays are initialized | 63 // Invoked only once after all displays are initialized |
65 // after startup. | 64 // after startup. |
66 virtual void OnDisplaysInitialized() {} | 65 virtual void OnDisplaysInitialized() {} |
67 | 66 |
68 // Invoked when the display configuration change is requested, | 67 // Invoked when the display configuration change is requested, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 150 |
152 // display::DisplayObserver overrides: | 151 // display::DisplayObserver overrides: |
153 void OnDisplayAdded(const display::Display& display) override; | 152 void OnDisplayAdded(const display::Display& display) override; |
154 void OnDisplayRemoved(const display::Display& display) override; | 153 void OnDisplayRemoved(const display::Display& display) override; |
155 void OnDisplayMetricsChanged(const display::Display& display, | 154 void OnDisplayMetricsChanged(const display::Display& display, |
156 uint32_t metrics) override; | 155 uint32_t metrics) override; |
157 | 156 |
158 // aura::WindowTreeHostObserver overrides: | 157 // aura::WindowTreeHostObserver overrides: |
159 void OnHostResized(const aura::WindowTreeHost* host) override; | 158 void OnHostResized(const aura::WindowTreeHost* host) override; |
160 | 159 |
161 // ash::DisplayManager::Delegate overrides: | 160 // display::DisplayManager::Delegate overrides: |
162 void CreateOrUpdateMirroringDisplay( | 161 void CreateOrUpdateMirroringDisplay( |
163 const DisplayInfoList& info_list) override; | 162 const display::DisplayInfoList& info_list) override; |
164 void CloseMirroringDisplayIfNotNecessary() override; | 163 void CloseMirroringDisplayIfNotNecessary() override; |
165 void PreDisplayConfigurationChange(bool clear_focus) override; | 164 void PreDisplayConfigurationChange(bool clear_focus) override; |
166 void PostDisplayConfigurationChange() override; | 165 void PostDisplayConfigurationChange(bool must_clear_window) override; |
167 #if defined(OS_CHROMEOS) | 166 #if defined(OS_CHROMEOS) |
168 ui::DisplayConfigurator* display_configurator() override; | 167 ui::DisplayConfigurator* display_configurator() override; |
169 #endif | 168 #endif |
170 std::string GetInternalDisplayNameString() override; | 169 std::string GetInternalDisplayNameString() override; |
171 std::string GetUnknownDisplayNameString() override; | 170 std::string GetUnknownDisplayNameString() override; |
172 | 171 |
173 // ui::internal::InputMethodDelegate overrides: | 172 // ui::internal::InputMethodDelegate overrides: |
174 ui::EventDispatchDetails DispatchKeyEventPostIME( | 173 ui::EventDispatchDetails DispatchKeyEventPostIME( |
175 ui::KeyEvent* event) override; | 174 ui::KeyEvent* event) override; |
176 | 175 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 int64_t cursor_display_id_for_restore_; | 223 int64_t cursor_display_id_for_restore_; |
225 | 224 |
226 base::WeakPtrFactory<WindowTreeHostManager> weak_ptr_factory_; | 225 base::WeakPtrFactory<WindowTreeHostManager> weak_ptr_factory_; |
227 | 226 |
228 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostManager); | 227 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostManager); |
229 }; | 228 }; |
230 | 229 |
231 } // namespace ash | 230 } // namespace ash |
232 | 231 |
233 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 232 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
OLD | NEW |