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

Side by Side Diff: ash/wm/toplevel_window_event_handler.cc

Issue 10919135: Move ash specific cursor code to CursorManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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
« no previous file with comments | « ash/wm/image_cursors.cc ('k') | chrome/browser/ui/ash/ash_init.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ash/wm/toplevel_window_event_handler.h" 5 #include "ash/wm/toplevel_window_event_handler.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/default_window_resizer.h" 8 #include "ash/wm/default_window_resizer.h"
9 #include "ash/wm/property_util.h" 9 #include "ash/wm/property_util.h"
10 #include "ash/wm/resize_shadow_controller.h" 10 #include "ash/wm/resize_shadow_controller.h"
11 #include "ash/wm/window_resizer.h" 11 #include "ash/wm/window_resizer.h"
12 #include "ash/wm/window_util.h" 12 #include "ash/wm/window_util.h"
13 #include "ash/wm/workspace/snap_sizer.h" 13 #include "ash/wm/workspace/snap_sizer.h"
14 #include "base/message_loop.h" 14 #include "base/message_loop.h"
15 #include "base/run_loop.h" 15 #include "base/run_loop.h"
16 #include "ui/aura/client/aura_constants.h" 16 #include "ui/aura/client/aura_constants.h"
17 #include "ui/aura/client/cursor_client.h"
17 #include "ui/aura/env.h" 18 #include "ui/aura/env.h"
18 #include "ui/aura/root_window.h" 19 #include "ui/aura/root_window.h"
19 #include "ui/aura/window.h" 20 #include "ui/aura/window.h"
20 #include "ui/aura/window_delegate.h" 21 #include "ui/aura/window_delegate.h"
21 #include "ui/aura/window_observer.h" 22 #include "ui/aura/window_observer.h"
22 #include "ui/base/cursor/cursor.h" 23 #include "ui/base/cursor/cursor.h"
23 #include "ui/base/events/event.h" 24 #include "ui/base/events/event.h"
24 #include "ui/base/gestures/gesture_recognizer.h" 25 #include "ui/base/gestures/gesture_recognizer.h"
25 #include "ui/base/hit_test.h" 26 #include "ui/base/hit_test.h"
26 #include "ui/base/ui_base_types.h" 27 #include "ui/base/ui_base_types.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 in_gesture_resize_ = true; 270 in_gesture_resize_ = true;
270 bool has_point = root_window->gesture_recognizer()-> 271 bool has_point = root_window->gesture_recognizer()->
271 GetLastTouchPointForTarget(source, &drag_location); 272 GetLastTouchPointForTarget(source, &drag_location);
272 DCHECK(has_point); 273 DCHECK(has_point);
273 } else { 274 } else {
274 drag_location = root_window->GetLastMouseLocationInRoot(); 275 drag_location = root_window->GetLastMouseLocationInRoot();
275 aura::Window::ConvertPointToTarget( 276 aura::Window::ConvertPointToTarget(
276 root_window, source->parent(), &drag_location); 277 root_window, source->parent(), &drag_location);
277 } 278 }
278 CreateScopedWindowResizer(source, drag_location, HTCAPTION); 279 CreateScopedWindowResizer(source, drag_location, HTCAPTION);
279 source->GetRootWindow()->SetCursor(ui::kCursorPointer); 280 aura::client::CursorClient* cursor_client =
281 aura::client::GetCursorClient(root_window);
282 if (cursor_client)
283 cursor_client->SetCursor(ui::kCursorPointer);
280 #if !defined(OS_MACOSX) 284 #if !defined(OS_MACOSX)
281 MessageLoopForUI* loop = MessageLoopForUI::current(); 285 MessageLoopForUI* loop = MessageLoopForUI::current();
282 MessageLoop::ScopedNestableTaskAllower allow_nested(loop); 286 MessageLoop::ScopedNestableTaskAllower allow_nested(loop);
283 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); 287 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher());
284 quit_closure_ = run_loop.QuitClosure(); 288 quit_closure_ = run_loop.QuitClosure();
285 run_loop.Run(); 289 run_loop.Run();
286 #endif // !defined(OS_MACOSX) 290 #endif // !defined(OS_MACOSX)
287 in_gesture_resize_ = in_move_loop_ = false; 291 in_gesture_resize_ = in_move_loop_ = false;
288 return move_cancelled_ ? aura::client::MOVE_CANCELED : 292 return move_cancelled_ ? aura::client::MOVE_CANCELED :
289 aura::client::MOVE_SUCCESSFUL; 293 aura::client::MOVE_SUCCESSFUL;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { 394 void ToplevelWindowEventHandler::ResizerWindowDestroyed() {
391 // We explicitly don't invoke RevertDrag() since that may do things to window. 395 // We explicitly don't invoke RevertDrag() since that may do things to window.
392 // Instead we destroy the resizer. 396 // Instead we destroy the resizer.
393 window_resizer_.reset(); 397 window_resizer_.reset();
394 398
395 // End the move loop. This does nothing if we're not in a move loop. 399 // End the move loop. This does nothing if we're not in a move loop.
396 EndMoveLoop(); 400 EndMoveLoop();
397 } 401 }
398 402
399 } // namespace ash 403 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/image_cursors.cc ('k') | chrome/browser/ui/ash/ash_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698