| 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 <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 template <typename T> class JSONValueConverter; | 31 template <typename T> class JSONValueConverter; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace gfx { | 34 namespace gfx { |
| 35 class Display; | 35 class Display; |
| 36 class Insets; | 36 class Insets; |
| 37 } | 37 } |
| 38 | 38 |
| 39 namespace ash { | 39 namespace ash { |
| 40 namespace internal { | 40 namespace internal { |
| 41 class CursorWindowController; |
| 41 class DisplayInfo; | 42 class DisplayInfo; |
| 42 class DisplayManager; | 43 class DisplayManager; |
| 43 class FocusActivationStore; | 44 class FocusActivationStore; |
| 44 class MirrorWindowController; | 45 class MirrorWindowController; |
| 45 class RootWindowController; | 46 class RootWindowController; |
| 46 class VirtualKeyboardWindowController; | 47 class VirtualKeyboardWindowController; |
| 47 } | 48 } |
| 48 | 49 |
| 49 // DisplayController owns and maintains RootWindows for each attached | 50 // DisplayController owns and maintains RootWindows for each attached |
| 50 // display, keeping them in sync with display configuration changes. | 51 // display, keeping them in sync with display configuration changes. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 69 DisplayController(); | 70 DisplayController(); |
| 70 virtual ~DisplayController(); | 71 virtual ~DisplayController(); |
| 71 | 72 |
| 72 void Start(); | 73 void Start(); |
| 73 void Shutdown(); | 74 void Shutdown(); |
| 74 | 75 |
| 75 // Returns primary display's ID. | 76 // Returns primary display's ID. |
| 76 // TODO(oshima): Move this out from DisplayController; | 77 // TODO(oshima): Move this out from DisplayController; |
| 77 static int64 GetPrimaryDisplayId(); | 78 static int64 GetPrimaryDisplayId(); |
| 78 | 79 |
| 80 internal::CursorWindowController* cursor_window_controller() { |
| 81 return cursor_window_controller_.get(); |
| 82 } |
| 83 |
| 79 internal::MirrorWindowController* mirror_window_controller() { | 84 internal::MirrorWindowController* mirror_window_controller() { |
| 80 return mirror_window_controller_.get(); | 85 return mirror_window_controller_.get(); |
| 81 } | 86 } |
| 82 | 87 |
| 83 internal::VirtualKeyboardWindowController* | 88 internal::VirtualKeyboardWindowController* |
| 84 virtual_keyboard_window_controller() { | 89 virtual_keyboard_window_controller() { |
| 85 return virtual_keyboard_window_controller_.get(); | 90 return virtual_keyboard_window_controller_.get(); |
| 86 } | 91 } |
| 87 | 92 |
| 88 // Initializes primary display. | 93 // Initializes primary display. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 100 | 105 |
| 101 // Returns the root window for |display_id|. | 106 // Returns the root window for |display_id|. |
| 102 aura::Window* GetRootWindowForDisplayId(int64 id); | 107 aura::Window* GetRootWindowForDisplayId(int64 id); |
| 103 | 108 |
| 104 // Toggle mirror mode. | 109 // Toggle mirror mode. |
| 105 void ToggleMirrorMode(); | 110 void ToggleMirrorMode(); |
| 106 | 111 |
| 107 // Swap primary and secondary display. | 112 // Swap primary and secondary display. |
| 108 void SwapPrimaryDisplay(); | 113 void SwapPrimaryDisplay(); |
| 109 | 114 |
| 115 // Enable/Disable cursor compositing. |
| 116 void SetCursorCompositingEnabled(bool enabled); |
| 117 |
| 118 // Sets the display on which to draw cursor. |
| 119 // Only applicable when cursor compositing is enabled. |
| 120 void SetDisplayForCursor(const gfx::Display& display); |
| 121 |
| 110 // Sets the ID of the primary display. If the display is not connected, it | 122 // Sets the ID of the primary display. If the display is not connected, it |
| 111 // will switch the primary display when connected. | 123 // will switch the primary display when connected. |
| 112 void SetPrimaryDisplayId(int64 id); | 124 void SetPrimaryDisplayId(int64 id); |
| 113 | 125 |
| 114 // Sets primary display. This re-assigns the current root | 126 // Sets primary display. This re-assigns the current root |
| 115 // window to given |display|. | 127 // window to given |display|. |
| 116 void SetPrimaryDisplay(const gfx::Display& display); | 128 void SetPrimaryDisplay(const gfx::Display& display); |
| 117 | 129 |
| 118 // Closes all child windows in the all root windows. | 130 // Closes all child windows in the all root windows. |
| 119 void CloseChildWindows(); | 131 void CloseChildWindows(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 friend class internal::MirrorWindowController; | 173 friend class internal::MirrorWindowController; |
| 162 | 174 |
| 163 // Creates a root window for |display| and stores it in the |root_windows_| | 175 // Creates a root window for |display| and stores it in the |root_windows_| |
| 164 // map. | 176 // map. |
| 165 aura::RootWindow* AddRootWindowForDisplay(const gfx::Display& display); | 177 aura::RootWindow* AddRootWindowForDisplay(const gfx::Display& display); |
| 166 | 178 |
| 167 void OnFadeOutForSwapDisplayFinished(); | 179 void OnFadeOutForSwapDisplayFinished(); |
| 168 | 180 |
| 169 void UpdateHostWindowNames(); | 181 void UpdateHostWindowNames(); |
| 170 | 182 |
| 183 void UpdateCursorWindowContainer(); |
| 184 |
| 171 class DisplayChangeLimiter { | 185 class DisplayChangeLimiter { |
| 172 public: | 186 public: |
| 173 DisplayChangeLimiter(); | 187 DisplayChangeLimiter(); |
| 174 | 188 |
| 175 // Sets how long the throttling should last. | 189 // Sets how long the throttling should last. |
| 176 void SetThrottleTimeout(int64 throttle_ms); | 190 void SetThrottleTimeout(int64 throttle_ms); |
| 177 | 191 |
| 178 bool IsThrottled() const; | 192 bool IsThrottled() const; |
| 179 | 193 |
| 180 private: | 194 private: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 192 std::map<int64, aura::Window*> root_windows_; | 206 std::map<int64, aura::Window*> root_windows_; |
| 193 | 207 |
| 194 ObserverList<Observer> observers_; | 208 ObserverList<Observer> observers_; |
| 195 | 209 |
| 196 // Store the primary root window temporarily while replacing | 210 // Store the primary root window temporarily while replacing |
| 197 // display. | 211 // display. |
| 198 aura::Window* primary_root_window_for_replace_; | 212 aura::Window* primary_root_window_for_replace_; |
| 199 | 213 |
| 200 scoped_ptr<internal::FocusActivationStore> focus_activation_store_; | 214 scoped_ptr<internal::FocusActivationStore> focus_activation_store_; |
| 201 | 215 |
| 216 scoped_ptr<internal::CursorWindowController> cursor_window_controller_; |
| 202 scoped_ptr<internal::MirrorWindowController> mirror_window_controller_; | 217 scoped_ptr<internal::MirrorWindowController> mirror_window_controller_; |
| 203 scoped_ptr<internal::VirtualKeyboardWindowController> | 218 scoped_ptr<internal::VirtualKeyboardWindowController> |
| 204 virtual_keyboard_window_controller_; | 219 virtual_keyboard_window_controller_; |
| 205 | 220 |
| 206 // Stores the curent cursor location (in native coordinates) used to | 221 // Stores the curent cursor location (in native coordinates) used to |
| 207 // restore the cursor location when display configuration | 222 // restore the cursor location when display configuration |
| 208 // changed. | 223 // changed. |
| 209 gfx::Point cursor_location_in_native_coords_for_restore_; | 224 gfx::Point cursor_location_in_native_coords_for_restore_; |
| 210 | 225 |
| 211 DISALLOW_COPY_AND_ASSIGN(DisplayController); | 226 DISALLOW_COPY_AND_ASSIGN(DisplayController); |
| 212 }; | 227 }; |
| 213 | 228 |
| 214 } // namespace ash | 229 } // namespace ash |
| 215 | 230 |
| 216 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 231 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
| OLD | NEW |