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

Unified Diff: ui/views/controls/tabbed_pane/tabbed_pane.cc

Issue 889453004: Tab, TabStrip: Added GetClassName override. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/tabbed_pane/tabbed_pane.cc
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane.cc b/ui/views/controls/tabbed_pane/tabbed_pane.cc
index 9d07c6bdbf855a3be4d78dbc30919e5d09c3148b..bbf341b3c86bbd0fc2d95c65d226305d8de33a73 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane.cc
+++ b/ui/views/controls/tabbed_pane/tabbed_pane.cc
@@ -34,6 +34,9 @@ const char TabbedPane::kViewClassName[] = "TabbedPane";
// The tab view shown in the tab strip.
class Tab : public View {
public:
+ // Internal class name.
+ static const char kViewClassName[];
+
Tab(TabbedPane* tabbed_pane, const base::string16& title, View* contents);
~Tab() override;
@@ -49,6 +52,7 @@ class Tab : public View {
void OnGestureEvent(ui::GestureEvent* event) override;
gfx::Size GetPreferredSize() const override;
void Layout() override;
+ const char* GetClassName() const override;
private:
enum TabState {
@@ -72,12 +76,16 @@ class Tab : public View {
// The tab strip shown above the tab contents.
class TabStrip : public View {
public:
+ // Internal class name.
+ static const char kViewClassName[];
+
explicit TabStrip(TabbedPane* tabbed_pane);
~TabStrip() override;
// Overridden from View:
gfx::Size GetPreferredSize() const override;
void Layout() override;
+ const char* GetClassName() const override;
void OnPaint(gfx::Canvas* canvas) override;
private:
@@ -86,6 +94,9 @@ class TabStrip : public View {
DISALLOW_COPY_AND_ASSIGN(TabStrip);
};
+// static
+const char Tab::kViewClassName[] = "Tab";
+
Tab::Tab(TabbedPane* tabbed_pane, const base::string16& title, View* contents)
: tabbed_pane_(tabbed_pane),
title_(new Label(title,
@@ -155,6 +166,10 @@ void Tab::Layout() {
title_->SetBoundsRect(bounds);
}
+const char* Tab::GetClassName() const {
+ return kViewClassName;
+}
+
void Tab::SetState(TabState tab_state) {
if (tab_state == tab_state_)
return;
@@ -178,6 +193,9 @@ void Tab::SetState(TabState tab_state) {
SchedulePaint();
}
+// static
+const char TabStrip::kViewClassName[] = "TabStrip";
+
TabStrip::TabStrip(TabbedPane* tabbed_pane) : tabbed_pane_(tabbed_pane) {}
TabStrip::~TabStrip() {}
@@ -202,6 +220,10 @@ void TabStrip::Layout() {
}
}
+const char* TabStrip::GetClassName() const {
+ return kViewClassName;
+}
+
void TabStrip::OnPaint(gfx::Canvas* canvas) {
OnPaintBackground(canvas);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698