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

Side by Side Diff: ash/drag_drop/drag_drop_controller.cc

Issue 2455963006: Wires up drag/drop for aura-mus (Closed)
Patch Set: twweaks Created 4 years, 1 month 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 | « no previous file | content/browser/web_contents/web_contents_view_aura.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 (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/drag_drop/drag_drop_controller.h" 5 #include "ash/drag_drop/drag_drop_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/aura/wm_window_aura.h" 9 #include "ash/aura/wm_window_aura.h"
10 #include "ash/common/drag_drop/drag_image_view.h" 10 #include "ash/common/drag_drop/drag_image_view.h"
11 #include "ash/common/wm_shell.h" 11 #include "ash/common/wm_shell.h"
12 #include "ash/drag_drop/drag_drop_tracker.h" 12 #include "ash/drag_drop/drag_drop_tracker.h"
13 #include "ash/shell.h" 13 #include "ash/shell.h"
14 #include "base/bind.h" 14 #include "base/bind.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "base/metrics/histogram_macros.h" 16 #include "base/metrics/histogram_macros.h"
17 #include "base/run_loop.h" 17 #include "base/run_loop.h"
18 #include "base/threading/thread_task_runner_handle.h" 18 #include "base/threading/thread_task_runner_handle.h"
19 #include "ui/aura/client/capture_client.h" 19 #include "ui/aura/client/capture_client.h"
20 #include "ui/aura/client/drag_drop_delegate.h"
20 #include "ui/aura/env.h" 21 #include "ui/aura/env.h"
21 #include "ui/aura/window.h" 22 #include "ui/aura/window.h"
22 #include "ui/aura/window_delegate.h" 23 #include "ui/aura/window_delegate.h"
23 #include "ui/aura/window_event_dispatcher.h" 24 #include "ui/aura/window_event_dispatcher.h"
24 #include "ui/base/dragdrop/drag_drop_types.h" 25 #include "ui/base/dragdrop/drag_drop_types.h"
25 #include "ui/base/dragdrop/os_exchange_data.h" 26 #include "ui/base/dragdrop/os_exchange_data.h"
26 #include "ui/base/hit_test.h" 27 #include "ui/base/hit_test.h"
27 #include "ui/events/event.h" 28 #include "ui/events/event.h"
28 #include "ui/events/event_utils.h" 29 #include "ui/events/event_utils.h"
29 #include "ui/gfx/animation/linear_animation.h" 30 #include "ui/gfx/animation/linear_animation.h"
30 #include "ui/gfx/geometry/point.h" 31 #include "ui/gfx/geometry/point.h"
31 #include "ui/gfx/geometry/rect.h" 32 #include "ui/gfx/geometry/rect.h"
32 #include "ui/gfx/geometry/rect_conversions.h" 33 #include "ui/gfx/geometry/rect_conversions.h"
33 #include "ui/gfx/path.h" 34 #include "ui/gfx/path.h"
34 #include "ui/views/widget/native_widget_aura.h" 35 #include "ui/views/widget/native_widget_aura.h"
35 #include "ui/wm/core/coordinate_conversion.h" 36 #include "ui/wm/core/coordinate_conversion.h"
36 #include "ui/wm/public/drag_drop_delegate.h"
37 37
38 namespace ash { 38 namespace ash {
39 namespace { 39 namespace {
40 40
41 // The duration of the drag cancel animation in millisecond. 41 // The duration of the drag cancel animation in millisecond.
42 const int kCancelAnimationDuration = 250; 42 const int kCancelAnimationDuration = 250;
43 const int kTouchCancelAnimationDuration = 20; 43 const int kTouchCancelAnimationDuration = 20;
44 // The frame rate of the drag cancel animation in hertz. 44 // The frame rate of the drag cancel animation in hertz.
45 const int kCancelAnimationFrameRate = 60; 45 const int kCancelAnimationFrameRate = 60;
46 46
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 if (drag_window_) 574 if (drag_window_)
575 drag_window_->RemoveObserver(this); 575 drag_window_->RemoveObserver(this);
576 drag_window_ = NULL; 576 drag_window_ = NULL;
577 drag_data_ = NULL; 577 drag_data_ = NULL;
578 // Cleanup can be called again while deleting DragDropTracker, so delete 578 // Cleanup can be called again while deleting DragDropTracker, so delete
579 // the pointer with a local variable to avoid double free. 579 // the pointer with a local variable to avoid double free.
580 std::unique_ptr<ash::DragDropTracker> holder = std::move(drag_drop_tracker_); 580 std::unique_ptr<ash::DragDropTracker> holder = std::move(drag_drop_tracker_);
581 } 581 }
582 582
583 } // namespace ash 583 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698