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

Unified Diff: components/exo/shell_surface.cc

Issue 2778913002: exo: Clean up cursor code (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/exo/pointer.cc ('k') | components/exo/wm_helper_ash.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 38cb702c942bd42e834801e9018e67a9c94c3fd4..b450804939fb1efd11e85164506b2a34e61f3774 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -1301,41 +1301,40 @@ void ShellSurface::AttemptToStartDrag(int component) {
if (bounds_mode_ == BoundsMode::SHELL) {
// Set the cursor before calling CreateWindowResizer(), as that will
// eventually call LockCursor() and prevent the cursor from changing.
- aura::client::CursorClient* cursor_client =
- aura::client::GetCursorClient(window->GetRootWindow());
- DCHECK(cursor_client);
-
- switch (component) {
- case HTCAPTION:
- cursor_client->SetCursor(ui::kCursorPointer);
- break;
- case HTTOP:
- cursor_client->SetCursor(ui::kCursorNorthResize);
- break;
- case HTTOPRIGHT:
- cursor_client->SetCursor(ui::kCursorNorthEastResize);
- break;
- case HTRIGHT:
- cursor_client->SetCursor(ui::kCursorEastResize);
- break;
- case HTBOTTOMRIGHT:
- cursor_client->SetCursor(ui::kCursorSouthEastResize);
- break;
- case HTBOTTOM:
- cursor_client->SetCursor(ui::kCursorSouthResize);
- break;
- case HTBOTTOMLEFT:
- cursor_client->SetCursor(ui::kCursorSouthWestResize);
- break;
- case HTLEFT:
- cursor_client->SetCursor(ui::kCursorWestResize);
- break;
- case HTTOPLEFT:
- cursor_client->SetCursor(ui::kCursorNorthWestResize);
- break;
- default:
- NOTREACHED();
- break;
+ if (auto* cursor_client =
reveman 2017/03/28 07:25:15 nit: this is a change in behavior (we asserted the
Dominik Laskowski 2017/03/30 01:01:18 Restored. The DCHECK is technically correct, since
+ aura::client::GetCursorClient(window->GetRootWindow())) {
+ switch (component) {
+ case HTCAPTION:
+ cursor_client->SetCursor(ui::kCursorPointer);
+ break;
+ case HTTOP:
+ cursor_client->SetCursor(ui::kCursorNorthResize);
+ break;
+ case HTTOPRIGHT:
+ cursor_client->SetCursor(ui::kCursorNorthEastResize);
+ break;
+ case HTRIGHT:
+ cursor_client->SetCursor(ui::kCursorEastResize);
+ break;
+ case HTBOTTOMRIGHT:
+ cursor_client->SetCursor(ui::kCursorSouthEastResize);
+ break;
+ case HTBOTTOM:
+ cursor_client->SetCursor(ui::kCursorSouthResize);
+ break;
+ case HTBOTTOMLEFT:
+ cursor_client->SetCursor(ui::kCursorSouthWestResize);
+ break;
+ case HTLEFT:
+ cursor_client->SetCursor(ui::kCursorWestResize);
+ break;
+ case HTTOPLEFT:
+ cursor_client->SetCursor(ui::kCursorNorthWestResize);
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
}
resizer_ = ash::CreateWindowResizer(ash::WmWindow::Get(window),
« no previous file with comments | « components/exo/pointer.cc ('k') | components/exo/wm_helper_ash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698