side_tab.h revision 4a5e2dc747d50c653511c68ccb2cfbfb740bd5a7
1// Copyright (c) 2010 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_H_
6#define CHROME_BROWSER_UI_VIEWS_TABS_SIDE_TAB_H_
7#pragma once
8
9#include "chrome/browser/views/tabs/base_tab.h"
10#include "gfx/font.h"
11
12class SideTab;
13class TabStripController;
14
15class SideTab : public BaseTab {
16 public:
17  explicit SideTab(TabController* controller);
18  virtual ~SideTab();
19
20  // Returns the preferred height of side tabs.
21  static int GetPreferredHeight();
22
23  // views::View Overrides:
24  virtual void Layout();
25  virtual void Paint(gfx::Canvas* canvas);
26  virtual gfx::Size GetPreferredSize();
27
28 protected:
29  virtual const gfx::Rect& title_bounds() const { return title_bounds_; }
30
31  // Returns true if the selected highlight should be rendered.
32  virtual bool ShouldPaintHighlight() const;
33
34 private:
35  // Returns true if the icon should be shown.
36  bool ShouldShowIcon() const;
37
38  gfx::Rect icon_bounds_;
39  gfx::Rect title_bounds_;
40
41  DISALLOW_COPY_AND_ASSIGN(SideTab);
42};
43
44#endif  // CHROME_BROWSER_UI_VIEWS_TABS_SIDE_TAB_H_
45