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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 | 61 |
62 // Returns all oot window controllers. In non extended desktop | 62 // Returns all oot window controllers. In non extended desktop |
63 // mode, this return a RootWindowController for the primary root window only. | 63 // mode, this return a RootWindowController for the primary root window only. |
64 std::vector<internal::RootWindowController*> GetAllRootWindowControllers(); | 64 std::vector<internal::RootWindowController*> GetAllRootWindowControllers(); |
65 | 65 |
66 SecondaryDisplayLayout secondary_display_layout() const { | 66 SecondaryDisplayLayout secondary_display_layout() const { |
67 return secondary_display_layout_; | 67 return secondary_display_layout_; |
68 } | 68 } |
69 void SetSecondaryDisplayLayout(SecondaryDisplayLayout layout); | 69 void SetSecondaryDisplayLayout(SecondaryDisplayLayout layout); |
70 | 70 |
71 void set_allow_warp_during_lock(bool allow_warp_during_lock) { | |
sky
2012/08/03 17:07:18
This (or the field) needs a go description as to w
Yusuke Sato
2012/08/03 23:18:45
Add a detailed description to the field.
| |
72 allow_warp_during_lock_ = allow_warp_during_lock; | |
Daniel Erat
2012/08/03 19:43:10
nit: s/allow_warp/allow_mouse_warp/ or similar
Yusuke Sato
2012/08/03 23:18:45
Done.
| |
73 } | |
74 | |
71 // Warps the mouse cursor to an alternate root window when the | 75 // Warps the mouse cursor to an alternate root window when the |
72 // |point_in_root|, which is the location of the mouse cursor, | 76 // |point_in_root|, which is the location of the mouse cursor, |
73 // hits or exceeds the edge of the |root_window| and the mouse cursor | 77 // hits or exceeds the edge of the |root_window| and the mouse cursor |
74 // is considered to be in an alternate display. Returns true if | 78 // is considered to be in an alternate display. Returns true if |
75 // the cursor was moved. | 79 // the cursor was moved. |
76 bool WarpMouseCursorIfNecessary(aura::RootWindow* root_window, | 80 bool WarpMouseCursorIfNecessary(aura::RootWindow* root_window, |
77 const gfx::Point& point_in_root); | 81 const gfx::Point& point_in_root, |
82 bool is_cursor_locked); | |
78 | 83 |
79 // aura::DisplayObserver overrides: | 84 // aura::DisplayObserver overrides: |
80 virtual void OnDisplayBoundsChanged( | 85 virtual void OnDisplayBoundsChanged( |
81 const gfx::Display& display) OVERRIDE; | 86 const gfx::Display& display) OVERRIDE; |
82 virtual void OnDisplayAdded(const gfx::Display& display) OVERRIDE; | 87 virtual void OnDisplayAdded(const gfx::Display& display) OVERRIDE; |
83 virtual void OnDisplayRemoved(const gfx::Display& display) OVERRIDE; | 88 virtual void OnDisplayRemoved(const gfx::Display& display) OVERRIDE; |
84 | 89 |
85 // Is extended desktop enabled? | 90 // Is extended desktop enabled? |
86 static bool IsExtendedDesktopEnabled(); | 91 static bool IsExtendedDesktopEnabled(); |
87 | 92 |
88 private: | 93 private: |
89 // Creates a root window for |display| and stores it in the |root_windows_| | 94 // Creates a root window for |display| and stores it in the |root_windows_| |
90 // map. | 95 // map. |
91 aura::RootWindow* AddRootWindowForDisplay(const gfx::Display& display); | 96 aura::RootWindow* AddRootWindowForDisplay(const gfx::Display& display); |
92 | 97 |
93 void UpdateDisplayBoundsForLayout(); | 98 void UpdateDisplayBoundsForLayout(); |
94 | 99 |
95 std::map<int, aura::RootWindow*> root_windows_; | 100 std::map<int, aura::RootWindow*> root_windows_; |
96 | 101 |
97 SecondaryDisplayLayout secondary_display_layout_; | 102 SecondaryDisplayLayout secondary_display_layout_; |
98 | 103 |
104 // If true, the cursor can warp even when it's locked. | |
Daniel Erat
2012/08/03 19:43:10
I'd prefer that we used "cursor" to refer just to
Yusuke Sato
2012/08/03 23:18:45
Fixed the comment. I'll rename MoveCursorTo if nec
| |
105 bool allow_warp_during_lock_; | |
106 | |
99 DISALLOW_COPY_AND_ASSIGN(DisplayController); | 107 DISALLOW_COPY_AND_ASSIGN(DisplayController); |
100 }; | 108 }; |
101 | 109 |
102 } // namespace internal | 110 } // namespace internal |
103 } // namespace ash | 111 } // namespace ash |
104 | 112 |
105 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ | 113 #endif // ASH_DISPLAY_DISPLAY_CONTROLLER_H_ |
OLD | NEW |