OLD | NEW |
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/examples_window.h" | 5 #include "ui/views/examples/examples_window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 public ComboboxListener { | 124 public ComboboxListener { |
125 public: | 125 public: |
126 ExamplesWindowContents(Operation operation, ScopedExamples examples) | 126 ExamplesWindowContents(Operation operation, ScopedExamples examples) |
127 : combobox_(new Combobox(&combobox_model_)), | 127 : combobox_(new Combobox(&combobox_model_)), |
128 example_shown_(new View), | 128 example_shown_(new View), |
129 status_label_(new Label), | 129 status_label_(new Label), |
130 operation_(operation) { | 130 operation_(operation) { |
131 instance_ = this; | 131 instance_ = this; |
132 combobox_->set_listener(this); | 132 combobox_->set_listener(this); |
133 combobox_model_.SetExamples(examples.Pass()); | 133 combobox_model_.SetExamples(examples.Pass()); |
| 134 combobox_->ModelChanged(); |
134 | 135 |
135 set_background(Background::CreateStandardPanelBackground()); | 136 set_background(Background::CreateStandardPanelBackground()); |
136 GridLayout* layout = new GridLayout(this); | 137 GridLayout* layout = new GridLayout(this); |
137 SetLayoutManager(layout); | 138 SetLayoutManager(layout); |
138 ColumnSet* column_set = layout->AddColumnSet(0); | 139 ColumnSet* column_set = layout->AddColumnSet(0); |
139 column_set->AddPaddingColumn(0, 5); | 140 column_set->AddPaddingColumn(0, 5); |
140 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, | 141 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, |
141 GridLayout::USE_PREF, 0, 0); | 142 GridLayout::USE_PREF, 0, 0); |
142 column_set->AddPaddingColumn(0, 5); | 143 column_set->AddPaddingColumn(0, 5); |
143 layout->AddPaddingRow(0, 5); | 144 layout->AddPaddingRow(0, 5); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 widget->Show(); | 226 widget->Show(); |
226 } | 227 } |
227 } | 228 } |
228 | 229 |
229 void LogStatus(const std::string& string) { | 230 void LogStatus(const std::string& string) { |
230 ExamplesWindowContents::instance()->SetStatus(string); | 231 ExamplesWindowContents::instance()->SetStatus(string); |
231 } | 232 } |
232 | 233 |
233 } // namespace examples | 234 } // namespace examples |
234 } // namespace views | 235 } // namespace views |
OLD | NEW |