| 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/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 catalog::mojom::CatalogPtr catalog_; | 147 catalog::mojom::CatalogPtr catalog_; |
| 148 std::set<base::string16> app_names_; | 148 std::set<base::string16> app_names_; |
| 149 bool suggestion_rejected_ = false; | 149 bool suggestion_rejected_ = false; |
| 150 | 150 |
| 151 DISALLOW_COPY_AND_ASSIGN(QuickLaunchUI); | 151 DISALLOW_COPY_AND_ASSIGN(QuickLaunchUI); |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 QuickLaunch::QuickLaunch() { | 154 QuickLaunch::QuickLaunch() { |
| 155 registry_.AddInterface<::mash::mojom::Launchable>(this); | 155 registry_.AddInterface<::mash::mojom::Launchable>(this); |
| 156 } | 156 } |
| 157 QuickLaunch::~QuickLaunch() {} | 157 |
| 158 QuickLaunch::~QuickLaunch() { |
| 159 while (!windows_.empty()) |
| 160 windows_.front()->CloseNow(); |
| 161 } |
| 158 | 162 |
| 159 void QuickLaunch::RemoveWindow(views::Widget* window) { | 163 void QuickLaunch::RemoveWindow(views::Widget* window) { |
| 160 auto it = std::find(windows_.begin(), windows_.end(), window); | 164 auto it = std::find(windows_.begin(), windows_.end(), window); |
| 161 DCHECK(it != windows_.end()); | 165 DCHECK(it != windows_.end()); |
| 162 windows_.erase(it); | 166 windows_.erase(it); |
| 163 if (windows_.empty() && base::MessageLoop::current()->is_running()) | 167 if (windows_.empty() && base::MessageLoop::current()->is_running()) |
| 164 base::MessageLoop::current()->QuitWhenIdle(); | 168 base::MessageLoop::current()->QuitWhenIdle(); |
| 165 } | 169 } |
| 166 | 170 |
| 167 void QuickLaunch::OnStart() { | 171 void QuickLaunch::OnStart() { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 windows_.push_back(window); | 203 windows_.push_back(window); |
| 200 } | 204 } |
| 201 | 205 |
| 202 void QuickLaunch::Create(const service_manager::Identity& remote_identity, | 206 void QuickLaunch::Create(const service_manager::Identity& remote_identity, |
| 203 ::mash::mojom::LaunchableRequest request) { | 207 ::mash::mojom::LaunchableRequest request) { |
| 204 bindings_.AddBinding(this, std::move(request)); | 208 bindings_.AddBinding(this, std::move(request)); |
| 205 } | 209 } |
| 206 | 210 |
| 207 } // namespace quick_launch | 211 } // namespace quick_launch |
| 208 } // namespace mash | 212 } // namespace mash |
| OLD | NEW |