Chromium Code Reviews| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 views::Textfield* prompt_; | 146 views::Textfield* prompt_; |
| 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 } |
|
Elliot Glaysher
2017/02/15 20:08:30
nit: newline between ctor and dtor?
sky
2017/02/15 20:10:01
Done.
| |
| 157 QuickLaunch::~QuickLaunch() {} | 157 QuickLaunch::~QuickLaunch() { |
| 158 while (!windows_.empty()) | |
| 159 windows_.front()->CloseNow(); | |
| 160 } | |
| 158 | 161 |
| 159 void QuickLaunch::RemoveWindow(views::Widget* window) { | 162 void QuickLaunch::RemoveWindow(views::Widget* window) { |
| 160 auto it = std::find(windows_.begin(), windows_.end(), window); | 163 auto it = std::find(windows_.begin(), windows_.end(), window); |
| 161 DCHECK(it != windows_.end()); | 164 DCHECK(it != windows_.end()); |
| 162 windows_.erase(it); | 165 windows_.erase(it); |
| 163 if (windows_.empty() && base::MessageLoop::current()->is_running()) | 166 if (windows_.empty() && base::MessageLoop::current()->is_running()) |
| 164 base::MessageLoop::current()->QuitWhenIdle(); | 167 base::MessageLoop::current()->QuitWhenIdle(); |
| 165 } | 168 } |
| 166 | 169 |
| 167 void QuickLaunch::OnStart() { | 170 void QuickLaunch::OnStart() { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 windows_.push_back(window); | 202 windows_.push_back(window); |
| 200 } | 203 } |
| 201 | 204 |
| 202 void QuickLaunch::Create(const service_manager::Identity& remote_identity, | 205 void QuickLaunch::Create(const service_manager::Identity& remote_identity, |
| 203 ::mash::mojom::LaunchableRequest request) { | 206 ::mash::mojom::LaunchableRequest request) { |
| 204 bindings_.AddBinding(this, std::move(request)); | 207 bindings_.AddBinding(this, std::move(request)); |
| 205 } | 208 } |
| 206 | 209 |
| 207 } // namespace quick_launch | 210 } // namespace quick_launch |
| 208 } // namespace mash | 211 } // namespace mash |
| OLD | NEW |