summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/tabs/dragged_tab_view.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/views/tabs/dragged_tab_view.h')
-rw-r--r--chrome/browser/views/tabs/dragged_tab_view.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/chrome/browser/views/tabs/dragged_tab_view.h b/chrome/browser/views/tabs/dragged_tab_view.h
index e01db5c..1c212b6 100644
--- a/chrome/browser/views/tabs/dragged_tab_view.h
+++ b/chrome/browser/views/tabs/dragged_tab_view.h
@@ -40,9 +40,28 @@ class DraggedTabView : public views::View,
// pointer at |screen_point|.
void MoveTo(const gfx::Point& screen_point);
+ // Sets the offset of the mouse from the upper left corner of the tab.
+ void set_mouse_tab_offset(const gfx::Point& offset) {
+ mouse_tab_offset_ = offset;
+ }
+
+ // Sets the non-pinned tab width. The actual width of the dragged tab is the
+ // value last past to Attach or Resize. |tab_width| is used when Detach is
+ // invoked (which triggers resizing to |tab_width|), or when dragging within
+ // a tab strip and the dragged tab changes state from pinned to non-pinned.
+ void set_tab_width(int tab_width) { tab_width_ = tab_width; }
+ int tab_width() const { return tab_width_; }
+
// Notifies the DraggedTabView that it has become attached to a TabStrip.
void Attach(int selected_width);
+ // Resizes the dragged tab to a width of |width|.
+ void Resize(int width);
+
+ // Sets whether the tab is rendered pinned or not.
+ void set_pinned(bool pinned);
+ bool pinned() const;
+
// Notifies the DraggedTabView that it has been detached from a TabStrip.
void Detach(NativeViewPhotobooth* photobooth);
@@ -55,7 +74,7 @@ class DraggedTabView : public views::View,
// Returns the size of the DraggedTabView. Used when attaching to a TabStrip
// to determine where to place the Tab in the attached TabStrip.
- gfx::Size attached_tab_size() const { return attached_tab_size_; }
+ const gfx::Size& attached_tab_size() const { return attached_tab_size_; }
private:
// Overridden from AnimationDelegate:
@@ -106,8 +125,8 @@ class DraggedTabView : public views::View,
// position of detached windows.
gfx::Point mouse_tab_offset_;
- // The desired width of the TabRenderer when the DraggedTabView is attached
- // to a TabStrip.
+ // The size of the tab renderer when the dragged tab is attached to a
+ // tabstrip.
gfx::Size attached_tab_size_;
// A handle to the DIB containing the current screenshot of the TabContents
@@ -127,7 +146,10 @@ class DraggedTabView : public views::View,
gfx::Rect animation_start_bounds_;
gfx::Rect animation_end_bounds_;
- DISALLOW_EVIL_CONSTRUCTORS(DraggedTabView);
+ // Non-pinned tab width. See description above setter for how this is used.
+ int tab_width_;
+
+ DISALLOW_COPY_AND_ASSIGN(DraggedTabView);
};
#endif // CHROME_BROWSER_VIEWS_TABS_DRAGGED_TAB_VIEW_H_