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

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

Issue 2576533003: Converts some services to use aura-mus (Closed)
Patch Set: remove log Created 4 years 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.h ('k') | mash/quick_launch/BUILD.gn » ('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 12 matching lines...) Expand all
23 #include "ui/base/resource/resource_bundle.h" 23 #include "ui/base/resource/resource_bundle.h"
24 #include "ui/resources/grit/ui_resources.h" 24 #include "ui/resources/grit/ui_resources.h"
25 #include "ui/views/background.h" 25 #include "ui/views/background.h"
26 #include "ui/views/controls/label.h" 26 #include "ui/views/controls/label.h"
27 #include "ui/views/controls/table/table_view.h" 27 #include "ui/views/controls/table/table_view.h"
28 #include "ui/views/controls/table/table_view_observer.h" 28 #include "ui/views/controls/table/table_view_observer.h"
29 #include "ui/views/controls/textfield/textfield.h" 29 #include "ui/views/controls/textfield/textfield.h"
30 #include "ui/views/controls/textfield/textfield_controller.h" 30 #include "ui/views/controls/textfield/textfield_controller.h"
31 #include "ui/views/layout/grid_layout.h" 31 #include "ui/views/layout/grid_layout.h"
32 #include "ui/views/mus/aura_init.h" 32 #include "ui/views/mus/aura_init.h"
33 #include "ui/views/mus/window_manager_connection.h" 33 #include "ui/views/widget/widget.h"
34 #include "ui/views/widget/widget_delegate.h" 34 #include "ui/views/widget/widget_delegate.h"
35 35
36 namespace mash { 36 namespace mash {
37 namespace catalog_viewer { 37 namespace catalog_viewer {
38 namespace { 38 namespace {
39 39
40 class CatalogViewerContents : public views::WidgetDelegateView, 40 class CatalogViewerContents : public views::WidgetDelegateView,
41 public ui::TableModel, 41 public ui::TableModel,
42 public views::TextfieldController { 42 public views::TextfieldController {
43 public: 43 public:
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 DCHECK(it != windows_.end()); 215 DCHECK(it != windows_.end());
216 windows_.erase(it); 216 windows_.erase(it);
217 if (windows_.empty()) 217 if (windows_.empty())
218 base::MessageLoop::current()->QuitWhenIdle(); 218 base::MessageLoop::current()->QuitWhenIdle();
219 } 219 }
220 220
221 void CatalogViewer::OnStart() { 221 void CatalogViewer::OnStart() {
222 tracing_.Initialize(context()->connector(), context()->identity().name()); 222 tracing_.Initialize(context()->connector(), context()->identity().name());
223 223
224 aura_init_ = base::MakeUnique<views::AuraInit>( 224 aura_init_ = base::MakeUnique<views::AuraInit>(
225 context()->connector(), context()->identity(), "views_mus_resources.pak"); 225 context()->connector(), context()->identity(), "views_mus_resources.pak",
226 window_manager_connection_ = views::WindowManagerConnection::Create( 226 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS);
227 context()->connector(), context()->identity());
228 } 227 }
229 228
230 bool CatalogViewer::OnConnect(const service_manager::ServiceInfo& remote_info, 229 bool CatalogViewer::OnConnect(const service_manager::ServiceInfo& remote_info,
231 service_manager::InterfaceRegistry* registry) { 230 service_manager::InterfaceRegistry* registry) {
232 registry->AddInterface<mojom::Launchable>(this); 231 registry->AddInterface<mojom::Launchable>(this);
233 return true; 232 return true;
234 } 233 }
235 234
236 void CatalogViewer::Launch(uint32_t what, mojom::LaunchMode how) { 235 void CatalogViewer::Launch(uint32_t what, mojom::LaunchMode how) {
237 bool reuse = how == mojom::LaunchMode::REUSE || 236 bool reuse = how == mojom::LaunchMode::REUSE ||
(...skipping 13 matching lines...) Expand all
251 windows_.push_back(window); 250 windows_.push_back(window);
252 } 251 }
253 252
254 void CatalogViewer::Create(const service_manager::Identity& remote_identity, 253 void CatalogViewer::Create(const service_manager::Identity& remote_identity,
255 mojom::LaunchableRequest request) { 254 mojom::LaunchableRequest request) {
256 bindings_.AddBinding(this, std::move(request)); 255 bindings_.AddBinding(this, std::move(request));
257 } 256 }
258 257
259 } // namespace catalog_viewer 258 } // namespace catalog_viewer
260 } // namespace mash 259 } // namespace mash
OLDNEW
« no previous file with comments | « mash/catalog_viewer/catalog_viewer.h ('k') | mash/quick_launch/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698