| 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_WINDOW_TREE_HOST_MANAGER_H_ | 5 #ifndef ASH_DISPLAY_WINDOW_TREE_HOST_MANAGER_H_ |
| 6 #define ASH_DISPLAY_WINDOW_TREE_HOST_MANAGER_H_ | 6 #define ASH_DISPLAY_WINDOW_TREE_HOST_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 namespace gfx { | 33 namespace gfx { |
| 34 class Insets; | 34 class Insets; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace ash { | 37 namespace ash { |
| 38 class AshWindowTreeHost; | 38 class AshWindowTreeHost; |
| 39 struct AshWindowTreeHostInitParams; | 39 struct AshWindowTreeHostInitParams; |
| 40 class CursorWindowController; | 40 class CursorWindowController; |
| 41 class FocusActivationStore; | 41 class FocusActivationStore; |
| 42 class InputMethodEventHandler; | |
| 43 class MirrorWindowController; | 42 class MirrorWindowController; |
| 44 class RootWindowController; | 43 class RootWindowController; |
| 45 | 44 |
| 46 // WindowTreeHostManager owns and maintains RootWindows for each attached | 45 // WindowTreeHostManager owns and maintains RootWindows for each attached |
| 47 // display, keeping them in sync with display configuration changes. | 46 // display, keeping them in sync with display configuration changes. |
| 48 class ASH_EXPORT WindowTreeHostManager | 47 class ASH_EXPORT WindowTreeHostManager |
| 49 : public display::DisplayObserver, | 48 : public display::DisplayObserver, |
| 50 public aura::WindowTreeHostObserver, | 49 public aura::WindowTreeHostObserver, |
| 51 public display::DisplayManager::Delegate, | 50 public display::DisplayManager::Delegate, |
| 52 public ui::internal::InputMethodDelegate { | 51 public ui::internal::InputMethodDelegate { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 const display::DisplayInfoList& info_list) override; | 152 const display::DisplayInfoList& info_list) override; |
| 154 void CloseMirroringDisplayIfNotNecessary() override; | 153 void CloseMirroringDisplayIfNotNecessary() override; |
| 155 void PreDisplayConfigurationChange(bool clear_focus) override; | 154 void PreDisplayConfigurationChange(bool clear_focus) override; |
| 156 void PostDisplayConfigurationChange(bool must_clear_window) override; | 155 void PostDisplayConfigurationChange(bool must_clear_window) override; |
| 157 display::DisplayConfigurator* display_configurator() override; | 156 display::DisplayConfigurator* display_configurator() override; |
| 158 | 157 |
| 159 // ui::internal::InputMethodDelegate overrides: | 158 // ui::internal::InputMethodDelegate overrides: |
| 160 ui::EventDispatchDetails DispatchKeyEventPostIME( | 159 ui::EventDispatchDetails DispatchKeyEventPostIME( |
| 161 ui::KeyEvent* event) override; | 160 ui::KeyEvent* event) override; |
| 162 | 161 |
| 163 InputMethodEventHandler* input_method_event_handler() { | |
| 164 return input_method_event_handler_.get(); | |
| 165 } | |
| 166 | |
| 167 private: | 162 private: |
| 168 FRIEND_TEST_ALL_PREFIXES(WindowTreeHostManagerTest, BoundsUpdated); | 163 FRIEND_TEST_ALL_PREFIXES(WindowTreeHostManagerTest, BoundsUpdated); |
| 169 FRIEND_TEST_ALL_PREFIXES(WindowTreeHostManagerTest, SecondaryDisplayLayout); | 164 FRIEND_TEST_ALL_PREFIXES(WindowTreeHostManagerTest, SecondaryDisplayLayout); |
| 170 friend class MirrorWindowController; | 165 friend class MirrorWindowController; |
| 171 | 166 |
| 172 // Creates a WindowTreeHost for |display| and stores it in the | 167 // Creates a WindowTreeHost for |display| and stores it in the |
| 173 // |window_tree_hosts_| map. | 168 // |window_tree_hosts_| map. |
| 174 AshWindowTreeHost* AddWindowTreeHostForDisplay( | 169 AshWindowTreeHost* AddWindowTreeHostForDisplay( |
| 175 const display::Display& display, | 170 const display::Display& display, |
| 176 const AshWindowTreeHostInitParams& params); | 171 const AshWindowTreeHostInitParams& params); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 188 // Store the primary window tree host temporarily while replacing | 183 // Store the primary window tree host temporarily while replacing |
| 189 // display. | 184 // display. |
| 190 AshWindowTreeHost* primary_tree_host_for_replace_; | 185 AshWindowTreeHost* primary_tree_host_for_replace_; |
| 191 | 186 |
| 192 std::unique_ptr<FocusActivationStore> focus_activation_store_; | 187 std::unique_ptr<FocusActivationStore> focus_activation_store_; |
| 193 | 188 |
| 194 std::unique_ptr<CursorWindowController> cursor_window_controller_; | 189 std::unique_ptr<CursorWindowController> cursor_window_controller_; |
| 195 std::unique_ptr<MirrorWindowController> mirror_window_controller_; | 190 std::unique_ptr<MirrorWindowController> mirror_window_controller_; |
| 196 | 191 |
| 197 std::unique_ptr<ui::InputMethod> input_method_; | 192 std::unique_ptr<ui::InputMethod> input_method_; |
| 198 std::unique_ptr<InputMethodEventHandler> input_method_event_handler_; | |
| 199 | 193 |
| 200 // Stores the current cursor location (in native coordinates and screen | 194 // Stores the current cursor location (in native coordinates and screen |
| 201 // coordinates respectively). The locations are used to restore the cursor | 195 // coordinates respectively). The locations are used to restore the cursor |
| 202 // location when the display configuration changes and to determine whether | 196 // location when the display configuration changes and to determine whether |
| 203 // the mouse should be moved after a display configuration change. | 197 // the mouse should be moved after a display configuration change. |
| 204 gfx::Point cursor_location_in_native_coords_for_restore_; | 198 gfx::Point cursor_location_in_native_coords_for_restore_; |
| 205 gfx::Point cursor_location_in_screen_coords_for_restore_; | 199 gfx::Point cursor_location_in_screen_coords_for_restore_; |
| 206 | 200 |
| 207 // Stores the cursor's display. The id is used to determine whether the mouse | 201 // Stores the cursor's display. The id is used to determine whether the mouse |
| 208 // should be moved after a display configuration change. | 202 // should be moved after a display configuration change. |
| 209 int64_t cursor_display_id_for_restore_; | 203 int64_t cursor_display_id_for_restore_; |
| 210 | 204 |
| 211 base::WeakPtrFactory<WindowTreeHostManager> weak_ptr_factory_; | 205 base::WeakPtrFactory<WindowTreeHostManager> weak_ptr_factory_; |
| 212 | 206 |
| 213 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostManager); | 207 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostManager); |
| 214 }; | 208 }; |
| 215 | 209 |
| 216 } // namespace ash | 210 } // namespace ash |
| 217 | 211 |
| 218 #endif // ASH_DISPLAY_WINDOW_TREE_HOST_MANAGER_H_ | 212 #endif // ASH_DISPLAY_WINDOW_TREE_HOST_MANAGER_H_ |
| OLD | NEW |