| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 void Webtest::OnStart(const shell::Identity& identity) { | 160 void Webtest::OnStart(const shell::Identity& identity) { |
| 161 tracing_.Initialize(connector(), identity.name()); | 161 tracing_.Initialize(connector(), identity.name()); |
| 162 | 162 |
| 163 aura_init_.reset( | 163 aura_init_.reset( |
| 164 new views::AuraInit(connector(), "views_mus_resources.pak")); | 164 new views::AuraInit(connector(), "views_mus_resources.pak")); |
| 165 window_manager_connection_ = | 165 window_manager_connection_ = |
| 166 views::WindowManagerConnection::Create(connector(), identity); | 166 views::WindowManagerConnection::Create(connector(), identity); |
| 167 } | 167 } |
| 168 | 168 |
| 169 bool Webtest::OnConnect(shell::Connection* connection) { | 169 bool Webtest::OnConnect(const shell::Identity& remote_identity, |
| 170 connection->AddInterface<mojom::Launchable>(this); | 170 shell::InterfaceRegistry* registry) { |
| 171 registry->AddInterface<mojom::Launchable>(this); |
| 171 return true; | 172 return true; |
| 172 } | 173 } |
| 173 | 174 |
| 174 void Webtest::Launch(uint32_t what, mojom::LaunchMode how) { | 175 void Webtest::Launch(uint32_t what, mojom::LaunchMode how) { |
| 175 bool reuse = how == mojom::LaunchMode::REUSE || | 176 bool reuse = how == mojom::LaunchMode::REUSE || |
| 176 how == mojom::LaunchMode::DEFAULT; | 177 how == mojom::LaunchMode::DEFAULT; |
| 177 if (reuse && !windows_.empty()) { | 178 if (reuse && !windows_.empty()) { |
| 178 windows_.back()->Activate(); | 179 windows_.back()->Activate(); |
| 179 return; | 180 return; |
| 180 } | 181 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 194 AddWindow(window); | 195 AddWindow(window); |
| 195 } | 196 } |
| 196 | 197 |
| 197 void Webtest::Create(const shell::Identity& remote_identity, | 198 void Webtest::Create(const shell::Identity& remote_identity, |
| 198 mojom::LaunchableRequest request) { | 199 mojom::LaunchableRequest request) { |
| 199 bindings_.AddBinding(this, std::move(request)); | 200 bindings_.AddBinding(this, std::move(request)); |
| 200 } | 201 } |
| 201 | 202 |
| 202 } // namespace webtest | 203 } // namespace webtest |
| 203 } // namespace mash | 204 } // namespace mash |
| OLD | NEW |