| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 base::MessageLoop::current()->QuitWhenIdle(); | 148 base::MessageLoop::current()->QuitWhenIdle(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 void Webtest::Initialize(shell::Connector* connector, | 151 void Webtest::Initialize(shell::Connector* connector, |
| 152 const shell::Identity& identity, | 152 const shell::Identity& identity, |
| 153 uint32_t id) { | 153 uint32_t id) { |
| 154 connector_ = connector; | 154 connector_ = connector; |
| 155 tracing_.Initialize(connector, identity.name()); | 155 tracing_.Initialize(connector, identity.name()); |
| 156 | 156 |
| 157 aura_init_.reset(new views::AuraInit(connector, "views_mus_resources.pak")); | 157 aura_init_.reset(new views::AuraInit(connector, "views_mus_resources.pak")); |
| 158 views::WindowManagerConnection::Create(connector, identity); | 158 window_manager_connection_ = |
| 159 views::WindowManagerConnection::Create(connector, identity); |
| 159 } | 160 } |
| 160 | 161 |
| 161 bool Webtest::AcceptConnection(shell::Connection* connection) { | 162 bool Webtest::AcceptConnection(shell::Connection* connection) { |
| 162 connection->AddInterface<mojom::Launchable>(this); | 163 connection->AddInterface<mojom::Launchable>(this); |
| 163 return true; | 164 return true; |
| 164 } | 165 } |
| 165 | 166 |
| 166 void Webtest::Launch(uint32_t what, mojom::LaunchMode how) { | 167 void Webtest::Launch(uint32_t what, mojom::LaunchMode how) { |
| 167 bool reuse = how == mojom::LaunchMode::REUSE || | 168 bool reuse = how == mojom::LaunchMode::REUSE || |
| 168 how == mojom::LaunchMode::DEFAULT; | 169 how == mojom::LaunchMode::DEFAULT; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 186 AddWindow(window); | 187 AddWindow(window); |
| 187 } | 188 } |
| 188 | 189 |
| 189 void Webtest::Create(shell::Connection* connection, | 190 void Webtest::Create(shell::Connection* connection, |
| 190 mojom::LaunchableRequest request) { | 191 mojom::LaunchableRequest request) { |
| 191 bindings_.AddBinding(this, std::move(request)); | 192 bindings_.AddBinding(this, std::move(request)); |
| 192 } | 193 } |
| 193 | 194 |
| 194 } // namespace webtest | 195 } // namespace webtest |
| 195 } // namespace mash | 196 } // namespace mash |
| OLD | NEW |