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

Side by Side Diff: mash/catalog_viewer/catalog_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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/catalog_viewer/catalog_viewer.h" 5 #include "mash/catalog_viewer/catalog_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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 215
216 void CatalogViewer::RemoveWindow(views::Widget* window) { 216 void CatalogViewer::RemoveWindow(views::Widget* window) {
217 auto it = std::find(windows_.begin(), windows_.end(), window); 217 auto it = std::find(windows_.begin(), windows_.end(), window);
218 DCHECK(it != windows_.end()); 218 DCHECK(it != windows_.end());
219 windows_.erase(it); 219 windows_.erase(it);
220 if (windows_.empty()) 220 if (windows_.empty())
221 base::MessageLoop::current()->QuitWhenIdle(); 221 base::MessageLoop::current()->QuitWhenIdle();
222 } 222 }
223 223
224 void CatalogViewer::OnStart() { 224 void CatalogViewer::OnStart() {
225 aura_init_ = base::MakeUnique<views::AuraInit>( 225 aura_init_ = views::AuraInit::Create(
226 context()->connector(), context()->identity(), "views_mus_resources.pak", 226 context()->connector(), context()->identity(), "views_mus_resources.pak",
227 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS); 227 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS);
228 if (!aura_init_)
229 context()->QuitNow();
228 } 230 }
229 231
230 void CatalogViewer::OnBindInterface( 232 void CatalogViewer::OnBindInterface(
231 const service_manager::BindSourceInfo& source_info, 233 const service_manager::BindSourceInfo& source_info,
232 const std::string& interface_name, 234 const std::string& interface_name,
233 mojo::ScopedMessagePipeHandle interface_pipe) { 235 mojo::ScopedMessagePipeHandle interface_pipe) {
234 registry_.BindInterface(source_info, interface_name, 236 registry_.BindInterface(source_info, interface_name,
235 std::move(interface_pipe)); 237 std::move(interface_pipe));
236 } 238 }
237 239
(...skipping 14 matching lines...) Expand all
252 windows_.push_back(window); 254 windows_.push_back(window);
253 } 255 }
254 256
255 void CatalogViewer::Create(const service_manager::BindSourceInfo& source_info, 257 void CatalogViewer::Create(const service_manager::BindSourceInfo& source_info,
256 mojom::LaunchableRequest request) { 258 mojom::LaunchableRequest request) {
257 bindings_.AddBinding(this, std::move(request)); 259 bindings_.AddBinding(this, std::move(request));
258 } 260 }
259 261
260 } // namespace catalog_viewer 262 } // namespace catalog_viewer
261 } // namespace mash 263 } // namespace mash
OLDNEW
« no previous file with comments | « ash/touch_hud/mus/touch_hud_application.cc ('k') | mash/example/views_examples/views_examples.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698