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

Side by Side Diff: ash/touch_hud/mus/touch_hud_application.cc

Issue 2476063002: Service Manager: Rework Service and ServiceContext lifetime (Closed)
Patch Set: . Created 4 years, 1 month 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 | « ash/touch_hud/mus/touch_hud_application.h ('k') | chrome/app/mash/mash_runner.h » ('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 "ash/touch_hud/mus/touch_hud_application.h" 5 #include "ash/touch_hud/mus/touch_hud_application.h"
6 6
7 #include "ash/public/cpp/shell_window_ids.h" 7 #include "ash/public/cpp/shell_window_ids.h"
8 #include "ash/touch_hud/touch_hud_renderer.h" 8 #include "ash/touch_hud/touch_hud_renderer.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "services/service_manager/public/cpp/connector.h" 12 #include "services/service_manager/public/cpp/connector.h"
13 #include "services/service_manager/public/cpp/interface_registry.h"
14 #include "services/service_manager/public/cpp/service_context.h"
13 #include "services/ui/public/cpp/property_type_converters.h" 15 #include "services/ui/public/cpp/property_type_converters.h"
14 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" 16 #include "services/ui/public/interfaces/window_manager_constants.mojom.h"
15 #include "ui/views/mus/aura_init.h" 17 #include "ui/views/mus/aura_init.h"
16 #include "ui/views/mus/native_widget_mus.h" 18 #include "ui/views/mus/native_widget_mus.h"
17 #include "ui/views/mus/pointer_watcher_event_router.h" 19 #include "ui/views/mus/pointer_watcher_event_router.h"
18 #include "ui/views/mus/window_manager_connection.h" 20 #include "ui/views/mus/window_manager_connection.h"
19 #include "ui/views/pointer_watcher.h" 21 #include "ui/views/pointer_watcher.h"
20 #include "ui/views/widget/widget.h" 22 #include "ui/views/widget/widget.h"
21 #include "ui/views/widget/widget_delegate.h" 23 #include "ui/views/widget/widget_delegate.h"
22 24
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 60
59 views::WindowManagerConnection* window_manager_connection_; 61 views::WindowManagerConnection* window_manager_connection_;
60 TouchHudRenderer* touch_hud_renderer_; 62 TouchHudRenderer* touch_hud_renderer_;
61 63
62 DISALLOW_COPY_AND_ASSIGN(TouchHudUI); 64 DISALLOW_COPY_AND_ASSIGN(TouchHudUI);
63 }; 65 };
64 66
65 TouchHudApplication::TouchHudApplication() : binding_(this) {} 67 TouchHudApplication::TouchHudApplication() : binding_(this) {}
66 TouchHudApplication::~TouchHudApplication() {} 68 TouchHudApplication::~TouchHudApplication() {}
67 69
68 void TouchHudApplication::OnStart(const service_manager::ServiceInfo& info) { 70 void TouchHudApplication::OnStart(service_manager::ServiceContext* context) {
69 aura_init_ = base::MakeUnique<views::AuraInit>(connector(), info.identity, 71 aura_init_ = base::MakeUnique<views::AuraInit>(
70 "views_mus_resources.pak"); 72 context->connector(), context->identity(), "views_mus_resources.pak");
71 window_manager_connection_ = 73 window_manager_connection_ = views::WindowManagerConnection::Create(
72 views::WindowManagerConnection::Create(connector(), info.identity); 74 context->connector(), context->identity());
73 } 75 }
74 76
75 bool TouchHudApplication::OnConnect( 77 bool TouchHudApplication::OnConnect(
76 const service_manager::ServiceInfo& remote_info, 78 const service_manager::ServiceInfo& remote_info,
77 service_manager::InterfaceRegistry* registry) { 79 service_manager::InterfaceRegistry* registry) {
78 registry->AddInterface<mash::mojom::Launchable>(this); 80 registry->AddInterface<mash::mojom::Launchable>(this);
79 return true; 81 return true;
80 } 82 }
81 83
82 void TouchHudApplication::Launch(uint32_t what, mash::mojom::LaunchMode how) { 84 void TouchHudApplication::Launch(uint32_t what, mash::mojom::LaunchMode how) {
(...skipping 27 matching lines...) Expand all
110 112
111 void TouchHudApplication::Create( 113 void TouchHudApplication::Create(
112 const service_manager::Identity& remote_identity, 114 const service_manager::Identity& remote_identity,
113 mash::mojom::LaunchableRequest request) { 115 mash::mojom::LaunchableRequest request) {
114 binding_.Close(); 116 binding_.Close();
115 binding_.Bind(std::move(request)); 117 binding_.Bind(std::move(request));
116 } 118 }
117 119
118 } // namespace touch_hud 120 } // namespace touch_hud
119 } // namespace ash 121 } // namespace ash
OLDNEW
« no previous file with comments | « ash/touch_hud/mus/touch_hud_application.h ('k') | chrome/app/mash/mash_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698