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

Side by Side Diff: mash/catalog_viewer/catalog_viewer.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/browser/browser.cc ('k') | mash/quick_launch/quick_launch.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/catalog_viewer/catalog_viewer.h" 5 #include "mash/catalog_viewer/catalog_viewer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 } 233 }
234 234
235 void CatalogViewer::Launch(uint32_t what, mojom::LaunchMode how) { 235 void CatalogViewer::Launch(uint32_t what, mojom::LaunchMode how) {
236 bool reuse = how == mojom::LaunchMode::REUSE || 236 bool reuse = how == mojom::LaunchMode::REUSE ||
237 how == mojom::LaunchMode::DEFAULT; 237 how == mojom::LaunchMode::DEFAULT;
238 if (reuse && !windows_.empty()) { 238 if (reuse && !windows_.empty()) {
239 windows_.back()->Activate(); 239 windows_.back()->Activate();
240 return; 240 return;
241 } 241 }
242 catalog::mojom::CatalogPtr catalog; 242 catalog::mojom::CatalogPtr catalog;
243 context()->connector()->ConnectToInterface(catalog::mojom::kServiceName, 243 context()->connector()->BindInterface(catalog::mojom::kServiceName, &catalog);
244 &catalog);
245 244
246 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( 245 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds(
247 new CatalogViewerContents(this, std::move(catalog)), nullptr, 246 new CatalogViewerContents(this, std::move(catalog)), nullptr,
248 gfx::Rect(25, 25, 500, 600)); 247 gfx::Rect(25, 25, 500, 600));
249 window->Show(); 248 window->Show();
250 windows_.push_back(window); 249 windows_.push_back(window);
251 } 250 }
252 251
253 void CatalogViewer::Create(const service_manager::Identity& remote_identity, 252 void CatalogViewer::Create(const service_manager::Identity& remote_identity,
254 mojom::LaunchableRequest request) { 253 mojom::LaunchableRequest request) {
255 bindings_.AddBinding(this, std::move(request)); 254 bindings_.AddBinding(this, std::move(request));
256 } 255 }
257 256
258 } // namespace catalog_viewer 257 } // namespace catalog_viewer
259 } // namespace mash 258 } // namespace mash
OLDNEW
« no previous file with comments | « mash/browser/browser.cc ('k') | mash/quick_launch/quick_launch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698