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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 Label* status_label_; | 203 Label* status_label_; |
204 const Operation operation_; | 204 const Operation operation_; |
205 | 205 |
206 DISALLOW_COPY_AND_ASSIGN(ExamplesWindowContents); | 206 DISALLOW_COPY_AND_ASSIGN(ExamplesWindowContents); |
207 }; | 207 }; |
208 | 208 |
209 // static | 209 // static |
210 ExamplesWindowContents* ExamplesWindowContents::instance_ = NULL; | 210 ExamplesWindowContents* ExamplesWindowContents::instance_ = NULL; |
211 | 211 |
212 void ShowExamplesWindow(Operation operation, | 212 void ShowExamplesWindow(Operation operation, |
213 aura::Window* window_context, | 213 gfx::NativeView window_context, |
214 ScopedExamples extra_examples) { | 214 ScopedExamples extra_examples) { |
215 if (ExamplesWindowContents::instance()) { | 215 if (ExamplesWindowContents::instance()) { |
216 ExamplesWindowContents::instance()->GetWidget()->Activate(); | 216 ExamplesWindowContents::instance()->GetWidget()->Activate(); |
217 } else { | 217 } else { |
218 ScopedExamples examples(GetExamplesToShow(extra_examples.Pass())); | 218 ScopedExamples examples(GetExamplesToShow(extra_examples.Pass())); |
219 Widget* widget = new Widget; | 219 Widget* widget = new Widget; |
220 Widget::InitParams params; | 220 Widget::InitParams params; |
221 params.delegate = new ExamplesWindowContents(operation, examples.Pass()); | 221 params.delegate = new ExamplesWindowContents(operation, examples.Pass()); |
222 params.context = window_context; | 222 params.context = window_context; |
223 params.bounds = gfx::Rect(0, 0, 850, 300); | 223 params.bounds = gfx::Rect(0, 0, 850, 300); |
224 params.remove_standard_frame = true; | 224 params.remove_standard_frame = true; |
225 widget->Init(params); | 225 widget->Init(params); |
226 widget->Show(); | 226 widget->Show(); |
227 } | 227 } |
228 } | 228 } |
229 | 229 |
230 void LogStatus(const std::string& string) { | 230 void LogStatus(const std::string& string) { |
231 ExamplesWindowContents::instance()->SetStatus(string); | 231 ExamplesWindowContents::instance()->SetStatus(string); |
232 } | 232 } |
233 | 233 |
234 } // namespace examples | 234 } // namespace examples |
235 } // namespace views | 235 } // namespace views |
OLD | NEW |