| 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" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/task.h" | 13 #include "base/task.h" |
| 14 #include "ui/aura/aura_export.h" | 14 #include "ui/aura/aura_export.h" |
| 15 #include "ui/aura/cursor.h" | 15 #include "ui/aura/cursor.h" |
| 16 #include "ui/aura/focus_manager.h" | 16 #include "ui/aura/focus_manager.h" |
| 17 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 18 #include "ui/base/dragdrop/os_exchange_data.h" |
| 18 #include "ui/base/events.h" | 19 #include "ui/base/events.h" |
| 19 #include "ui/gfx/compositor/compositor.h" | 20 #include "ui/gfx/compositor/compositor.h" |
| 20 #include "ui/gfx/compositor/layer_animation_observer.h" | 21 #include "ui/gfx/compositor/layer_animation_observer.h" |
| 21 #include "ui/gfx/native_widget_types.h" | 22 #include "ui/gfx/native_widget_types.h" |
| 22 #include "ui/gfx/point.h" | 23 #include "ui/gfx/point.h" |
| 23 | 24 |
| 24 namespace gfx { | 25 namespace gfx { |
| 25 class Size; | 26 class Size; |
| 26 } | 27 } |
| 27 | 28 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 125 |
| 125 // Sets capture to the specified window. | 126 // Sets capture to the specified window. |
| 126 void SetCapture(Window* window); | 127 void SetCapture(Window* window); |
| 127 | 128 |
| 128 // If |window| has mouse capture, the current capture window is set to NULL. | 129 // If |window| has mouse capture, the current capture window is set to NULL. |
| 129 void ReleaseCapture(Window* window); | 130 void ReleaseCapture(Window* window); |
| 130 | 131 |
| 131 // Overridden from Window: | 132 // Overridden from Window: |
| 132 virtual void SetTransform(const ui::Transform& transform) OVERRIDE; | 133 virtual void SetTransform(const ui::Transform& transform) OVERRIDE; |
| 133 | 134 |
| 135 // Initiates a drag and drop session |
| 136 virtual void StartDragAndDrop(const ui::OSExchangeData& data, int operation); |
| 137 |
| 134 private: | 138 private: |
| 135 // Called whenever the mouse moves, tracks the current |mouse_moved_handler_|, | 139 // Called whenever the mouse moves, tracks the current |mouse_moved_handler_|, |
| 136 // sending exited and entered events as its value changes. | 140 // sending exited and entered events as its value changes. |
| 137 void HandleMouseMoved(const MouseEvent& event, Window* target); | 141 void HandleMouseMoved(const MouseEvent& event, Window* target); |
| 138 | 142 |
| 139 bool ProcessMouseEvent(Window* target, MouseEvent* event); | 143 bool ProcessMouseEvent(Window* target, MouseEvent* event); |
| 140 bool ProcessKeyEvent(Window* target, KeyEvent* event); | 144 bool ProcessKeyEvent(Window* target, KeyEvent* event); |
| 141 ui::TouchStatus ProcessTouchEvent(Window* target, TouchEvent* event); | 145 ui::TouchStatus ProcessTouchEvent(Window* target, TouchEvent* event); |
| 142 | 146 |
| 143 // Overridden from ui::CompositorDelegate | 147 // Overridden from ui::CompositorDelegate |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 203 |
| 200 // The capture window. When not-null, this window receives all the mouse and | 204 // The capture window. When not-null, this window receives all the mouse and |
| 201 // touch events. | 205 // touch events. |
| 202 Window* capture_window_; | 206 Window* capture_window_; |
| 203 | 207 |
| 204 Window* mouse_pressed_handler_; | 208 Window* mouse_pressed_handler_; |
| 205 Window* mouse_moved_handler_; | 209 Window* mouse_moved_handler_; |
| 206 Window* focused_window_; | 210 Window* focused_window_; |
| 207 Window* touch_event_handler_; | 211 Window* touch_event_handler_; |
| 208 | 212 |
| 213 bool drag_drop_in_progress_; |
| 214 |
| 209 DISALLOW_COPY_AND_ASSIGN(Desktop); | 215 DISALLOW_COPY_AND_ASSIGN(Desktop); |
| 210 }; | 216 }; |
| 211 | 217 |
| 212 } // namespace aura | 218 } // namespace aura |
| 213 | 219 |
| 214 #endif // UI_AURA_DESKTOP_H_ | 220 #endif // UI_AURA_DESKTOP_H_ |
| OLD | NEW |