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

Side by Side Diff: ui/views/examples/tree_view_example.cc

Issue 1963563002: Views: Flip default value of CustomButton::request_focus_on_press_ to false. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « ui/views/examples/tree_view_example.h ('k') | ui/views/examples/widget_example.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/examples/tree_view_example.h" 5 #include "ui/views/examples/tree_view_example.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/views/controls/button/label_button.h" 8 #include "ui/views/controls/button/label_button.h"
9 #include "ui/views/controls/menu/menu_model_adapter.h" 9 #include "ui/views/controls/menu/menu_model_adapter.h"
10 #include "ui/views/controls/menu/menu_runner.h" 10 #include "ui/views/controls/menu/menu_runner.h"
(...skipping 30 matching lines...) Expand all
41 sheep_node->Add(new NodeType(ASCIIToUTF16("Sheep 1"), 1), 0); 41 sheep_node->Add(new NodeType(ASCIIToUTF16("Sheep 1"), 1), 0);
42 sheep_node->Add(new NodeType(ASCIIToUTF16("Sheep 2"), 1), 1); 42 sheep_node->Add(new NodeType(ASCIIToUTF16("Sheep 2"), 1), 1);
43 43
44 tree_view_ = new TreeView(); 44 tree_view_ = new TreeView();
45 tree_view_->set_context_menu_controller(this); 45 tree_view_->set_context_menu_controller(this);
46 tree_view_->SetRootShown(false); 46 tree_view_->SetRootShown(false);
47 tree_view_->SetModel(&model_); 47 tree_view_->SetModel(&model_);
48 tree_view_->SetController(this); 48 tree_view_->SetController(this);
49 add_ = new LabelButton(this, ASCIIToUTF16("Add")); 49 add_ = new LabelButton(this, ASCIIToUTF16("Add"));
50 Button::ConfigureDefaultFocus(add_); 50 Button::ConfigureDefaultFocus(add_);
51 add_->set_request_focus_on_press(true);
51 remove_ = new LabelButton(this, ASCIIToUTF16("Remove")); 52 remove_ = new LabelButton(this, ASCIIToUTF16("Remove"));
52 Button::ConfigureDefaultFocus(remove_); 53 Button::ConfigureDefaultFocus(remove_);
54 remove_->set_request_focus_on_press(true);
53 change_title_ = new LabelButton(this, ASCIIToUTF16("Change Title")); 55 change_title_ = new LabelButton(this, ASCIIToUTF16("Change Title"));
54 Button::ConfigureDefaultFocus(change_title_); 56 Button::ConfigureDefaultFocus(change_title_);
57 change_title_->set_request_focus_on_press(true);
55 58
56 GridLayout* layout = new GridLayout(container); 59 GridLayout* layout = new GridLayout(container);
57 container->SetLayoutManager(layout); 60 container->SetLayoutManager(layout);
58 61
59 const int tree_view_column = 0; 62 const int tree_view_column = 0;
60 ColumnSet* column_set = layout->AddColumnSet(tree_view_column); 63 ColumnSet* column_set = layout->AddColumnSet(tree_view_column);
61 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 64 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL,
62 1.0f, GridLayout::USE_PREF, 0, 0); 65 1.0f, GridLayout::USE_PREF, 0, 0);
63 layout->StartRow(1 /* expand */, tree_view_column); 66 layout->StartRow(1 /* expand */, tree_view_column);
64 layout->AddView(tree_view_->CreateParentIfNecessary()); 67 layout->AddView(tree_view_->CreateParentIfNecessary());
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 case ID_ADD: 172 case ID_ADD:
170 AddNewNode(); 173 AddNewNode();
171 break; 174 break;
172 default: 175 default:
173 NOTREACHED(); 176 NOTREACHED();
174 } 177 }
175 } 178 }
176 179
177 } // namespace examples 180 } // namespace examples
178 } // namespace views 181 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/tree_view_example.h ('k') | ui/views/examples/widget_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698