| 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 CHROME_BROWSER_UI_GTK_TABS_DRAGGED_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_TABS_DRAGGED_VIEW_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_TABS_DRAGGED_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_TABS_DRAGGED_VIEW_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "ui/base/animation/animation_delegate.h" | |
| 15 #include "ui/base/animation/slide_animation.h" | |
| 16 #include "ui/base/gtk/gtk_signal.h" | 14 #include "ui/base/gtk/gtk_signal.h" |
| 15 #include "ui/gfx/animation/animation_delegate.h" |
| 16 #include "ui/gfx/animation/slide_animation.h" |
| 17 #include "ui/gfx/canvas.h" | 17 #include "ui/gfx/canvas.h" |
| 18 #include "ui/gfx/point.h" | 18 #include "ui/gfx/point.h" |
| 19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
| 20 #include "ui/gfx/size.h" | 20 #include "ui/gfx/size.h" |
| 21 | 21 |
| 22 class DragData; | 22 class DragData; |
| 23 class TabRendererGtk; | 23 class TabRendererGtk; |
| 24 | 24 |
| 25 class DraggedViewGtk : public ui::AnimationDelegate { | 25 class DraggedViewGtk : public gfx::AnimationDelegate { |
| 26 public: | 26 public: |
| 27 DraggedViewGtk(DragData* drag_data, | 27 DraggedViewGtk(DragData* drag_data, |
| 28 const gfx::Point& mouse_tab_offset, | 28 const gfx::Point& mouse_tab_offset, |
| 29 const gfx::Size& contents_size); | 29 const gfx::Size& contents_size); |
| 30 virtual ~DraggedViewGtk(); | 30 virtual ~DraggedViewGtk(); |
| 31 | 31 |
| 32 // Moves the attached dragged view to the appropriate location. | 32 // Moves the attached dragged view to the appropriate location. |
| 33 // |tabstrip_point| is the location of the upper left corner of the dragged | 33 // |tabstrip_point| is the location of the upper left corner of the dragged |
| 34 // view in screen coordinates. | 34 // view in screen coordinates. |
| 35 void MoveAttachedTo(const gfx::Point& tabstrip_point); | 35 void MoveAttachedTo(const gfx::Point& tabstrip_point); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // Returns the width occupied in the tabstrip from the left most point | 86 // Returns the width occupied in the tabstrip from the left most point |
| 87 // (regardless of RTL or LTR mode) of the dragged view up to the mouse pointer | 87 // (regardless of RTL or LTR mode) of the dragged view up to the mouse pointer |
| 88 // when the drag was initiated. | 88 // when the drag was initiated. |
| 89 int GetWidthInTabStripUpToMousePointer(); | 89 int GetWidthInTabStripUpToMousePointer(); |
| 90 | 90 |
| 91 // Returns the distance from the start of the tabstrip (left, regardless of | 91 // Returns the distance from the start of the tabstrip (left, regardless of |
| 92 // RTL) up to the position of the mouse pointer. | 92 // RTL) up to the position of the mouse pointer. |
| 93 gfx::Point GetDistanceFromTabStripOriginToMousePointer(); | 93 gfx::Point GetDistanceFromTabStripOriginToMousePointer(); |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 // Overridden from ui::AnimationDelegate: | 96 // Overridden from gfx::AnimationDelegate: |
| 97 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 97 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; |
| 98 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; | 98 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; |
| 99 virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE; | 99 virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE; |
| 100 | 100 |
| 101 // Arranges the contents of the dragged tab. | 101 // Arranges the contents of the dragged tab. |
| 102 void Layout(); | 102 void Layout(); |
| 103 | 103 |
| 104 // Gets the preferred size of the dragged tab. | 104 // Gets the preferred size of the dragged tab. |
| 105 gfx::Size GetPreferredSize(); | 105 gfx::Size GetPreferredSize(); |
| 106 | 106 |
| 107 // Resizes the container to fit the content for the current attachment mode. | 107 // Resizes the container to fit the content for the current attachment mode. |
| 108 void ResizeContainer(); | 108 void ResizeContainer(); |
| 109 | 109 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 gfx::Point mouse_tab_offset_; | 168 gfx::Point mouse_tab_offset_; |
| 169 | 169 |
| 170 // The size of the tab renderer when the dragged tab is attached to a | 170 // The size of the tab renderer when the dragged tab is attached to a |
| 171 // tabstrip. | 171 // tabstrip. |
| 172 gfx::Size attached_tab_size_; | 172 gfx::Size attached_tab_size_; |
| 173 | 173 |
| 174 // The dimensions of the WebContents being dragged. | 174 // The dimensions of the WebContents being dragged. |
| 175 gfx::Size contents_size_; | 175 gfx::Size contents_size_; |
| 176 | 176 |
| 177 // The animation used to slide the attached tab to its final location. | 177 // The animation used to slide the attached tab to its final location. |
| 178 ui::SlideAnimation close_animation_; | 178 gfx::SlideAnimation close_animation_; |
| 179 | 179 |
| 180 // A callback notified when the animation is complete. | 180 // A callback notified when the animation is complete. |
| 181 base::Closure animation_callback_; | 181 base::Closure animation_callback_; |
| 182 | 182 |
| 183 // The start and end bounds of the animation sequence. | 183 // The start and end bounds of the animation sequence. |
| 184 gfx::Rect animation_start_bounds_; | 184 gfx::Rect animation_start_bounds_; |
| 185 gfx::Rect animation_end_bounds_; | 185 gfx::Rect animation_end_bounds_; |
| 186 | 186 |
| 187 DISALLOW_COPY_AND_ASSIGN(DraggedViewGtk); | 187 DISALLOW_COPY_AND_ASSIGN(DraggedViewGtk); |
| 188 }; | 188 }; |
| 189 | 189 |
| 190 #endif // CHROME_BROWSER_UI_GTK_TABS_DRAGGED_VIEW_GTK_H_ | 190 #endif // CHROME_BROWSER_UI_GTK_TABS_DRAGGED_VIEW_GTK_H_ |
| OLD | NEW |