Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Unified Diff: chrome/browser/ui/views/sidebar/sidebar_tab.h

Issue 6250141: Sidebar mini tabs UI (views version).... Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « chrome/browser/ui/views/sidebar/sidebar_base_tab_strip.cc ('k') | chrome/browser/ui/views/sidebar/sidebar_tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698