| 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/webtest/webtest.h" | 5 #include "mash/webtest/webtest.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 auto it = std::find(windows_.begin(), windows_.end(), window); | 152 auto it = std::find(windows_.begin(), windows_.end(), window); |
| 153 DCHECK(it != windows_.end()); | 153 DCHECK(it != windows_.end()); |
| 154 windows_.erase(it); | 154 windows_.erase(it); |
| 155 if (windows_.empty()) | 155 if (windows_.empty()) |
| 156 base::MessageLoop::current()->QuitWhenIdle(); | 156 base::MessageLoop::current()->QuitWhenIdle(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void Webtest::OnStart(const service_manager::ServiceInfo& info) { | 159 void Webtest::OnStart(const service_manager::ServiceInfo& info) { |
| 160 tracing_.Initialize(connector(), info.identity.name()); | 160 tracing_.Initialize(connector(), info.identity.name()); |
| 161 | 161 |
| 162 aura_init_.reset( | 162 aura_init_ = base::MakeUnique<views::AuraInit>(connector(), info.identity, |
| 163 new views::AuraInit(connector(), "views_mus_resources.pak")); | 163 "views_mus_resources.pak"); |
| 164 window_manager_connection_ = | 164 window_manager_connection_ = |
| 165 views::WindowManagerConnection::Create(connector(), info.identity); | 165 views::WindowManagerConnection::Create(connector(), info.identity); |
| 166 } | 166 } |
| 167 | 167 |
| 168 bool Webtest::OnConnect(const service_manager::ServiceInfo& remote_info, | 168 bool Webtest::OnConnect(const service_manager::ServiceInfo& remote_info, |
| 169 service_manager::InterfaceRegistry* registry) { | 169 service_manager::InterfaceRegistry* registry) { |
| 170 registry->AddInterface<mojom::Launchable>(this); | 170 registry->AddInterface<mojom::Launchable>(this); |
| 171 return true; | 171 return true; |
| 172 } | 172 } |
| 173 | 173 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 194 AddWindow(window); | 194 AddWindow(window); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void Webtest::Create(const service_manager::Identity& remote_identity, | 197 void Webtest::Create(const service_manager::Identity& remote_identity, |
| 198 mojom::LaunchableRequest request) { | 198 mojom::LaunchableRequest request) { |
| 199 bindings_.AddBinding(this, std::move(request)); | 199 bindings_.AddBinding(this, std::move(request)); |
| 200 } | 200 } |
| 201 | 201 |
| 202 } // namespace webtest | 202 } // namespace webtest |
| 203 } // namespace mash | 203 } // namespace mash |
| OLD | NEW |