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

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

Issue 2967943002: Update AuraInit to handle failed initialization (Closed)
Patch Set: 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
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_ = base::MakeUnique<views::AuraInit>();
298 context()->connector(), context()->identity(), "views_mus_resources.pak", 298 if (!aura_init_->Init(context()->connector(), context()->identity(),
299 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS); 299 "views_mus_resources.pak", std::string(), nullptr,
300 views::AuraInit::Mode::AURA_MUS)) {
301 context()->QuitNow();
302 }
300 } 303 }
301 304
302 void TaskViewer::OnBindInterface( 305 void TaskViewer::OnBindInterface(
303 const service_manager::BindSourceInfo& source_info, 306 const service_manager::BindSourceInfo& source_info,
304 const std::string& interface_name, 307 const std::string& interface_name,
305 mojo::ScopedMessagePipeHandle interface_pipe) { 308 mojo::ScopedMessagePipeHandle interface_pipe) {
306 registry_.BindInterface(source_info, interface_name, 309 registry_.BindInterface(source_info, interface_name,
307 std::move(interface_pipe)); 310 std::move(interface_pipe));
308 } 311 }
309 312
(...skipping 22 matching lines...) Expand all
332 service_manager->AddListener(std::move(listener)); 335 service_manager->AddListener(std::move(listener));
333 } 336 }
334 337
335 void TaskViewer::Create(const service_manager::BindSourceInfo& source_info, 338 void TaskViewer::Create(const service_manager::BindSourceInfo& source_info,
336 ::mash::mojom::LaunchableRequest request) { 339 ::mash::mojom::LaunchableRequest request) {
337 bindings_.AddBinding(this, std::move(request)); 340 bindings_.AddBinding(this, std::move(request));
338 } 341 }
339 342
340 } // namespace task_viewer 343 } // namespace task_viewer
341 } // namespace main 344 } // namespace main
OLDNEW
« no previous file with comments | « mash/simple_wm/simple_wm.cc ('k') | ui/views/mus/aura_init.h » ('j') | ui/views/mus/aura_init.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698