| Index: chrome/browser/ui/views/sidebar/sidebar_tab.h
|
| ===================================================================
|
| --- chrome/browser/ui/views/sidebar/sidebar_tab.h (revision 0)
|
| +++ chrome/browser/ui/views/sidebar/sidebar_tab.h (revision 0)
|
| @@ -0,0 +1,81 @@
|
| +// Copyright (c) 2010 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_SIDEBAR_SIDEBAR_TAB_H_
|
| +#define CHROME_BROWSER_UI_VIEWS_SIDEBAR_SIDEBAR_TAB_H_
|
| +#pragma once
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/compiler_specific.h"
|
| +#include "base/scoped_ptr.h"
|
| +#include "chrome/browser/ui/views/sidebar/sidebar_base_tab.h"
|
| +#include "gfx/point.h"
|
| +
|
| +namespace ui {
|
| +class SlideAnimation;
|
| +} // namespace ui
|
| +
|
| +// A View that renders a SidebarTab in a SidebarTabStrip.
|
| +// Does the actual layout and painting, loads the actual image resources.
|
| +class SidebarTab : public SidebarBaseTab {
|
| + public:
|
| + static const char kViewClassName[];
|
| +
|
| + explicit SidebarTab(SidebarTabController* controller);
|
| + virtual ~SidebarTab();
|
| +
|
| + // SidebarBaseTab overrides:
|
| + virtual void GetShape(gfx::Path* shape) const;
|
| +
|
| + // Returns the minimum possible size of a single unselected tab.
|
| + static gfx::Size GetMinimumUnselectedSize();
|
| + // Returns the minimum possible size of a selected tab. Selected tabs must
|
| + // always have a larger minimum size than unselected tabs.
|
| + static gfx::Size GetMinimumSelectedSize();
|
| + // Returns the preferred size of a single tab, assuming space is
|
| + // available.
|
| + static gfx::Size GetStandardSize();
|
| +
|
| + protected:
|
| + // SidebarBaseTab overrides:
|
| + virtual void DataChanged(const SidebarTabRendererData& old_data) OVERRIDE;
|
| +
|
| + private:
|
| + struct TabImage;
|
| + struct TabImages;
|
| +
|
| + // Overridden from views::View:
|
| + virtual void Paint(gfx::Canvas* canvas) OVERRIDE;
|
| + virtual void Layout() OVERRIDE;
|
| + virtual void OnThemeChanged() OVERRIDE;
|
| + virtual std::string GetClassName() const OVERRIDE { return kViewClassName; }
|
| + virtual bool HasHitTestMask() const OVERRIDE;
|
| + virtual void GetHitTestMask(gfx::Path* path) const OVERRIDE;
|
| + virtual bool GetTooltipTextOrigin(const gfx::Point& p,
|
| + gfx::Point* origin) OVERRIDE;
|
| +
|
| + // Returns cached tab background images.
|
| + static TabImages& tab_images();
|
| +
|
| + // Paint various portions of the tab
|
| + void PaintTabBackground(gfx::Canvas* canvas);
|
| + void PaintTabBackgroundImage(gfx::Canvas* canvas, bool as_active);
|
| + // Paints the icon. Most of the time you'll want to invoke Paint directly, but
|
| + // in certain situations this invoked outside of Paint.
|
| + void PaintIcon(gfx::Canvas* canvas);
|
| + // Paints badge text.
|
| + void PaintBadge(gfx::Canvas* canvas);
|
| +
|
| + // The bounds of the various sections of the display.
|
| + gfx::Rect icon_bounds_;
|
| +
|
| + // Hover animation.
|
| + scoped_ptr<ui::SlideAnimation> hover_animation_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(SidebarTab);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_UI_VIEWS_SIDEBAR_SIDEBAR_TAB_H_
|
| +
|
|
|
| Property changes on: chrome\browser\ui\views\sidebar\sidebar_tab.h
|
| ___________________________________________________________________
|
| Added: svn:eol-style
|
| + LF
|
|
|
|
|