| 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 <iterator> | 8 #include <iterator> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 View* example_shown_; | 212 View* example_shown_; |
| 213 Label* status_label_; | 213 Label* status_label_; |
| 214 const Operation operation_; | 214 const Operation operation_; |
| 215 | 215 |
| 216 DISALLOW_COPY_AND_ASSIGN(ExamplesWindowContents); | 216 DISALLOW_COPY_AND_ASSIGN(ExamplesWindowContents); |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 // static | 219 // static |
| 220 ExamplesWindowContents* ExamplesWindowContents::instance_ = NULL; | 220 ExamplesWindowContents* ExamplesWindowContents::instance_ = NULL; |
| 221 | 221 |
| 222 void ShowExamplesWindow(Operation operation, | 222 Widget* ShowExamplesWindow(Operation operation, |
| 223 gfx::NativeWindow window_context, | 223 gfx::NativeWindow window_context, |
| 224 ExampleVector extra_examples) { | 224 ExampleVector extra_examples) { |
| 225 if (ExamplesWindowContents::instance()) { | 225 if (ExamplesWindowContents::instance()) { |
| 226 ExamplesWindowContents::instance()->GetWidget()->Activate(); | 226 ExamplesWindowContents::instance()->GetWidget()->Activate(); |
| 227 } else { | 227 } else { |
| 228 ExampleVector examples = GetExamplesToShow(std::move(extra_examples)); | 228 ExampleVector examples = GetExamplesToShow(std::move(extra_examples)); |
| 229 Widget* widget = new Widget; | 229 Widget* widget = new Widget; |
| 230 Widget::InitParams params; | 230 Widget::InitParams params; |
| 231 params.delegate = | 231 params.delegate = |
| 232 new ExamplesWindowContents(operation, std::move(examples)); | 232 new ExamplesWindowContents(operation, std::move(examples)); |
| 233 params.context = window_context; | 233 params.context = window_context; |
| 234 widget->Init(params); | 234 widget->Init(params); |
| 235 widget->Show(); | 235 widget->Show(); |
| 236 } | 236 } |
| 237 return ExamplesWindowContents::instance()->GetWidget(); |
| 237 } | 238 } |
| 238 | 239 |
| 239 void LogStatus(const std::string& string) { | 240 void LogStatus(const std::string& string) { |
| 240 ExamplesWindowContents::instance()->SetStatus(string); | 241 ExamplesWindowContents::instance()->SetStatus(string); |
| 241 } | 242 } |
| 242 | 243 |
| 243 } // namespace examples | 244 } // namespace examples |
| 244 } // namespace views | 245 } // namespace views |
| OLD | NEW |