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

Unified Diff: ui/views/examples/tabbed_pane_example.cc

Issue 12225042: Remove NativeTabbedPane[Win|Wrapper]; promote Views impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments; cleanup. Created 7 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
« no previous file with comments | « ui/views/examples/tabbed_pane_example.h ('k') | ui/views/focus/focus_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/tabbed_pane_example.cc
diff --git a/ui/views/examples/tabbed_pane_example.cc b/ui/views/examples/tabbed_pane_example.cc
index b92d92819d1ebb233554fd313656935d643ec61f..f22c08e87e4898b75dd71daf343c5b4469cb761e 100644
--- a/ui/views/examples/tabbed_pane_example.cc
+++ b/ui/views/examples/tabbed_pane_example.cc
@@ -22,7 +22,6 @@ void TabbedPaneExample::CreateExampleView(View* container) {
tabbed_pane_->set_listener(this);
add_ = new TextButton(this, ASCIIToUTF16("Add"));
add_at_ = new TextButton(this, ASCIIToUTF16("Add At 1"));
- remove_at_ = new TextButton(this, ASCIIToUTF16("Remove At 1"));
select_at_ = new TextButton(this, ASCIIToUTF16("Select At 1"));
GridLayout* layout = new GridLayout(container);
@@ -42,7 +41,7 @@ void TabbedPaneExample::CreateExampleView(View* container) {
// Add control buttons horizontally.
const int button_column = 1;
column_set = layout->AddColumnSet(button_column);
- for (int i = 0; i < 4; i++) {
+ for (int i = 0; i < 3; i++) {
column_set->AddColumn(GridLayout::FILL, GridLayout::FILL,
1.0f, GridLayout::USE_PREF, 0, 0);
}
@@ -50,7 +49,6 @@ void TabbedPaneExample::CreateExampleView(View* container) {
layout->StartRow(0 /* no expand */, button_column);
layout->AddView(add_);
layout->AddView(add_at_);
- layout->AddView(remove_at_);
layout->AddView(select_at_);
}
@@ -59,10 +57,7 @@ void TabbedPaneExample::ButtonPressed(Button* sender, const ui::Event& event) {
AddButton("Added");
} else if (sender == add_at_) {
const string16 label = ASCIIToUTF16("Added at 1");
- tabbed_pane_->AddTabAtIndex(1, label, new TextButton(NULL, label), true);
- } else if (sender == remove_at_) {
- if (tabbed_pane_->GetTabCount() > 1)
- delete tabbed_pane_->RemoveTabAtIndex(1);
+ tabbed_pane_->AddTabAtIndex(1, label, new TextButton(NULL, label));
} else if (sender == select_at_) {
if (tabbed_pane_->GetTabCount() > 1)
tabbed_pane_->SelectTabAt(1);
@@ -78,7 +73,7 @@ void TabbedPaneExample::TabSelectedAt(int index) {
void TabbedPaneExample::PrintStatus() {
ExampleBase::PrintStatus("Tab Count:%d, Selected Tab:%d",
tabbed_pane_->GetTabCount(),
- tabbed_pane_->GetSelectedTabIndex());
+ tabbed_pane_->selected_tab_index());
}
void TabbedPaneExample::AddButton(const std::string& label) {
« no previous file with comments | « ui/views/examples/tabbed_pane_example.h ('k') | ui/views/focus/focus_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698