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

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

Issue 1610813003: Merge arc/common/settings.mojom into intent_helper.mojom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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/common/intent_helper.mojom » ('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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 if (ime_instance()) 62 if (ime_instance())
63 observer->OnImeInstanceReady(); 63 observer->OnImeInstanceReady();
64 if (input_instance()) 64 if (input_instance())
65 observer->OnInputInstanceReady(); 65 observer->OnInputInstanceReady();
66 if (notifications_instance()) 66 if (notifications_instance())
67 observer->OnNotificationsInstanceReady(); 67 observer->OnNotificationsInstanceReady();
68 if (power_instance()) 68 if (power_instance())
69 observer->OnPowerInstanceReady(); 69 observer->OnPowerInstanceReady();
70 if (process_instance()) 70 if (process_instance())
71 observer->OnProcessInstanceReady(); 71 observer->OnProcessInstanceReady();
72 if (settings_instance())
73 observer->OnSettingsInstanceReady();
74 if (video_instance()) 72 if (video_instance())
75 observer->OnVideoInstanceReady(); 73 observer->OnVideoInstanceReady();
76 } 74 }
77 75
78 void ArcBridgeService::RemoveObserver(Observer* observer) { 76 void ArcBridgeService::RemoveObserver(Observer* observer) {
79 DCHECK(CalledOnValidThread()); 77 DCHECK(CalledOnValidThread());
80 observer_list_.RemoveObserver(observer); 78 observer_list_.RemoveObserver(observer);
81 } 79 }
82 80
83 void ArcBridgeService::OnAppInstanceReady(AppInstancePtr app_ptr) { 81 void ArcBridgeService::OnAppInstanceReady(AppInstancePtr app_ptr) {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 DCHECK(CalledOnValidThread()); 295 DCHECK(CalledOnValidThread());
298 if (!process_ptr_) 296 if (!process_ptr_)
299 return; 297 return;
300 298
301 process_ptr_.reset(); 299 process_ptr_.reset();
302 FOR_EACH_OBSERVER(Observer, observer_list(), OnProcessInstanceClosed()); 300 FOR_EACH_OBSERVER(Observer, observer_list(), OnProcessInstanceClosed());
303 } 301 }
304 302
305 void ArcBridgeService::OnSettingsInstanceReady( 303 void ArcBridgeService::OnSettingsInstanceReady(
306 SettingsInstancePtr settings_ptr) { 304 SettingsInstancePtr settings_ptr) {
307 DCHECK(CalledOnValidThread()); 305 // Obsolete interface.
308 temporary_settings_ptr_ = std::move(settings_ptr);
309 temporary_settings_ptr_.QueryVersion(base::Bind(
310 &ArcBridgeService::OnSettingsVersionReady, weak_factory_.GetWeakPtr()));
311 }
312
313 void ArcBridgeService::OnSettingsVersionReady(int32_t version) {
314 DCHECK(CalledOnValidThread());
315 settings_ptr_ = std::move(temporary_settings_ptr_);
316 settings_ptr_.set_connection_error_handler(base::Bind(
317 &ArcBridgeService::CloseSettingsChannel, weak_factory_.GetWeakPtr()));
318 FOR_EACH_OBSERVER(Observer, observer_list(), OnSettingsInstanceReady());
319 }
320
321 void ArcBridgeService::CloseSettingsChannel() {
322 DCHECK(CalledOnValidThread());
323 if (!settings_ptr_)
324 return;
325
326 settings_ptr_.reset();
327 FOR_EACH_OBSERVER(Observer, observer_list(), OnSettingsInstanceClosed());
328 } 306 }
329 307
330 void ArcBridgeService::OnVideoInstanceReady(VideoInstancePtr video_ptr) { 308 void ArcBridgeService::OnVideoInstanceReady(VideoInstancePtr video_ptr) {
331 DCHECK(CalledOnValidThread()); 309 DCHECK(CalledOnValidThread());
332 temporary_video_ptr_ = std::move(video_ptr); 310 temporary_video_ptr_ = std::move(video_ptr);
333 temporary_video_ptr_.QueryVersion(base::Bind( 311 temporary_video_ptr_.QueryVersion(base::Bind(
334 &ArcBridgeService::OnVideoVersionReady, weak_factory_.GetWeakPtr())); 312 &ArcBridgeService::OnVideoVersionReady, weak_factory_.GetWeakPtr()));
335 } 313 }
336 314
337 void ArcBridgeService::OnVideoVersionReady(int32_t version) { 315 void ArcBridgeService::OnVideoVersionReady(int32_t version) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 // and notify any observers that the channel is closed. 353 // and notify any observers that the channel is closed.
376 CloseAppChannel(); 354 CloseAppChannel();
377 CloseAuthChannel(); 355 CloseAuthChannel();
378 CloseClipboardChannel(); 356 CloseClipboardChannel();
379 CloseImeChannel(); 357 CloseImeChannel();
380 CloseInputChannel(); 358 CloseInputChannel();
381 CloseIntentHelperChannel(); 359 CloseIntentHelperChannel();
382 CloseNotificationsChannel(); 360 CloseNotificationsChannel();
383 ClosePowerChannel(); 361 ClosePowerChannel();
384 CloseProcessChannel(); 362 CloseProcessChannel();
385 CloseSettingsChannel();
386 CloseVideoChannel(); 363 CloseVideoChannel();
387 } 364 }
388 365
389 } // namespace arc 366 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/arc_bridge_service.h ('k') | components/arc/common/intent_helper.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698