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

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 114643003: Use a single ToplevelWindowEventHandler for the ash::Shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index c5c93072aaf03ba52bfb03eba9b309960bcdf9cd..0797b18655c366f482fbe68c36d8c66ac0a252e0 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -648,18 +648,21 @@ Widget::MoveLoopResult NativeWidgetAura::RunMoveLoop(
Widget::MoveLoopEscapeBehavior escape_behavior) {
// |escape_behavior| is only needed on windows when running the native message
// loop.
- if (window_ && window_->parent() &&
- aura::client::GetWindowMoveClient(window_->parent())) {
- SetCapture();
- aura::client::WindowMoveSource window_move_source =
- source == Widget::MOVE_LOOP_SOURCE_MOUSE ?
- aura::client::WINDOW_MOVE_SOURCE_MOUSE :
- aura::client::WINDOW_MOVE_SOURCE_TOUCH;
- if (aura::client::GetWindowMoveClient(window_->parent())->RunMoveLoop(
- window_, drag_offset, window_move_source) ==
- aura::client::MOVE_SUCCESSFUL) {
- return Widget::MOVE_LOOP_SUCCESSFUL;
- }
+ if (!window_ || !window_->GetRootWindow())
+ return Widget::MOVE_LOOP_CANCELED;
+ aura::client::WindowMoveClient* move_client =
+ aura::client::GetWindowMoveClient(window_->GetRootWindow());
+ if (!move_client)
+ return Widget::MOVE_LOOP_CANCELED;
+
+ SetCapture();
+ aura::client::WindowMoveSource window_move_source =
+ source == Widget::MOVE_LOOP_SOURCE_MOUSE ?
+ aura::client::WINDOW_MOVE_SOURCE_MOUSE :
+ aura::client::WINDOW_MOVE_SOURCE_TOUCH;
+ if (move_client->RunMoveLoop(window_, drag_offset, window_move_source) ==
+ aura::client::MOVE_SUCCESSFUL) {
+ return Widget::MOVE_LOOP_SUCCESSFUL;
}
return Widget::MOVE_LOOP_CANCELED;
}
« ash/wm/workspace/workspace_event_handler.cc ('K') | « tools/metrics/actions/chromeactions.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698