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/quick_launch/quick_launch.h" | 5 #include "mash/quick_launch/quick_launch.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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" |
10 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
11 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
12 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
13 #include "mash/public/interfaces/launchable.mojom.h" | 14 #include "mash/public/interfaces/launchable.mojom.h" |
14 #include "services/catalog/public/interfaces/catalog.mojom.h" | 15 #include "services/catalog/public/interfaces/catalog.mojom.h" |
15 #include "services/catalog/public/interfaces/constants.mojom.h" | 16 #include "services/catalog/public/interfaces/constants.mojom.h" |
16 #include "services/service_manager/public/c/main.h" | 17 #include "services/service_manager/public/c/main.h" |
17 #include "services/service_manager/public/cpp/connector.h" | 18 #include "services/service_manager/public/cpp/connector.h" |
18 #include "services/service_manager/public/cpp/interface_registry.h" | 19 #include "services/service_manager/public/cpp/interface_registry.h" |
19 #include "services/service_manager/public/cpp/service.h" | 20 #include "services/service_manager/public/cpp/service.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 160 |
160 QuickLaunch::~QuickLaunch() { | 161 QuickLaunch::~QuickLaunch() { |
161 while (!windows_.empty()) | 162 while (!windows_.empty()) |
162 windows_.front()->CloseNow(); | 163 windows_.front()->CloseNow(); |
163 } | 164 } |
164 | 165 |
165 void QuickLaunch::RemoveWindow(views::Widget* window) { | 166 void QuickLaunch::RemoveWindow(views::Widget* window) { |
166 auto it = std::find(windows_.begin(), windows_.end(), window); | 167 auto it = std::find(windows_.begin(), windows_.end(), window); |
167 DCHECK(it != windows_.end()); | 168 DCHECK(it != windows_.end()); |
168 windows_.erase(it); | 169 windows_.erase(it); |
169 if (windows_.empty() && base::MessageLoop::current()->is_running()) | 170 if (windows_.empty() && base::RunLoop::IsRunningOnCurrentThread()) |
170 base::MessageLoop::current()->QuitWhenIdle(); | 171 base::MessageLoop::current()->QuitWhenIdle(); |
171 } | 172 } |
172 | 173 |
173 void QuickLaunch::OnStart() { | 174 void QuickLaunch::OnStart() { |
174 tracing_.Initialize(context()->connector(), context()->identity().name()); | 175 tracing_.Initialize(context()->connector(), context()->identity().name()); |
175 | 176 |
176 aura_init_ = base::MakeUnique<views::AuraInit>( | 177 aura_init_ = base::MakeUnique<views::AuraInit>( |
177 context()->connector(), context()->identity(), "views_mus_resources.pak", | 178 context()->connector(), context()->identity(), "views_mus_resources.pak", |
178 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS); | 179 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS); |
179 | 180 |
(...skipping 26 matching lines...) Expand all Loading... |
206 windows_.push_back(window); | 207 windows_.push_back(window); |
207 } | 208 } |
208 | 209 |
209 void QuickLaunch::Create(const service_manager::Identity& remote_identity, | 210 void QuickLaunch::Create(const service_manager::Identity& remote_identity, |
210 ::mash::mojom::LaunchableRequest request) { | 211 ::mash::mojom::LaunchableRequest request) { |
211 bindings_.AddBinding(this, std::move(request)); | 212 bindings_.AddBinding(this, std::move(request)); |
212 } | 213 } |
213 | 214 |
214 } // namespace quick_launch | 215 } // namespace quick_launch |
215 } // namespace mash | 216 } // namespace mash |
OLD | NEW |