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