Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: mash/quick_launch/quick_launch.cc

Issue 2617883002: Add a new BindInterface() method to Connector. (Closed)
Patch Set: . Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mash/catalog_viewer/catalog_viewer.cc ('k') | mash/task_viewer/task_viewer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « mash/catalog_viewer/catalog_viewer.cc ('k') | mash/task_viewer/task_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698