| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_AURA_DESKTOP_H_ | 5 #ifndef UI_AURA_DESKTOP_H_ |
| 6 #define UI_AURA_DESKTOP_H_ | 6 #define UI_AURA_DESKTOP_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // Returns the desktop's dispatcher. The result should only be passed to | 115 // Returns the desktop's dispatcher. The result should only be passed to |
| 116 // MessageLoopForUI::RunWithDispatcher() or | 116 // MessageLoopForUI::RunWithDispatcher() or |
| 117 // MessageLoopForUI::RunAllPendingWithDispatcher(), or used to dispatch | 117 // MessageLoopForUI::RunAllPendingWithDispatcher(), or used to dispatch |
| 118 // an event by |Dispatch(const NativeEvent&)| on it. It must never be stored. | 118 // an event by |Dispatch(const NativeEvent&)| on it. It must never be stored. |
| 119 MessageLoop::Dispatcher* GetDispatcher(); | 119 MessageLoop::Dispatcher* GetDispatcher(); |
| 120 | 120 |
| 121 // Add/remove observer. | 121 // Add/remove observer. |
| 122 void AddObserver(DesktopObserver* observer); | 122 void AddObserver(DesktopObserver* observer); |
| 123 void RemoveObserver(DesktopObserver* observer); | 123 void RemoveObserver(DesktopObserver* observer); |
| 124 | 124 |
| 125 // Are any mouse buttons currently down? |
| 126 bool IsMouseButtonDown() const; |
| 127 |
| 125 // Capture ------------------------------------------------------------------- | 128 // Capture ------------------------------------------------------------------- |
| 126 | 129 |
| 127 // Sets capture to the specified window. | 130 // Sets capture to the specified window. |
| 128 void SetCapture(Window* window); | 131 void SetCapture(Window* window); |
| 129 | 132 |
| 130 // If |window| has mouse capture, the current capture window is set to NULL. | 133 // If |window| has mouse capture, the current capture window is set to NULL. |
| 131 void ReleaseCapture(Window* window); | 134 void ReleaseCapture(Window* window); |
| 132 | 135 |
| 133 // Overridden from Window: | 136 // Overridden from Window: |
| 134 virtual void SetTransform(const ui::Transform& transform) OVERRIDE; | 137 virtual void SetTransform(const ui::Transform& transform) OVERRIDE; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 static bool use_fullscreen_host_window_; | 188 static bool use_fullscreen_host_window_; |
| 186 | 189 |
| 187 // Used to schedule painting. | 190 // Used to schedule painting. |
| 188 base::WeakPtrFactory<Desktop> schedule_paint_factory_; | 191 base::WeakPtrFactory<Desktop> schedule_paint_factory_; |
| 189 | 192 |
| 190 Window* active_window_; | 193 Window* active_window_; |
| 191 | 194 |
| 192 // Last location seen in a mouse event. | 195 // Last location seen in a mouse event. |
| 193 gfx::Point last_mouse_location_; | 196 gfx::Point last_mouse_location_; |
| 194 | 197 |
| 198 // ui::EventFlags containing the current state of the mouse buttons. |
| 199 int mouse_button_flags_; |
| 200 |
| 195 // Last cursor set. Used for testing. | 201 // Last cursor set. Used for testing. |
| 196 gfx::NativeCursor last_cursor_; | 202 gfx::NativeCursor last_cursor_; |
| 197 | 203 |
| 198 // Are we in the process of being destroyed? Used to avoid processing during | 204 // Are we in the process of being destroyed? Used to avoid processing during |
| 199 // destruction. | 205 // destruction. |
| 200 bool in_destructor_; | 206 bool in_destructor_; |
| 201 | 207 |
| 202 ObserverList<DesktopObserver> observers_; | 208 ObserverList<DesktopObserver> observers_; |
| 203 | 209 |
| 204 ScreenAura* screen_; | 210 ScreenAura* screen_; |
| 205 | 211 |
| 206 // The capture window. When not-null, this window receives all the mouse and | 212 // The capture window. When not-null, this window receives all the mouse and |
| 207 // touch events. | 213 // touch events. |
| 208 Window* capture_window_; | 214 Window* capture_window_; |
| 209 | 215 |
| 210 Window* mouse_pressed_handler_; | 216 Window* mouse_pressed_handler_; |
| 211 Window* mouse_moved_handler_; | 217 Window* mouse_moved_handler_; |
| 212 Window* focused_window_; | 218 Window* focused_window_; |
| 213 Window* touch_event_handler_; | 219 Window* touch_event_handler_; |
| 214 | 220 |
| 215 DISALLOW_COPY_AND_ASSIGN(Desktop); | 221 DISALLOW_COPY_AND_ASSIGN(Desktop); |
| 216 }; | 222 }; |
| 217 | 223 |
| 218 } // namespace aura | 224 } // namespace aura |
| 219 | 225 |
| 220 #endif // UI_AURA_DESKTOP_H_ | 226 #endif // UI_AURA_DESKTOP_H_ |
| OLD | NEW |