| 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 18 matching lines...) Expand all Loading... |
| 29 namespace base { | 29 namespace base { |
| 30 class Value; | 30 class Value; |
| 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 ui { |
| 40 class ContextFactory; |
| 41 } |
| 42 |
| 39 namespace ash { | 43 namespace ash { |
| 40 class AshWindowTreeHost; | 44 class AshWindowTreeHost; |
| 41 struct AshWindowTreeHostInitParams; | 45 struct AshWindowTreeHostInitParams; |
| 42 class CursorWindowController; | 46 class CursorWindowController; |
| 43 class DisplayInfo; | 47 class DisplayInfo; |
| 44 class DisplayManager; | 48 class DisplayManager; |
| 45 class FocusActivationStore; | 49 class FocusActivationStore; |
| 46 class MirrorWindowController; | 50 class MirrorWindowController; |
| 47 class RootWindowController; | 51 class RootWindowController; |
| 48 class VirtualKeyboardWindowController; | 52 class VirtualKeyboardWindowController; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 64 virtual void OnDisplayConfigurationChanging() {} | 68 virtual void OnDisplayConfigurationChanging() {} |
| 65 | 69 |
| 66 // Invoked when the all display configuration changes | 70 // Invoked when the all display configuration changes |
| 67 // have been applied. | 71 // have been applied. |
| 68 virtual void OnDisplayConfigurationChanged() {}; | 72 virtual void OnDisplayConfigurationChanged() {}; |
| 69 | 73 |
| 70 protected: | 74 protected: |
| 71 virtual ~Observer() {} | 75 virtual ~Observer() {} |
| 72 }; | 76 }; |
| 73 | 77 |
| 74 DisplayController(); | 78 explicit DisplayController(ui::ContextFactory* context_factory); |
| 75 virtual ~DisplayController(); | 79 virtual ~DisplayController(); |
| 76 | 80 |
| 77 void Start(); | 81 void Start(); |
| 78 void Shutdown(); | 82 void Shutdown(); |
| 79 | 83 |
| 80 // Returns primary display's ID. | 84 // Returns primary display's ID. |
| 81 // TODO(oshima): Move this out from DisplayController; | 85 // TODO(oshima): Move this out from DisplayController; |
| 82 static int64 GetPrimaryDisplayId(); | 86 static int64 GetPrimaryDisplayId(); |
| 83 | 87 |
| 84 CursorWindowController* cursor_window_controller() { | 88 CursorWindowController* cursor_window_controller() { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 192 |
| 189 bool IsThrottled() const; | 193 bool IsThrottled() const; |
| 190 | 194 |
| 191 private: | 195 private: |
| 192 // The time when the throttling ends. | 196 // The time when the throttling ends. |
| 193 base::Time throttle_timeout_; | 197 base::Time throttle_timeout_; |
| 194 | 198 |
| 195 DISALLOW_COPY_AND_ASSIGN(DisplayChangeLimiter); | 199 DISALLOW_COPY_AND_ASSIGN(DisplayChangeLimiter); |
| 196 }; | 200 }; |
| 197 | 201 |
| 202 ui::ContextFactory* context_factory_; |
| 203 |
| 198 // The limiter to throttle how fast a user can | 204 // The limiter to throttle how fast a user can |
| 199 // change the display configuration. | 205 // change the display configuration. |
| 200 scoped_ptr<DisplayChangeLimiter> limiter_; | 206 scoped_ptr<DisplayChangeLimiter> limiter_; |
| 201 | 207 |
| 202 typedef std::map<int64, AshWindowTreeHost*> WindowTreeHostMap; | 208 typedef std::map<int64, AshWindowTreeHost*> WindowTreeHostMap; |
| 203 // The mapping from display ID to its window tree host. | 209 // The mapping from display ID to its window tree host. |
| 204 WindowTreeHostMap window_tree_hosts_; | 210 WindowTreeHostMap window_tree_hosts_; |
| 205 | 211 |
| 206 ObserverList<Observer> observers_; | 212 ObserverList<Observer> observers_; |
| 207 | 213 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 220 // restore the cursor location when display configuration | 226 // restore the cursor location when display configuration |
| 221 // changed. | 227 // changed. |
| 222 gfx::Point cursor_location_in_native_coords_for_restore_; | 228 gfx::Point cursor_location_in_native_coords_for_restore_; |
| 223 | 229 |
| 224 DISALLOW_COPY_AND_ASSIGN(DisplayController); | 230 DISALLOW_COPY_AND_ASSIGN(DisplayController); |
| 225 }; | 231 }; |
| 226 | 232 |
| 227 } // namespace ash | 233 } // namespace ash |
| 228 | 234 |
| 229 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 235 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
| OLD | NEW |