| Index: chrome/browser/ui/views/tabs/side_tab_strip.h
|
| diff --git a/chrome/browser/ui/views/tabs/side_tab_strip.h b/chrome/browser/ui/views/tabs/side_tab_strip.h
|
| index 9c4038261a10e7e6311a887409e869e437a01b79..54365ada19400c1ef89098cbf56149214d1a7880 100644
|
| --- a/chrome/browser/ui/views/tabs/side_tab_strip.h
|
| +++ b/chrome/browser/ui/views/tabs/side_tab_strip.h
|
| @@ -7,10 +7,11 @@
|
| #pragma once
|
|
|
| #include "chrome/browser/ui/views/tabs/base_tab_strip.h"
|
| +#include "views/controls/button/button.h"
|
|
|
| struct TabRendererData;
|
|
|
| -class SideTabStrip : public BaseTabStrip {
|
| +class SideTabStrip : public BaseTabStrip, public views::ButtonListener {
|
| public:
|
| // The tabs are inset by this much along all axis.
|
| static const int kTabStripInset;
|
| @@ -33,6 +34,12 @@ class SideTabStrip : public BaseTabStrip {
|
| // views::View overrides:
|
| virtual gfx::Size GetPreferredSize() OVERRIDE;
|
| virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE;
|
| + virtual views::View* GetEventHandlerForPoint(
|
| + const gfx::Point& point) OVERRIDE;
|
| +
|
| + // views::ButtonListener overrides:
|
| + virtual void ButtonPressed(views::Button* sender,
|
| + const views::Event& event) OVERRIDE;
|
|
|
| protected:
|
| // BaseTabStrip overrides:
|
| @@ -51,13 +58,32 @@ class SideTabStrip : public BaseTabStrip {
|
| std::vector<gfx::Rect>* bounds) OVERRIDE;
|
| virtual int GetSizeNeededForTabs(const std::vector<BaseTab*>& tabs) OVERRIDE;
|
|
|
| + // views::View protected overrides:
|
| + virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
|
| +
|
| private:
|
| + // Sets |first_tab_y_offset_|. This ensures |new_offset| is legal.
|
| + void SetFirstTabYOffset(int new_offset);
|
| +
|
| + // Returns the max y offset.
|
| + int GetMaxOffset() const;
|
| +
|
| + // Returns the max visible y-coordinate for tabs.
|
| + int GetMaxTabY() const;
|
| +
|
| + // Make sure the tab at |tab_index| is visible.
|
| + void MakeTabVisible(int tab_index);
|
| +
|
| // The "New Tab" button.
|
| views::View* newtab_button_;
|
|
|
| // Ideal bounds of the new tab button.
|
| gfx::Rect newtab_button_bounds_;
|
|
|
| + // Scroll buttons.
|
| + views::View* scroll_up_button_;
|
| + views::View* scroll_down_button_;
|
| +
|
| // Separator between mini-tabs and the new tab button. The separator is
|
| // positioned above the visible area if there are no mini-tabs.
|
| views::View* separator_;
|
| @@ -65,6 +91,14 @@ class SideTabStrip : public BaseTabStrip {
|
| // Bounds of the sepatator.
|
| gfx::Rect separator_bounds_;
|
|
|
| + // Offset the first tab (or new tab button) is positioned at. If the user has
|
| + // scrolled the tabs this is non-zero.
|
| + int first_tab_y_offset_;
|
| +
|
| + // Height needed to display the tabs, separator and new tab button. Doesn't
|
| + // include any padding.
|
| + int ideal_height_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(SideTabStrip);
|
| };
|
|
|
|
|