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

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
« no previous file with comments | « tools/metrics/actions/chromeactions.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1f97ac129247641f53660590ad8e05af727b1ebc..a5b3f993bcb6f8538b320a772e2b18f3bc4e808c 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -648,27 +648,32 @@ 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;
}
void NativeWidgetAura::EndMoveLoop() {
- if (window_ && window_->parent() &&
- aura::client::GetWindowMoveClient(window_->parent())) {
- aura::client::GetWindowMoveClient(window_->parent())->EndMoveLoop();
- }
+ if (!window_ || !window_->GetRootWindow())
+ return;
+ aura::client::WindowMoveClient* move_client =
+ aura::client::GetWindowMoveClient(window_->GetRootWindow());
+ if (move_client)
+ move_client->EndMoveLoop();
}
void NativeWidgetAura::SetVisibilityChangedAnimationsEnabled(bool value) {
« no previous file with comments | « tools/metrics/actions/chromeactions.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698