• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_H_
6 #define CHROME_BROWSER_UI_VIEWS_TABS_SIDE_TAB_H_
7 #pragma once
8 
9 #include "chrome/browser/ui/views/tabs/base_tab.h"
10 #include "ui/gfx/font.h"
11 
12 class SideTab;
13 class TabStripController;
14 
15 class 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() OVERRIDE;
25   virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
26   virtual gfx::Size GetPreferredSize() OVERRIDE;
27 
28  protected:
29   virtual const gfx::Rect& GetTitleBounds() const OVERRIDE;
30   virtual const gfx::Rect& GetIconBounds() const OVERRIDE;
31 
32   // Returns true if the selected highlight should be rendered.
33   virtual bool ShouldPaintHighlight() const;
34 
35  private:
36   // Returns true if the icon should be shown.
37   bool ShouldShowIcon() const;
38 
39   gfx::Rect icon_bounds_;
40   gfx::Rect title_bounds_;
41 
42   DISALLOW_COPY_AND_ASSIGN(SideTab);
43 };
44 
45 #endif  // CHROME_BROWSER_UI_VIEWS_TABS_SIDE_TAB_H_
46