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

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

Issue 2915223002: mash: Fix mash app shelf items; encapsulate ash property setup. (Closed)
Patch Set: Similar changes for other mash apps. Created 3 years, 6 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
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/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
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
OLDNEW
« mash/task_viewer/task_viewer.cc ('K') | « ui/views/examples/examples_window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698