OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_VIEWS_TABS_DRAGGED_TAB_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_TABS_DRAGGED_TAB_VIEW_H_ |
6 #define CHROME_BROWSER_VIEWS_TABS_DRAGGED_TAB_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_TABS_DRAGGED_TAB_VIEW_H_ |
7 | 7 |
8 #include "app/slide_animation.h" | 8 #include "app/slide_animation.h" |
9 #include "base/gfx/point.h" | 9 #include "base/gfx/point.h" |
10 #include "base/gfx/size.h" | 10 #include "base/gfx/size.h" |
11 #include "base/task.h" | 11 #include "base/task.h" |
12 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
13 #include "views/view.h" | 13 #include "views/view.h" |
14 | 14 |
15 namespace views { | 15 namespace views { |
16 class WidgetWin; | 16 class WidgetWin; |
17 } | 17 } |
18 namespace gfx { | 18 namespace gfx { |
19 class Point; | 19 class Point; |
20 } | 20 } |
21 class HWNDPhotobooth; | 21 class NativeViewPhotobooth; |
22 class Tab; | 22 class Tab; |
23 class TabContents; | 23 class TabContents; |
24 class TabRenderer; | 24 class TabRenderer; |
25 | 25 |
26 class DraggedTabView : public views::View, | 26 class DraggedTabView : public views::View, |
27 public AnimationDelegate { | 27 public AnimationDelegate { |
28 public: | 28 public: |
29 DraggedTabView(TabContents* datasource, | 29 DraggedTabView(TabContents* datasource, |
30 const gfx::Point& mouse_tab_offset, | 30 const gfx::Point& mouse_tab_offset, |
31 const gfx::Size& contents_size); | 31 const gfx::Size& contents_size); |
32 virtual ~DraggedTabView(); | 32 virtual ~DraggedTabView(); |
33 | 33 |
34 // Moves the DraggedTabView to the appropriate location given the mouse | 34 // Moves the DraggedTabView to the appropriate location given the mouse |
35 // pointer at |screen_point|. | 35 // pointer at |screen_point|. |
36 void MoveTo(const gfx::Point& screen_point); | 36 void MoveTo(const gfx::Point& screen_point); |
37 | 37 |
38 // Notifies the DraggedTabView that it has become attached to a TabStrip. | 38 // Notifies the DraggedTabView that it has become attached to a TabStrip. |
39 void Attach(int selected_width); | 39 void Attach(int selected_width); |
40 | 40 |
41 // Notifies the DraggedTabView that it has been detached from a TabStrip. | 41 // Notifies the DraggedTabView that it has been detached from a TabStrip. |
42 void Detach(HWNDPhotobooth* photobooth); | 42 void Detach(NativeViewPhotobooth* photobooth); |
43 | 43 |
44 // Notifies the DraggedTabView that it should update itself. | 44 // Notifies the DraggedTabView that it should update itself. |
45 void Update(); | 45 void Update(); |
46 | 46 |
47 // Animates the DraggedTabView to the specified bounds, then calls back to | 47 // Animates the DraggedTabView to the specified bounds, then calls back to |
48 // |callback|. | 48 // |callback|. |
49 void AnimateToBounds(const gfx::Rect& bounds, Callback0::Type* callback); | 49 void AnimateToBounds(const gfx::Rect& bounds, Callback0::Type* callback); |
50 | 50 |
51 // Returns the size of the DraggedTabView. Used when attaching to a TabStrip | 51 // Returns the size of the DraggedTabView. Used when attaching to a TabStrip |
52 // to determine where to place the Tab in the attached TabStrip. | 52 // to determine where to place the Tab in the attached TabStrip. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // dragging scaled and unscaled representations, and also to calculate the | 96 // dragging scaled and unscaled representations, and also to calculate the |
97 // position of detached windows. | 97 // position of detached windows. |
98 gfx::Point mouse_tab_offset_; | 98 gfx::Point mouse_tab_offset_; |
99 | 99 |
100 // The desired width of the TabRenderer when the DraggedTabView is attached | 100 // The desired width of the TabRenderer when the DraggedTabView is attached |
101 // to a TabStrip. | 101 // to a TabStrip. |
102 gfx::Size attached_tab_size_; | 102 gfx::Size attached_tab_size_; |
103 | 103 |
104 // A handle to the DIB containing the current screenshot of the TabContents | 104 // A handle to the DIB containing the current screenshot of the TabContents |
105 // we are dragging. | 105 // we are dragging. |
106 HWNDPhotobooth* photobooth_; | 106 NativeViewPhotobooth* photobooth_; |
107 | 107 |
108 // The dimensions of the TabContents being dragged. | 108 // The dimensions of the TabContents being dragged. |
109 gfx::Size contents_size_; | 109 gfx::Size contents_size_; |
110 | 110 |
111 // The animation used to slide the attached view to its final location. | 111 // The animation used to slide the attached view to its final location. |
112 SlideAnimation close_animation_; | 112 SlideAnimation close_animation_; |
113 | 113 |
114 // A callback notified when the animation is complete. | 114 // A callback notified when the animation is complete. |
115 scoped_ptr<Callback0::Type> animation_callback_; | 115 scoped_ptr<Callback0::Type> animation_callback_; |
116 | 116 |
117 // The start and end bounds of the animation sequence. | 117 // The start and end bounds of the animation sequence. |
118 gfx::Rect animation_start_bounds_; | 118 gfx::Rect animation_start_bounds_; |
119 gfx::Rect animation_end_bounds_; | 119 gfx::Rect animation_end_bounds_; |
120 | 120 |
121 DISALLOW_EVIL_CONSTRUCTORS(DraggedTabView); | 121 DISALLOW_EVIL_CONSTRUCTORS(DraggedTabView); |
122 }; | 122 }; |
123 | 123 |
124 #endif // CHROME_BROWSER_VIEWS_TABS_DRAGGED_TAB_VIEW_H_ | 124 #endif // CHROME_BROWSER_VIEWS_TABS_DRAGGED_TAB_VIEW_H_ |
OLD | NEW |