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/views/controls/image_view.h" | 8 #include "ui/views/controls/image_view.h" |
9 | 9 |
10 namespace views { | 10 namespace views { |
11 class Widget; | 11 class Widget; |
12 } | 12 } |
13 | 13 |
14 namespace ash { | 14 namespace ash { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
17 class DragImageView : public views::ImageView { | 17 class DragImageView : public views::ImageView { |
18 public: | 18 public: |
19 DragImageView(); | 19 DragImageView(gfx::NativeView context); |
Ben Goodger (Google)
2013/01/09 17:30:22
explicit
| |
20 virtual ~DragImageView(); | 20 virtual ~DragImageView(); |
21 | 21 |
22 // Sets the bounds of the native widget in screen | 22 // Sets the bounds of the native widget in screen |
23 // coordinates. | 23 // coordinates. |
24 // TODO(oshima): Looks like this is root window's | 24 // TODO(oshima): Looks like this is root window's |
25 // coordinate. Change this to screen's coordinate. | 25 // coordinate. Change this to screen's coordinate. |
26 void SetBoundsInScreen(const gfx::Rect& bounds); | 26 void SetBoundsInScreen(const gfx::Rect& bounds); |
27 | 27 |
28 // Sets the position of the native widget. | 28 // Sets the position of the native widget. |
29 void SetScreenPosition(const gfx::Point& position); | 29 void SetScreenPosition(const gfx::Point& position); |
30 | 30 |
31 // Sets the visibility of the native widget. | 31 // Sets the visibility of the native widget. |
32 void SetWidgetVisible(bool visible); | 32 void SetWidgetVisible(bool visible); |
33 | 33 |
34 private: | 34 private: |
35 // Overridden from views::ImageView. | 35 // Overridden from views::ImageView. |
36 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 36 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
37 | 37 |
38 scoped_ptr<views::Widget> widget_; | 38 scoped_ptr<views::Widget> widget_; |
39 gfx::Size widget_size_; | 39 gfx::Size widget_size_; |
40 | 40 |
41 DISALLOW_COPY_AND_ASSIGN(DragImageView); | 41 DISALLOW_COPY_AND_ASSIGN(DragImageView); |
42 }; | 42 }; |
43 | 43 |
44 } // namespace internal | 44 } // namespace internal |
45 } // namespace ash | 45 } // namespace ash |
46 | 46 |
47 #endif // ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_ | 47 #endif // ASH_DRAG_DROP_DRAG_IMAGE_VIEW_H_ |
OLD | NEW |