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