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

Side by Side Diff: components/arc/arc_bridge_service.cc

Issue 1590723003: Host-side implementation of ARC Intent handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Support new GURL interface at https://chromium.googlesource.com/chromium/src/+/dfbcc3b7926990bbf523… Created 4 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 | « components/arc/arc_bridge_service.h ('k') | components/arc/arc_service_manager.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/arc/arc_bridge_service.h" 5 #include "components/arc/arc_bridge_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 void ArcBridgeService::CloseInputChannel() { 171 void ArcBridgeService::CloseInputChannel() {
172 DCHECK(CalledOnValidThread()); 172 DCHECK(CalledOnValidThread());
173 if (!input_ptr_) 173 if (!input_ptr_)
174 return; 174 return;
175 175
176 input_ptr_.reset(); 176 input_ptr_.reset();
177 FOR_EACH_OBSERVER(Observer, observer_list(), OnInputInstanceClosed()); 177 FOR_EACH_OBSERVER(Observer, observer_list(), OnInputInstanceClosed());
178 } 178 }
179 179
180 void ArcBridgeService::OnIntentHelperInstanceReady(
181 IntentHelperInstancePtr intent_helper_ptr) {
182 DCHECK(CalledOnValidThread());
183 temporary_intent_helper_ptr_ = std::move(intent_helper_ptr);
184 temporary_intent_helper_ptr_.QueryVersion(
185 base::Bind(&ArcBridgeService::OnIntentHelperVersionReady,
186 weak_factory_.GetWeakPtr()));
187 }
188
189 void ArcBridgeService::OnIntentHelperVersionReady(int32_t version) {
190 DCHECK(CalledOnValidThread());
191 intent_helper_ptr_ = std::move(temporary_intent_helper_ptr_);
192 intent_helper_ptr_.set_connection_error_handler(base::Bind(
193 &ArcBridgeService::CloseIntentHelperChannel, weak_factory_.GetWeakPtr()));
194 FOR_EACH_OBSERVER(Observer, observer_list(), OnIntentHelperInstanceReady());
195 }
196
197 void ArcBridgeService::CloseIntentHelperChannel() {
198 DCHECK(CalledOnValidThread());
199 if (!intent_helper_ptr_)
200 return;
201
202 intent_helper_ptr_.reset();
203 FOR_EACH_OBSERVER(Observer, observer_list(), OnIntentHelperInstanceClosed());
204 }
205
180 void ArcBridgeService::OnNotificationsInstanceReady( 206 void ArcBridgeService::OnNotificationsInstanceReady(
181 NotificationsInstancePtr notifications_ptr) { 207 NotificationsInstancePtr notifications_ptr) {
182 DCHECK(CalledOnValidThread()); 208 DCHECK(CalledOnValidThread());
183 temporary_notifications_ptr_ = std::move(notifications_ptr); 209 temporary_notifications_ptr_ = std::move(notifications_ptr);
184 temporary_notifications_ptr_.QueryVersion( 210 temporary_notifications_ptr_.QueryVersion(
185 base::Bind(&ArcBridgeService::OnNotificationsVersionReady, 211 base::Bind(&ArcBridgeService::OnNotificationsVersionReady,
186 weak_factory_.GetWeakPtr())); 212 weak_factory_.GetWeakPtr()));
187 } 213 }
188 214
189 void ArcBridgeService::OnNotificationsVersionReady(int32_t version) { 215 void ArcBridgeService::OnNotificationsVersionReady(int32_t version) {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 } 347 }
322 348
323 void ArcBridgeService::CloseAllChannels() { 349 void ArcBridgeService::CloseAllChannels() {
324 // Call all the error handlers of all the channels to both close the channel 350 // Call all the error handlers of all the channels to both close the channel
325 // and notify any observers that the channel is closed. 351 // and notify any observers that the channel is closed.
326 CloseAppChannel(); 352 CloseAppChannel();
327 CloseAuthChannel(); 353 CloseAuthChannel();
328 CloseClipboardChannel(); 354 CloseClipboardChannel();
329 CloseImeChannel(); 355 CloseImeChannel();
330 CloseInputChannel(); 356 CloseInputChannel();
357 CloseIntentHelperChannel();
331 CloseNotificationsChannel(); 358 CloseNotificationsChannel();
332 ClosePowerChannel(); 359 ClosePowerChannel();
333 CloseProcessChannel(); 360 CloseProcessChannel();
334 CloseSettingsChannel(); 361 CloseSettingsChannel();
335 CloseVideoChannel(); 362 CloseVideoChannel();
336 } 363 }
337 364
338 } // namespace arc 365 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/arc_bridge_service.h ('k') | components/arc/arc_service_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698