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

Side by Side Diff: components/exo/shell_surface.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, 7 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 | « components/exo/pointer.cc ('k') | components/exo/surface.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/shell_surface.h" 5 #include "components/exo/shell_surface.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/frame/custom_frame_view_ash.h" 9 #include "ash/frame/custom_frame_view_ash.h"
10 #include "ash/public/cpp/shell_window_ids.h" 10 #include "ash/public/cpp/shell_window_ids.h"
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 if (bounds_mode_ == BoundsMode::SHELL) { 1323 if (bounds_mode_ == BoundsMode::SHELL) {
1324 // Set the cursor before calling CreateWindowResizer(), as that will 1324 // Set the cursor before calling CreateWindowResizer(), as that will
1325 // eventually call LockCursor() and prevent the cursor from changing. 1325 // eventually call LockCursor() and prevent the cursor from changing.
1326 aura::client::CursorClient* cursor_client = 1326 aura::client::CursorClient* cursor_client =
1327 aura::client::GetCursorClient(window->GetRootWindow()); 1327 aura::client::GetCursorClient(window->GetRootWindow());
1328 if (!cursor_client) 1328 if (!cursor_client)
1329 return; 1329 return;
1330 1330
1331 switch (component) { 1331 switch (component) {
1332 case HTCAPTION: 1332 case HTCAPTION:
1333 cursor_client->SetCursor(ui::kCursorPointer); 1333 cursor_client->SetCursor(ui::CursorType::kPointer);
1334 break; 1334 break;
1335 case HTTOP: 1335 case HTTOP:
1336 cursor_client->SetCursor(ui::kCursorNorthResize); 1336 cursor_client->SetCursor(ui::CursorType::kNorthResize);
1337 break; 1337 break;
1338 case HTTOPRIGHT: 1338 case HTTOPRIGHT:
1339 cursor_client->SetCursor(ui::kCursorNorthEastResize); 1339 cursor_client->SetCursor(ui::CursorType::kNorthEastResize);
1340 break; 1340 break;
1341 case HTRIGHT: 1341 case HTRIGHT:
1342 cursor_client->SetCursor(ui::kCursorEastResize); 1342 cursor_client->SetCursor(ui::CursorType::kEastResize);
1343 break; 1343 break;
1344 case HTBOTTOMRIGHT: 1344 case HTBOTTOMRIGHT:
1345 cursor_client->SetCursor(ui::kCursorSouthEastResize); 1345 cursor_client->SetCursor(ui::CursorType::kSouthEastResize);
1346 break; 1346 break;
1347 case HTBOTTOM: 1347 case HTBOTTOM:
1348 cursor_client->SetCursor(ui::kCursorSouthResize); 1348 cursor_client->SetCursor(ui::CursorType::kSouthResize);
1349 break; 1349 break;
1350 case HTBOTTOMLEFT: 1350 case HTBOTTOMLEFT:
1351 cursor_client->SetCursor(ui::kCursorSouthWestResize); 1351 cursor_client->SetCursor(ui::CursorType::kSouthWestResize);
1352 break; 1352 break;
1353 case HTLEFT: 1353 case HTLEFT:
1354 cursor_client->SetCursor(ui::kCursorWestResize); 1354 cursor_client->SetCursor(ui::CursorType::kWestResize);
1355 break; 1355 break;
1356 case HTTOPLEFT: 1356 case HTTOPLEFT:
1357 cursor_client->SetCursor(ui::kCursorNorthWestResize); 1357 cursor_client->SetCursor(ui::CursorType::kNorthWestResize);
1358 break; 1358 break;
1359 default: 1359 default:
1360 NOTREACHED(); 1360 NOTREACHED();
1361 break; 1361 break;
1362 } 1362 }
1363 1363
1364 resizer_ = ash::CreateWindowResizer(ash::WmWindow::Get(window), 1364 resizer_ = ash::CreateWindowResizer(ash::WmWindow::Get(window),
1365 GetMouseLocation(), component, 1365 GetMouseLocation(), component,
1366 aura::client::WINDOW_MOVE_SOURCE_MOUSE); 1366 aura::client::WINDOW_MOVE_SOURCE_MOUSE);
1367 if (!resizer_) 1367 if (!resizer_)
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1721 gfx::Point ShellSurface::GetMouseLocation() const { 1721 gfx::Point ShellSurface::GetMouseLocation() const {
1722 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); 1722 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow();
1723 gfx::Point location = 1723 gfx::Point location =
1724 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); 1724 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
1725 aura::Window::ConvertPointToTarget( 1725 aura::Window::ConvertPointToTarget(
1726 root_window, widget_->GetNativeWindow()->parent(), &location); 1726 root_window, widget_->GetNativeWindow()->parent(), &location);
1727 return location; 1727 return location;
1728 } 1728 }
1729 1729
1730 } // namespace exo 1730 } // namespace exo
OLDNEW
« no previous file with comments | « components/exo/pointer.cc ('k') | components/exo/surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698