OLD | NEW |
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 #ifndef ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_ | 5 #ifndef ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_ |
6 #define ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_ | 6 #define ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_ |
7 | 7 |
8 #include "ui/base/dragdrop/drag_drop_types.h" | 8 #include "ui/base/dragdrop/drag_drop_types.h" |
9 #include "ui/views/controls/image_view.h" | 9 #include "ui/views/controls/image_view.h" |
10 | 10 |
11 namespace views { | 11 namespace views { |
12 class Widget; | 12 class Widget; |
13 } | 13 } |
14 | 14 |
15 namespace ash { | 15 namespace ash { |
16 namespace internal { | |
17 | 16 |
18 // This class allows to show a (native) view always on top of everything. It | 17 // This class allows to show a (native) view always on top of everything. It |
19 // does this by creating a widget and setting the content as the given view. The | 18 // does this by creating a widget and setting the content as the given view. The |
20 // caller can then use this object to freely move / drag it around on the | 19 // caller can then use this object to freely move / drag it around on the |
21 // desktop in screen coordinates. | 20 // desktop in screen coordinates. |
22 class DragImageView : public views::ImageView { | 21 class DragImageView : public views::ImageView { |
23 public: | 22 public: |
24 // |context is the native view context used to create the widget holding the | 23 // |context is the native view context used to create the widget holding the |
25 // drag image. | 24 // drag image. |
26 // |source| is the event source that started this drag drop operation (touch | 25 // |source| is the event source that started this drag drop operation (touch |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 scoped_ptr<views::Widget> widget_; | 64 scoped_ptr<views::Widget> widget_; |
66 gfx::Size widget_size_; | 65 gfx::Size widget_size_; |
67 | 66 |
68 ui::DragDropTypes::DragEventSource drag_event_source_; | 67 ui::DragDropTypes::DragEventSource drag_event_source_; |
69 int touch_drag_operation_; | 68 int touch_drag_operation_; |
70 gfx::Point touch_drag_operation_indicator_position_; | 69 gfx::Point touch_drag_operation_indicator_position_; |
71 | 70 |
72 DISALLOW_COPY_AND_ASSIGN(DragImageView); | 71 DISALLOW_COPY_AND_ASSIGN(DragImageView); |
73 }; | 72 }; |
74 | 73 |
75 } // namespace internal | |
76 } // namespace ash | 74 } // namespace ash |
77 | 75 |
78 #endif // ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_ | 76 #endif // ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_ |
OLD | NEW |