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

Side by Side Diff: mash/task_viewer/task_viewer.cc

Issue 2967943002: Update AuraInit to handle failed initialization (Closed)
Patch Set: Switch to a Create method for AuraInit Created 3 years, 5 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
« no previous file with comments | « mash/simple_wm/simple_wm.cc ('k') | ui/views/mus/aura_init.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mash/task_viewer/task_viewer.h" 5 #include "mash/task_viewer/task_viewer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 287
288 void TaskViewer::RemoveWindow(views::Widget* widget) { 288 void TaskViewer::RemoveWindow(views::Widget* widget) {
289 auto it = std::find(windows_.begin(), windows_.end(), widget); 289 auto it = std::find(windows_.begin(), windows_.end(), widget);
290 DCHECK(it != windows_.end()); 290 DCHECK(it != windows_.end());
291 windows_.erase(it); 291 windows_.erase(it);
292 if (windows_.empty()) 292 if (windows_.empty())
293 base::MessageLoop::current()->QuitWhenIdle(); 293 base::MessageLoop::current()->QuitWhenIdle();
294 } 294 }
295 295
296 void TaskViewer::OnStart() { 296 void TaskViewer::OnStart() {
297 aura_init_ = base::MakeUnique<views::AuraInit>( 297 aura_init_ = views::AuraInit::Create(
298 context()->connector(), context()->identity(), "views_mus_resources.pak", 298 context()->connector(), context()->identity(), "views_mus_resources.pak",
299 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS); 299 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS);
300 if (!aura_init_)
301 context()->QuitNow();
300 } 302 }
301 303
302 void TaskViewer::OnBindInterface( 304 void TaskViewer::OnBindInterface(
303 const service_manager::BindSourceInfo& source_info, 305 const service_manager::BindSourceInfo& source_info,
304 const std::string& interface_name, 306 const std::string& interface_name,
305 mojo::ScopedMessagePipeHandle interface_pipe) { 307 mojo::ScopedMessagePipeHandle interface_pipe) {
306 registry_.BindInterface(source_info, interface_name, 308 registry_.BindInterface(source_info, interface_name,
307 std::move(interface_pipe)); 309 std::move(interface_pipe));
308 } 310 }
309 311
(...skipping 22 matching lines...) Expand all
332 service_manager->AddListener(std::move(listener)); 334 service_manager->AddListener(std::move(listener));
333 } 335 }
334 336
335 void TaskViewer::Create(const service_manager::BindSourceInfo& source_info, 337 void TaskViewer::Create(const service_manager::BindSourceInfo& source_info,
336 ::mash::mojom::LaunchableRequest request) { 338 ::mash::mojom::LaunchableRequest request) {
337 bindings_.AddBinding(this, std::move(request)); 339 bindings_.AddBinding(this, std::move(request));
338 } 340 }
339 341
340 } // namespace task_viewer 342 } // namespace task_viewer
341 } // namespace main 343 } // namespace main
OLDNEW
« no previous file with comments | « mash/simple_wm/simple_wm.cc ('k') | ui/views/mus/aura_init.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698