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

Side by Side Diff: components/exo/shell_surface.cc

Issue 2778913002: exo: Clean up cursor code (Closed)
Patch Set: Rebase 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 | « components/exo/pointer.cc ('k') | components/exo/wm_helper_ash.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/common/frame/custom_frame_view_ash.h" 9 #include "ash/common/frame/custom_frame_view_ash.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1302 1302
1303 aura::Window* window = GetDragWindow(); 1303 aura::Window* window = GetDragWindow();
1304 if (!window || window->HasCapture()) 1304 if (!window || window->HasCapture())
1305 return; 1305 return;
1306 1306
1307 if (bounds_mode_ == BoundsMode::SHELL) { 1307 if (bounds_mode_ == BoundsMode::SHELL) {
1308 // Set the cursor before calling CreateWindowResizer(), as that will 1308 // Set the cursor before calling CreateWindowResizer(), as that will
1309 // eventually call LockCursor() and prevent the cursor from changing. 1309 // eventually call LockCursor() and prevent the cursor from changing.
1310 aura::client::CursorClient* cursor_client = 1310 aura::client::CursorClient* cursor_client =
1311 aura::client::GetCursorClient(window->GetRootWindow()); 1311 aura::client::GetCursorClient(window->GetRootWindow());
1312 DCHECK(cursor_client); 1312 if (!cursor_client)
1313 return;
1313 1314
1314 switch (component) { 1315 switch (component) {
1315 case HTCAPTION: 1316 case HTCAPTION:
1316 cursor_client->SetCursor(ui::kCursorPointer); 1317 cursor_client->SetCursor(ui::kCursorPointer);
1317 break; 1318 break;
1318 case HTTOP: 1319 case HTTOP:
1319 cursor_client->SetCursor(ui::kCursorNorthResize); 1320 cursor_client->SetCursor(ui::kCursorNorthResize);
1320 break; 1321 break;
1321 case HTTOPRIGHT: 1322 case HTTOPRIGHT:
1322 cursor_client->SetCursor(ui::kCursorNorthEastResize); 1323 cursor_client->SetCursor(ui::kCursorNorthEastResize);
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 gfx::Point ShellSurface::GetMouseLocation() const { 1705 gfx::Point ShellSurface::GetMouseLocation() const {
1705 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); 1706 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow();
1706 gfx::Point location = 1707 gfx::Point location =
1707 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); 1708 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
1708 aura::Window::ConvertPointToTarget( 1709 aura::Window::ConvertPointToTarget(
1709 root_window, widget_->GetNativeWindow()->parent(), &location); 1710 root_window, widget_->GetNativeWindow()->parent(), &location);
1710 return location; 1711 return location;
1711 } 1712 }
1712 1713
1713 } // namespace exo 1714 } // namespace exo
OLDNEW
« 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