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

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

Issue 2897993003: chromeos: converts WindowResizer to aura::Window (Closed)
Patch Set: tweak 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
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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 cursor_client->SetCursor(ui::CursorType::kWestResize); 1306 cursor_client->SetCursor(ui::CursorType::kWestResize);
1307 break; 1307 break;
1308 case HTTOPLEFT: 1308 case HTTOPLEFT:
1309 cursor_client->SetCursor(ui::CursorType::kNorthWestResize); 1309 cursor_client->SetCursor(ui::CursorType::kNorthWestResize);
1310 break; 1310 break;
1311 default: 1311 default:
1312 NOTREACHED(); 1312 NOTREACHED();
1313 break; 1313 break;
1314 } 1314 }
1315 1315
1316 resizer_ = ash::CreateWindowResizer(ash::WmWindow::Get(window), 1316 resizer_ = ash::CreateWindowResizer(window, GetMouseLocation(), component,
1317 GetMouseLocation(), component,
1318 aura::client::WINDOW_MOVE_SOURCE_MOUSE); 1317 aura::client::WINDOW_MOVE_SOURCE_MOUSE);
1319 if (!resizer_) 1318 if (!resizer_)
1320 return; 1319 return;
1321 1320
1322 // Apply pending origin offsets and resize direction before starting a 1321 // Apply pending origin offsets and resize direction before starting a
1323 // new resize operation. These can still be pending if the client has 1322 // new resize operation. These can still be pending if the client has
1324 // acknowledged the configure request but not yet called Commit(). 1323 // acknowledged the configure request but not yet called Commit().
1325 origin_offset_ += pending_origin_offset_; 1324 origin_offset_ += pending_origin_offset_;
1326 pending_origin_offset_ = gfx::Vector2d(); 1325 pending_origin_offset_ = gfx::Vector2d();
1327 resize_component_ = pending_resize_component_; 1326 resize_component_ = pending_resize_component_;
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1666 gfx::Point ShellSurface::GetMouseLocation() const { 1665 gfx::Point ShellSurface::GetMouseLocation() const {
1667 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow(); 1666 aura::Window* const root_window = widget_->GetNativeWindow()->GetRootWindow();
1668 gfx::Point location = 1667 gfx::Point location =
1669 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot(); 1668 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
1670 aura::Window::ConvertPointToTarget( 1669 aura::Window::ConvertPointToTarget(
1671 root_window, widget_->GetNativeWindow()->parent(), &location); 1670 root_window, widget_->GetNativeWindow()->parent(), &location);
1672 return location; 1671 return location;
1673 } 1672 }
1674 1673
1675 } // namespace exo 1674 } // namespace exo
OLDNEW
« ash/wm/workspace/workspace_window_resizer.cc ('K') | « ash/wm/workspace_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698