side_tab_strip.h revision 72a454cd3513ac24fbdd0e0cb9ad70b86a99b801
1// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_UI_VIEWS_TABS_SIDE_TAB_STRIP_H_
6#define CHROME_BROWSER_UI_VIEWS_TABS_SIDE_TAB_STRIP_H_
7#pragma once
8
9#include "chrome/browser/ui/views/tabs/base_tab_strip.h"
10
11struct TabRendererData;
12
13class SideTabStrip : public BaseTabStrip {
14 public:
15  // The tabs are inset by this much along all axis.
16  static const int kTabStripInset;
17
18  explicit SideTabStrip(TabStripController* controller);
19  virtual ~SideTabStrip();
20
21  // BaseTabStrip implementation:
22  virtual void SetBackgroundOffset(const gfx::Point& offset);
23  virtual bool IsPositionInWindowCaption(const gfx::Point& point);
24
25  virtual void StartHighlight(int model_index);
26  virtual void StopAllHighlighting();
27  virtual BaseTab* CreateTabForDragging();
28  virtual void RemoveTabAt(int model_index);
29  virtual void SelectTabAt(int old_model_index, int new_model_index);
30  virtual void TabTitleChangedNotLoading(int model_index);
31
32  // views::View overrides:
33  virtual gfx::Size GetPreferredSize();
34  virtual void PaintChildren(gfx::Canvas* canvas);
35
36 protected:
37  // BaseTabStrip overrides:
38  virtual BaseTab* CreateTab();
39  virtual void GenerateIdealBounds();
40  virtual void StartInsertTabAnimation(int model_index, bool foreground);
41  virtual void AnimateToIdealBounds();
42  virtual void DoLayout();
43
44 private:
45  // The "New Tab" button.
46  views::View* newtab_button_;
47
48  // Ideal bounds of the new tab button.
49  gfx::Rect newtab_button_bounds_;
50
51  // Separator between mini-tabs and the new tab button. The separator is
52  // positioned above the visible area if there are no mini-tabs.
53  views::View* separator_;
54
55  // Bounds of the sepatator.
56  gfx::Rect separator_bounds_;
57
58  DISALLOW_COPY_AND_ASSIGN(SideTabStrip);
59};
60
61#endif  // CHROME_BROWSER_UI_VIEWS_TABS_SIDE_TAB_STRIP_H_
62