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

Side by Side Diff: components/arc/intent_helper/arc_intent_helper_bridge.cc

Issue 2133503002: arc: Revamp the ArcBridgeService interface (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: more rebase Created 4 years, 5 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
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 "components/arc/intent_helper/arc_intent_helper_bridge.h" 5 #include "components/arc/intent_helper/arc_intent_helper_bridge.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/shell_delegate.h" 10 #include "ash/common/shell_delegate.h"
(...skipping 21 matching lines...) Expand all
32 ArcBridgeService* bridge_service, 32 ArcBridgeService* bridge_service,
33 const scoped_refptr<ActivityIconLoader>& icon_loader, 33 const scoped_refptr<ActivityIconLoader>& icon_loader,
34 std::unique_ptr<SetWallpaperDelegate> set_wallpaper_delegate, 34 std::unique_ptr<SetWallpaperDelegate> set_wallpaper_delegate,
35 const scoped_refptr<LocalActivityResolver>& activity_resolver) 35 const scoped_refptr<LocalActivityResolver>& activity_resolver)
36 : ArcService(bridge_service), 36 : ArcService(bridge_service),
37 binding_(this), 37 binding_(this),
38 icon_loader_(icon_loader), 38 icon_loader_(icon_loader),
39 set_wallpaper_delegate_(std::move(set_wallpaper_delegate)), 39 set_wallpaper_delegate_(std::move(set_wallpaper_delegate)),
40 activity_resolver_(activity_resolver) { 40 activity_resolver_(activity_resolver) {
41 DCHECK(thread_checker_.CalledOnValidThread()); 41 DCHECK(thread_checker_.CalledOnValidThread());
42 arc_bridge_service()->AddObserver(this); 42 arc_bridge_service()->intent_helper()->AddObserver(this);
43 } 43 }
44 44
45 ArcIntentHelperBridge::~ArcIntentHelperBridge() { 45 ArcIntentHelperBridge::~ArcIntentHelperBridge() {
46 DCHECK(thread_checker_.CalledOnValidThread()); 46 DCHECK(thread_checker_.CalledOnValidThread());
47 arc_bridge_service()->RemoveObserver(this); 47 arc_bridge_service()->intent_helper()->RemoveObserver(this);
48 } 48 }
49 49
50 void ArcIntentHelperBridge::OnIntentHelperInstanceReady() { 50 void ArcIntentHelperBridge::OnInstanceReady(
51 mojom::IntentHelperInstance* intent_helper_instance,
52 uint32_t version) {
51 DCHECK(thread_checker_.CalledOnValidThread()); 53 DCHECK(thread_checker_.CalledOnValidThread());
52 ash::Shell::GetInstance()->set_link_handler_model_factory(this); 54 ash::Shell::GetInstance()->set_link_handler_model_factory(this);
53 arc_bridge_service()->intent_helper_instance()->Init( 55 intent_helper_instance->Init(binding_.CreateInterfacePtrAndBind());
54 binding_.CreateInterfacePtrAndBind());
55 } 56 }
56 57
57 void ArcIntentHelperBridge::OnIntentHelperInstanceClosed() { 58 void ArcIntentHelperBridge::OnInstanceClosed(mojom::IntentHelperInstance*) {
58 DCHECK(thread_checker_.CalledOnValidThread()); 59 DCHECK(thread_checker_.CalledOnValidThread());
59 ash::Shell::GetInstance()->set_link_handler_model_factory(nullptr); 60 ash::Shell::GetInstance()->set_link_handler_model_factory(nullptr);
60 } 61 }
61 62
62 void ArcIntentHelperBridge::OnIconInvalidated( 63 void ArcIntentHelperBridge::OnIconInvalidated(
63 const mojo::String& package_name) { 64 const mojo::String& package_name) {
64 DCHECK(thread_checker_.CalledOnValidThread()); 65 DCHECK(thread_checker_.CalledOnValidThread());
65 icon_loader_->InvalidateIcons(package_name); 66 icon_loader_->InvalidateIcons(package_name);
66 } 67 }
67 68
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 return handlers_filtered; 120 return handlers_filtered;
120 } 121 }
121 122
122 void ArcIntentHelperBridge::OnIntentFiltersUpdated( 123 void ArcIntentHelperBridge::OnIntentFiltersUpdated(
123 mojo::Array<mojom::IntentFilterPtr> filters) { 124 mojo::Array<mojom::IntentFilterPtr> filters) {
124 DCHECK(thread_checker_.CalledOnValidThread()); 125 DCHECK(thread_checker_.CalledOnValidThread());
125 activity_resolver_->UpdateIntentFilters(std::move(filters)); 126 activity_resolver_->UpdateIntentFilters(std::move(filters));
126 } 127 }
127 128
128 } // namespace arc 129 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698