diff options
Diffstat (limited to 'chrome/browser/views/tabs/side_tab_strip.cc')
-rw-r--r-- | chrome/browser/views/tabs/side_tab_strip.cc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/chrome/browser/views/tabs/side_tab_strip.cc b/chrome/browser/views/tabs/side_tab_strip.cc index 3ea8a3d..04bd44b 100644 --- a/chrome/browser/views/tabs/side_tab_strip.cc +++ b/chrome/browser/views/tabs/side_tab_strip.cc @@ -15,6 +15,7 @@ namespace { const int kVerticalTabSpacing = 2; const int kTabStripWidth = 127; +const int kTabStripInset = 3; } //////////////////////////////////////////////////////////////////////////////// @@ -79,6 +80,14 @@ bool SideTabStrip::IsSelected(SideTab* tab) const { return model_->IsSelected(GetIndexOfSideTab(tab)); } +void SideTabStrip::SelectTab(SideTab* tab) { + model_->SelectTab(GetIndexOfSideTab(tab)); +} + +void SideTabStrip::CloseTab(SideTab* tab) { + model_->CloseTab(GetIndexOfSideTab(tab)); +} + //////////////////////////////////////////////////////////////////////////////// // SideTabStrip, BaseTabStrip implementation: @@ -90,7 +99,7 @@ void SideTabStrip::SetBackgroundOffset(const gfx::Point& offset) { } bool SideTabStrip::IsPositionInWindowCaption(const gfx::Point& point) { - return true; + return GetViewForPoint(point) == this; } void SideTabStrip::SetDraggedTabBounds(int tab_index, @@ -116,18 +125,17 @@ TabStrip* SideTabStrip::AsTabStrip() { // SideTabStrip, views::View overrides: void SideTabStrip::Layout() { - int y = 0; + gfx::Rect layout_rect = GetLocalBounds(false); + layout_rect.Inset(kTabStripInset, kTabStripInset); + int y = layout_rect.y(); for (int c = GetChildViewCount(), i = 0; i < c; ++i) { views::View* child = GetChildViewAt(i); - child->SetBounds(0, y, width(), child->GetPreferredSize().height()); + child->SetBounds(layout_rect.x(), y, layout_rect.width(), + child->GetPreferredSize().height()); y = child->bounds().bottom() + kVerticalTabSpacing; } } -void SideTabStrip::Paint(gfx::Canvas* canvas) { - // canvas->FillRectInt(SK_ColorGREEN, 0, 0, width(), height()); -} - gfx::Size SideTabStrip::GetPreferredSize() { return gfx::Size(kTabStripWidth, 0); } |