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

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

Issue 2833163002: Change ui cursor identifiers to an enum class. (Closed)
Patch Set: OK, it can't be explicit for mac. Created 3 years, 8 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
« no previous file with comments | « ash/wm/resize_shadow_and_cursor_unittest.cc ('k') | ash/wm/window_manager_unittest.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/window_state.h" 8 #include "ash/wm/window_state.h"
9 #include "ash/wm/window_state_aura.h" 9 #include "ash/wm/window_state_aura.h"
10 #include "ash/wm_window.h" 10 #include "ash/wm_window.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 drag_location = 63 drag_location =
64 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); 64 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
65 aura::Window::ConvertPointToTarget(root_window, source->parent(), 65 aura::Window::ConvertPointToTarget(root_window, source->parent(),
66 &drag_location); 66 &drag_location);
67 } 67 }
68 // Set the cursor before calling AttemptToStartDrag(), as that will 68 // Set the cursor before calling AttemptToStartDrag(), as that will
69 // eventually call LockCursor() and prevent the cursor from changing. 69 // eventually call LockCursor() and prevent the cursor from changing.
70 aura::client::CursorClient* cursor_client = 70 aura::client::CursorClient* cursor_client =
71 aura::client::GetCursorClient(root_window); 71 aura::client::GetCursorClient(root_window);
72 if (cursor_client) 72 if (cursor_client)
73 cursor_client->SetCursor(ui::kCursorPointer); 73 cursor_client->SetCursor(ui::CursorType::kPointer);
74 74
75 base::RunLoop run_loop; 75 base::RunLoop run_loop;
76 76
77 wm::WmToplevelWindowEventHandler::DragResult result = 77 wm::WmToplevelWindowEventHandler::DragResult result =
78 wm::WmToplevelWindowEventHandler::DragResult::SUCCESS; 78 wm::WmToplevelWindowEventHandler::DragResult::SUCCESS;
79 if (!wm_toplevel_window_event_handler_.AttemptToStartDrag( 79 if (!wm_toplevel_window_event_handler_.AttemptToStartDrag(
80 WmWindow::Get(source), drag_location, HTCAPTION, move_source, 80 WmWindow::Get(source), drag_location, HTCAPTION, move_source,
81 base::Bind(&ToplevelWindowEventHandler::OnDragCompleted, 81 base::Bind(&ToplevelWindowEventHandler::OnDragCompleted,
82 weak_factory_.GetWeakPtr(), &result, &run_loop))) { 82 weak_factory_.GetWeakPtr(), &result, &run_loop))) {
83 return aura::client::MOVE_CANCELED; 83 return aura::client::MOVE_CANCELED;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 void ToplevelWindowEventHandler::OnDragCompleted( 119 void ToplevelWindowEventHandler::OnDragCompleted(
120 wm::WmToplevelWindowEventHandler::DragResult* result_return_value, 120 wm::WmToplevelWindowEventHandler::DragResult* result_return_value,
121 base::RunLoop* run_loop, 121 base::RunLoop* run_loop,
122 wm::WmToplevelWindowEventHandler::DragResult result) { 122 wm::WmToplevelWindowEventHandler::DragResult result) {
123 *result_return_value = result; 123 *result_return_value = result;
124 run_loop->Quit(); 124 run_loop->Quit();
125 } 125 }
126 126
127 } // namespace ash 127 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/resize_shadow_and_cursor_unittest.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698