| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 combobox_model_.AddExample(new TreeViewExample); | 177 combobox_model_.AddExample(new TreeViewExample); |
| 178 combobox_model_.AddExample(new WidgetExample); | 178 combobox_model_.AddExample(new WidgetExample); |
| 179 } | 179 } |
| 180 | 180 |
| 181 static ExamplesWindowContents* instance_; | 181 static ExamplesWindowContents* instance_; |
| 182 ComboboxModelExampleList combobox_model_; | 182 ComboboxModelExampleList combobox_model_; |
| 183 Combobox* combobox_; | 183 Combobox* combobox_; |
| 184 View* example_shown_; | 184 View* example_shown_; |
| 185 Label* status_label_; | 185 Label* status_label_; |
| 186 const Operation operation_; | 186 const Operation operation_; |
| 187 content::BrowserContext* browser_context_; | |
| 188 | 187 |
| 189 DISALLOW_COPY_AND_ASSIGN(ExamplesWindowContents); | 188 DISALLOW_COPY_AND_ASSIGN(ExamplesWindowContents); |
| 190 }; | 189 }; |
| 191 | 190 |
| 192 // static | 191 // static |
| 193 ExamplesWindowContents* ExamplesWindowContents::instance_ = NULL; | 192 ExamplesWindowContents* ExamplesWindowContents::instance_ = NULL; |
| 194 | 193 |
| 195 void ShowExamplesWindow(Operation operation) { | 194 void ShowExamplesWindow(Operation operation) { |
| 196 if (ExamplesWindowContents::instance()) { | 195 if (ExamplesWindowContents::instance()) { |
| 197 ExamplesWindowContents::instance()->GetWidget()->Activate(); | 196 ExamplesWindowContents::instance()->GetWidget()->Activate(); |
| 198 } else { | 197 } else { |
| 199 Widget::CreateWindowWithBounds(new ExamplesWindowContents(operation), | 198 Widget::CreateWindowWithBounds(new ExamplesWindowContents(operation), |
| 200 gfx::Rect(0, 0, 850, 300))->Show(); | 199 gfx::Rect(0, 0, 850, 300))->Show(); |
| 201 } | 200 } |
| 202 } | 201 } |
| 203 | 202 |
| 204 void LogStatus(const std::string& string) { | 203 void LogStatus(const std::string& string) { |
| 205 ExamplesWindowContents::instance()->SetStatus(string); | 204 ExamplesWindowContents::instance()->SetStatus(string); |
| 206 } | 205 } |
| 207 | 206 |
| 208 } // namespace examples | 207 } // namespace examples |
| 209 } // namespace views | 208 } // namespace views |
| OLD | NEW |