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

Side by Side Diff: ash/wm/toplevel_window_event_handler.cc

Issue 184903003: Window ownership -> WindowTreeHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/system_gesture_event_filter_unittest.cc ('k') | ash/wm/window_manager_unittest.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/wm/toplevel_window_event_handler.h" 5 #include "ash/wm/toplevel_window_event_handler.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/resize_shadow_controller.h" 8 #include "ash/wm/resize_shadow_controller.h"
9 #include "ash/wm/window_resizer.h" 9 #include "ash/wm/window_resizer.h"
10 #include "ash/wm/window_state.h" 10 #include "ash/wm/window_state.h"
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 // TODO(tdresser): Use gfx::PointF. See crbug.com/337824. 376 // TODO(tdresser): Use gfx::PointF. See crbug.com/337824.
377 gfx::Point drag_location; 377 gfx::Point drag_location;
378 if (move_source == aura::client::WINDOW_MOVE_SOURCE_TOUCH && 378 if (move_source == aura::client::WINDOW_MOVE_SOURCE_TOUCH &&
379 aura::Env::GetInstance()->is_touch_down()) { 379 aura::Env::GetInstance()->is_touch_down()) {
380 gfx::PointF drag_location_f; 380 gfx::PointF drag_location_f;
381 bool has_point = ui::GestureRecognizer::Get()-> 381 bool has_point = ui::GestureRecognizer::Get()->
382 GetLastTouchPointForTarget(source, &drag_location_f); 382 GetLastTouchPointForTarget(source, &drag_location_f);
383 drag_location = gfx::ToFlooredPoint(drag_location_f); 383 drag_location = gfx::ToFlooredPoint(drag_location_f);
384 DCHECK(has_point); 384 DCHECK(has_point);
385 } else { 385 } else {
386 drag_location = root_window->GetDispatcher()->GetLastMouseLocationInRoot(); 386 drag_location =
387 root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot();
387 aura::Window::ConvertPointToTarget( 388 aura::Window::ConvertPointToTarget(
388 root_window, source->parent(), &drag_location); 389 root_window, source->parent(), &drag_location);
389 } 390 }
390 // Set the cursor before calling AttemptToStartDrag(), as that will 391 // Set the cursor before calling AttemptToStartDrag(), as that will
391 // eventually call LockCursor() and prevent the cursor from changing. 392 // eventually call LockCursor() and prevent the cursor from changing.
392 aura::client::CursorClient* cursor_client = 393 aura::client::CursorClient* cursor_client =
393 aura::client::GetCursorClient(root_window); 394 aura::client::GetCursorClient(root_window);
394 if (cursor_client) 395 if (cursor_client)
395 cursor_client->SetCursor(ui::kCursorPointer); 396 cursor_client->SetCursor(ui::kCursorPointer);
396 if (!AttemptToStartDrag(source, drag_location, HTCAPTION, move_source)) 397 if (!AttemptToStartDrag(source, drag_location, HTCAPTION, move_source))
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 595
595 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { 596 void ToplevelWindowEventHandler::ResizerWindowDestroyed() {
596 // We explicitly don't invoke RevertDrag() since that may do things to window. 597 // We explicitly don't invoke RevertDrag() since that may do things to window.
597 // Instead we destroy the resizer. 598 // Instead we destroy the resizer.
598 window_resizer_.reset(); 599 window_resizer_.reset();
599 600
600 CompleteDrag(DRAG_REVERT); 601 CompleteDrag(DRAG_REVERT);
601 } 602 }
602 603
603 } // namespace ash 604 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/system_gesture_event_filter_unittest.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698