Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: ui/aura/root_window.cc

Issue 10829180: Move cursor when it's hidden so that UX can update correctly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable test for windows Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 if (dnd_client && dnd_client->IsDragDropInProgress()) 224 if (dnd_client && dnd_client->IsDragDropInProgress())
225 cursor = dnd_client->GetDragCursor(); 225 cursor = dnd_client->GetDragCursor();
226 226
227 last_cursor_ = cursor; 227 last_cursor_ = cursor;
228 // 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,
229 // so just pass everything along to the host. 229 // so just pass everything along to the host.
230 host_->SetCursor(cursor); 230 host_->SetCursor(cursor);
231 } 231 }
232 232
233 void RootWindow::ShowCursor(bool show) { 233 void RootWindow::ShowCursor(bool show) {
234 cursor_shown_ = show; 234 // Send entered / exited so that visual state can be updated to match
235 host_->ShowCursor(show); 235 // cursor state.
236 if (show != cursor_shown_) {
237 cursor_shown_ = show;
238 host_->ShowCursor(show);
239 Env::GetInstance()->SetCursorShown(show);
240 PostMouseMoveEventAfterWindowChange();
241 }
236 } 242 }
237 243
238 void RootWindow::MoveCursorTo(const gfx::Point& location_in_dip) { 244 void RootWindow::MoveCursorTo(const gfx::Point& location_in_dip) {
239 gfx::Point location = location_in_dip; 245 gfx::Point location = location_in_dip;
240 layer()->transform().TransformPoint(location); 246 layer()->transform().TransformPoint(location);
241 host_->MoveCursorTo(ui::ConvertPointToPixel(layer(), location)); 247 host_->MoveCursorTo(ui::ConvertPointToPixel(layer(), location));
242 SetLastMouseLocation(this, location_in_dip); 248 SetLastMouseLocation(this, location_in_dip);
243 } 249 }
244 250
245 bool RootWindow::ConfineCursorToWindow() { 251 bool RootWindow::ConfineCursorToWindow() {
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 void RootWindow::UnlockCompositor() { 1041 void RootWindow::UnlockCompositor() {
1036 DCHECK(compositor_lock_); 1042 DCHECK(compositor_lock_);
1037 compositor_lock_ = NULL; 1043 compositor_lock_ = NULL;
1038 if (draw_on_compositor_unlock_) { 1044 if (draw_on_compositor_unlock_) {
1039 draw_on_compositor_unlock_ = false; 1045 draw_on_compositor_unlock_ = false;
1040 ScheduleDraw(); 1046 ScheduleDraw();
1041 } 1047 }
1042 } 1048 }
1043 1049
1044 } // namespace aura 1050 } // namespace aura
OLDNEW
« ui/aura/env.cc ('K') | « ui/aura/env.cc ('k') | ui/aura/root_window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698