| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "ui/base/dragdrop/drag_drop_types.h" | 12 #include "ui/base/dragdrop/drag_drop_types.h" |
| 13 #include "ui/gfx/geometry/point.h" | 13 #include "ui/gfx/geometry/point.h" |
| 14 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 15 #include "ui/views/controls/image_view.h" | 15 #include "ui/views/controls/image_view.h" |
| 16 | 16 |
| 17 namespace aura { |
| 18 class Window; |
| 19 } |
| 20 |
| 17 namespace gfx { | 21 namespace gfx { |
| 18 class Image; | 22 class Image; |
| 19 } | 23 } |
| 20 | 24 |
| 21 namespace views { | 25 namespace views { |
| 22 class Widget; | 26 class Widget; |
| 23 } | 27 } |
| 24 | 28 |
| 25 namespace ash { | 29 namespace ash { |
| 26 | 30 |
| 27 class WmWindow; | |
| 28 | |
| 29 // This class allows to show a (native) view always on top of everything. It | 31 // This class allows to show a (native) view always on top of everything. It |
| 30 // does this by creating a widget and setting the content as the given view. The | 32 // does this by creating a widget and setting the content as the given view. The |
| 31 // caller can then use this object to freely move / drag it around on the | 33 // caller can then use this object to freely move / drag it around on the |
| 32 // desktop in screen coordinates. | 34 // desktop in screen coordinates. |
| 33 class ASH_EXPORT DragImageView : public views::ImageView { | 35 class ASH_EXPORT DragImageView : public views::ImageView { |
| 34 public: | 36 public: |
| 35 // |root_window| is the root window on which to create the drag image widget. | 37 // |root_window| is the root window on which to create the drag image widget. |
| 36 // |source| is the event source that started this drag drop operation (touch | 38 // |source| is the event source that started this drag drop operation (touch |
| 37 // or mouse). It is used to determine attributes of the drag image such as | 39 // or mouse). It is used to determine attributes of the drag image such as |
| 38 // whether to show drag operation hint on top of the image. | 40 // whether to show drag operation hint on top of the image. |
| 39 DragImageView(WmWindow* root_window, | 41 DragImageView(aura::Window* root_window, |
| 40 ui::DragDropTypes::DragEventSource source); | 42 ui::DragDropTypes::DragEventSource source); |
| 41 ~DragImageView() override; | 43 ~DragImageView() override; |
| 42 | 44 |
| 43 // Sets the bounds of the native widget in screen | 45 // Sets the bounds of the native widget in screen |
| 44 // coordinates. | 46 // coordinates. |
| 45 // TODO(oshima): Looks like this is root window's | 47 // TODO(oshima): Looks like this is root window's |
| 46 // coordinate. Change this to screen's coordinate. | 48 // coordinate. Change this to screen's coordinate. |
| 47 void SetBoundsInScreen(const gfx::Rect& bounds); | 49 void SetBoundsInScreen(const gfx::Rect& bounds); |
| 48 | 50 |
| 49 // Sets the position of the native widget. | 51 // Sets the position of the native widget. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // Bitmask of ui::DragDropTypes::DragOperation values. | 96 // Bitmask of ui::DragDropTypes::DragOperation values. |
| 95 int touch_drag_operation_; | 97 int touch_drag_operation_; |
| 96 gfx::Point touch_drag_operation_indicator_position_; | 98 gfx::Point touch_drag_operation_indicator_position_; |
| 97 | 99 |
| 98 DISALLOW_COPY_AND_ASSIGN(DragImageView); | 100 DISALLOW_COPY_AND_ASSIGN(DragImageView); |
| 99 }; | 101 }; |
| 100 | 102 |
| 101 } // namespace ash | 103 } // namespace ash |
| 102 | 104 |
| 103 #endif // ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_ | 105 #endif // ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_ |
| OLD | NEW |