| OLD | NEW |
| 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 Loading... |
| 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_ = views::AuraInit::Create( | 225 aura_init_ = base::MakeUnique<views::AuraInit>( |
| 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(); | |
| 230 } | 228 } |
| 231 | 229 |
| 232 void CatalogViewer::OnBindInterface( | 230 void CatalogViewer::OnBindInterface( |
| 233 const service_manager::BindSourceInfo& source_info, | 231 const service_manager::BindSourceInfo& source_info, |
| 234 const std::string& interface_name, | 232 const std::string& interface_name, |
| 235 mojo::ScopedMessagePipeHandle interface_pipe) { | 233 mojo::ScopedMessagePipeHandle interface_pipe) { |
| 236 registry_.BindInterface(source_info, interface_name, | 234 registry_.BindInterface(source_info, interface_name, |
| 237 std::move(interface_pipe)); | 235 std::move(interface_pipe)); |
| 238 } | 236 } |
| 239 | 237 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 254 windows_.push_back(window); | 252 windows_.push_back(window); |
| 255 } | 253 } |
| 256 | 254 |
| 257 void CatalogViewer::Create(const service_manager::BindSourceInfo& source_info, | 255 void CatalogViewer::Create(const service_manager::BindSourceInfo& source_info, |
| 258 mojom::LaunchableRequest request) { | 256 mojom::LaunchableRequest request) { |
| 259 bindings_.AddBinding(this, std::move(request)); | 257 bindings_.AddBinding(this, std::move(request)); |
| 260 } | 258 } |
| 261 | 259 |
| 262 } // namespace catalog_viewer | 260 } // namespace catalog_viewer |
| 263 } // namespace mash | 261 } // namespace mash |
| OLD | NEW |