summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/tabs/side_tab.h
blob: a04c79f7f2965b98285416fc6abbf89e0a8222ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_VIEWS_TABS_SIDE_TAB_H_
#define CHROME_BROWSER_UI_VIEWS_TABS_SIDE_TAB_H_
#pragma once

#include "chrome/browser/ui/views/tabs/base_tab.h"
#include "ui/gfx/font.h"

class SideTab;
class TabStripController;

class SideTab : public BaseTab {
 public:
  explicit SideTab(TabController* controller);
  virtual ~SideTab();

  // Returns the preferred height of side tabs.
  static int GetPreferredHeight();

  // views::View Overrides:
  virtual void Layout() OVERRIDE;
  virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
  virtual gfx::Size GetPreferredSize() OVERRIDE;

 protected:
  virtual const gfx::Rect& GetTitleBounds() const OVERRIDE;
  virtual const gfx::Rect& GetIconBounds() const OVERRIDE;

  // Returns true if the selected highlight should be rendered.
  virtual bool ShouldPaintHighlight() const;

 private:
  // Returns true if the icon should be shown.
  bool ShouldShowIcon() const;

  gfx::Rect icon_bounds_;
  gfx::Rect title_bounds_;

  DISALLOW_COPY_AND_ASSIGN(SideTab);
};

#endif  // CHROME_BROWSER_UI_VIEWS_TABS_SIDE_TAB_H_