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 #include "ui/aura/root_window.h" | 5 #include "ui/aura/root_window.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "ui/aura/aura_switches.h" | 14 #include "ui/aura/aura_switches.h" |
15 #include "ui/aura/client/activation_client.h" | 15 #include "ui/aura/client/activation_client.h" |
16 #include "ui/aura/client/capture_client.h" | 16 #include "ui/aura/client/capture_client.h" |
| 17 #include "ui/aura/client/drag_drop_client.h" |
17 #include "ui/aura/client/event_client.h" | 18 #include "ui/aura/client/event_client.h" |
18 #include "ui/aura/client/screen_position_client.h" | 19 #include "ui/aura/client/screen_position_client.h" |
19 #include "ui/aura/env.h" | 20 #include "ui/aura/env.h" |
20 #include "ui/aura/event.h" | 21 #include "ui/aura/event.h" |
21 #include "ui/aura/event_filter.h" | 22 #include "ui/aura/event_filter.h" |
22 #include "ui/aura/focus_manager.h" | 23 #include "ui/aura/focus_manager.h" |
23 #include "ui/aura/display_manager.h" | 24 #include "ui/aura/display_manager.h" |
24 #include "ui/aura/root_window_host.h" | 25 #include "ui/aura/root_window_host.h" |
25 #include "ui/aura/root_window_observer.h" | 26 #include "ui/aura/root_window_observer.h" |
26 #include "ui/aura/window.h" | 27 #include "ui/aura/window.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 SetLastMouseLocation(this, ui::ConvertPointToDIP(layer(), point)); | 212 SetLastMouseLocation(this, ui::ConvertPointToDIP(layer(), point)); |
212 | 213 |
213 synthesize_mouse_move_ = false; | 214 synthesize_mouse_move_ = false; |
214 } | 215 } |
215 | 216 |
216 gfx::Point RootWindow::GetHostOrigin() const { | 217 gfx::Point RootWindow::GetHostOrigin() const { |
217 return host_->GetBounds().origin(); | 218 return host_->GetBounds().origin(); |
218 } | 219 } |
219 | 220 |
220 void RootWindow::SetCursor(gfx::NativeCursor cursor) { | 221 void RootWindow::SetCursor(gfx::NativeCursor cursor) { |
| 222 // If a drag is in progress, the DragDropClient should override the cursor. |
| 223 client::DragDropClient* dnd_client = client::GetDragDropClient(this); |
| 224 if (dnd_client && dnd_client->IsDragDropInProgress()) |
| 225 cursor = dnd_client->GetDragCursor(); |
| 226 |
221 last_cursor_ = cursor; | 227 last_cursor_ = cursor; |
222 // A lot of code seems to depend on NULL cursors actually showing an arrow, | 228 // A lot of code seems to depend on NULL cursors actually showing an arrow, |
223 // so just pass everything along to the host. | 229 // so just pass everything along to the host. |
224 host_->SetCursor(cursor); | 230 host_->SetCursor(cursor); |
225 } | 231 } |
226 | 232 |
227 void RootWindow::ShowCursor(bool show) { | 233 void RootWindow::ShowCursor(bool show) { |
228 cursor_shown_ = show; | 234 cursor_shown_ = show; |
229 host_->ShowCursor(show); | 235 host_->ShowCursor(show); |
230 } | 236 } |
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 void RootWindow::UnlockCompositor() { | 1042 void RootWindow::UnlockCompositor() { |
1037 DCHECK(compositor_lock_); | 1043 DCHECK(compositor_lock_); |
1038 compositor_lock_ = NULL; | 1044 compositor_lock_ = NULL; |
1039 if (draw_on_compositor_unlock_) { | 1045 if (draw_on_compositor_unlock_) { |
1040 draw_on_compositor_unlock_ = false; | 1046 draw_on_compositor_unlock_ = false; |
1041 ScheduleDraw(); | 1047 ScheduleDraw(); |
1042 } | 1048 } |
1043 } | 1049 } |
1044 | 1050 |
1045 } // namespace aura | 1051 } // namespace aura |
OLD | NEW |