| 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/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 base::MessageLoop::current()->QuitWhenIdle(); | 168 base::MessageLoop::current()->QuitWhenIdle(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void Webtest::OnStart() { | 171 void Webtest::OnStart() { |
| 172 tracing_.Initialize(context()->connector(), context()->identity().name()); | 172 tracing_.Initialize(context()->connector(), context()->identity().name()); |
| 173 aura_init_ = base::MakeUnique<views::AuraInit>( | 173 aura_init_ = base::MakeUnique<views::AuraInit>( |
| 174 context()->connector(), context()->identity(), "views_mus_resources.pak", | 174 context()->connector(), context()->identity(), "views_mus_resources.pak", |
| 175 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS); | 175 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void Webtest::OnBindInterface(const service_manager::ServiceInfo& source_info, | 178 void Webtest::OnBindInterface( |
| 179 const std::string& interface_name, | 179 const service_manager::BindSourceInfo& source_info, |
| 180 mojo::ScopedMessagePipeHandle interface_pipe) { | 180 const std::string& interface_name, |
| 181 mojo::ScopedMessagePipeHandle interface_pipe) { |
| 181 registry_.BindInterface(source_info.identity, interface_name, | 182 registry_.BindInterface(source_info.identity, interface_name, |
| 182 std::move(interface_pipe)); | 183 std::move(interface_pipe)); |
| 183 } | 184 } |
| 184 | 185 |
| 185 void Webtest::Launch(uint32_t what, mojom::LaunchMode how) { | 186 void Webtest::Launch(uint32_t what, mojom::LaunchMode how) { |
| 186 bool reuse = how == mojom::LaunchMode::REUSE || | 187 bool reuse = how == mojom::LaunchMode::REUSE || |
| 187 how == mojom::LaunchMode::DEFAULT; | 188 how == mojom::LaunchMode::DEFAULT; |
| 188 if (reuse && !windows_.empty()) { | 189 if (reuse && !windows_.empty()) { |
| 189 windows_.back()->Activate(); | 190 windows_.back()->Activate(); |
| 190 return; | 191 return; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 204 AddWindow(window); | 205 AddWindow(window); |
| 205 } | 206 } |
| 206 | 207 |
| 207 void Webtest::Create(const service_manager::Identity& remote_identity, | 208 void Webtest::Create(const service_manager::Identity& remote_identity, |
| 208 mojom::LaunchableRequest request) { | 209 mojom::LaunchableRequest request) { |
| 209 bindings_.AddBinding(this, std::move(request)); | 210 bindings_.AddBinding(this, std::move(request)); |
| 210 } | 211 } |
| 211 | 212 |
| 212 } // namespace webtest | 213 } // namespace webtest |
| 213 } // namespace mash | 214 } // namespace mash |
| OLD | NEW |