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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 } | 183 } |
184 | 184 |
185 void QuickLaunch::Launch(uint32_t what, mojom::LaunchMode how) { | 185 void QuickLaunch::Launch(uint32_t what, mojom::LaunchMode how) { |
186 bool reuse = how == mojom::LaunchMode::REUSE || | 186 bool reuse = how == mojom::LaunchMode::REUSE || |
187 how == mojom::LaunchMode::DEFAULT; | 187 how == mojom::LaunchMode::DEFAULT; |
188 if (reuse && !windows_.empty()) { | 188 if (reuse && !windows_.empty()) { |
189 windows_.back()->Activate(); | 189 windows_.back()->Activate(); |
190 return; | 190 return; |
191 } | 191 } |
192 catalog::mojom::CatalogPtr catalog; | 192 catalog::mojom::CatalogPtr catalog; |
193 context()->connector()->ConnectToInterface(catalog::mojom::kServiceName, | 193 context()->connector()->BindInterface(catalog::mojom::kServiceName, &catalog); |
194 &catalog); | |
195 | 194 |
196 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( | 195 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( |
197 new QuickLaunchUI(this, context()->connector(), std::move(catalog)), | 196 new QuickLaunchUI(this, context()->connector(), std::move(catalog)), |
198 nullptr, gfx::Rect(10, 640, 0, 0)); | 197 nullptr, gfx::Rect(10, 640, 0, 0)); |
199 window->Show(); | 198 window->Show(); |
200 windows_.push_back(window); | 199 windows_.push_back(window); |
201 } | 200 } |
202 | 201 |
203 void QuickLaunch::Create(const service_manager::Identity& remote_identity, | 202 void QuickLaunch::Create(const service_manager::Identity& remote_identity, |
204 ::mash::mojom::LaunchableRequest request) { | 203 ::mash::mojom::LaunchableRequest request) { |
205 bindings_.AddBinding(this, std::move(request)); | 204 bindings_.AddBinding(this, std::move(request)); |
206 } | 205 } |
207 | 206 |
208 } // namespace quick_launch | 207 } // namespace quick_launch |
209 } // namespace mash | 208 } // namespace mash |
OLD | NEW |