| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/service.h" | 5 #include "services/ui/service.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 for (auto& request : requests) { | 224 for (auto& request : requests) { |
| 225 if (request->wtf_request) | 225 if (request->wtf_request) |
| 226 Create(request->remote_identity, std::move(*request->wtf_request)); | 226 Create(request->remote_identity, std::move(*request->wtf_request)); |
| 227 else | 227 else |
| 228 Create(request->remote_identity, std::move(*request->dm_request)); | 228 Create(request->remote_identity, std::move(*request->dm_request)); |
| 229 } | 229 } |
| 230 } | 230 } |
| 231 | 231 |
| 232 void Service::OnNoMoreDisplays() { | 232 void Service::OnNoMoreDisplays() { |
| 233 // We may get here from the destructor, in which case there is no messageloop. | 233 // We may get here from the destructor, in which case there is no messageloop. |
| 234 if (base::MessageLoop::current()) | 234 if (base::MessageLoop::current() && |
| 235 base::MessageLoop::current()->is_running()) { |
| 235 base::MessageLoop::current()->QuitWhenIdle(); | 236 base::MessageLoop::current()->QuitWhenIdle(); |
| 237 } |
| 236 } | 238 } |
| 237 | 239 |
| 238 bool Service::IsTestConfig() const { | 240 bool Service::IsTestConfig() const { |
| 239 return test_config_; | 241 return test_config_; |
| 240 } | 242 } |
| 241 | 243 |
| 242 void Service::UpdateTouchTransforms() { | 244 void Service::UpdateTouchTransforms() { |
| 243 if (touch_controller_) | 245 if (touch_controller_) |
| 244 touch_controller_->UpdateTouchTransforms(); | 246 touch_controller_->UpdateTouchTransforms(); |
| 245 } | 247 } |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 | 348 |
| 347 void Service::Create(const shell::Identity& remote_identity, | 349 void Service::Create(const shell::Identity& remote_identity, |
| 348 mojom::WindowServerTestRequest request) { | 350 mojom::WindowServerTestRequest request) { |
| 349 if (!test_config_) | 351 if (!test_config_) |
| 350 return; | 352 return; |
| 351 new ws::WindowServerTestImpl(window_server_.get(), std::move(request)); | 353 new ws::WindowServerTestImpl(window_server_.get(), std::move(request)); |
| 352 } | 354 } |
| 353 | 355 |
| 354 | 356 |
| 355 } // namespace ui | 357 } // namespace ui |
| OLD | NEW |