OLD | NEW |
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 | 8 |
9 #include "ash/common/new_window_controller.h" | 9 #include "ash/common/new_window_controller.h" |
10 #include "ash/common/shell_delegate.h" | 10 #include "ash/common/shell_delegate.h" |
11 #include "ash/common/wallpaper/wallpaper_controller.h" | 11 #include "ash/common/wallpaper/wallpaper_controller.h" |
12 #include "ash/common/wm_shell.h" | 12 #include "ash/common/wm_shell.h" |
13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "components/arc/arc_bridge_service.h" | 16 #include "components/arc/arc_bridge_service.h" |
17 #include "components/arc/arc_service_manager.h" | 17 #include "components/arc/arc_service_manager.h" |
18 #include "components/arc/intent_helper/activity_icon_loader.h" | 18 #include "components/arc/intent_helper/activity_icon_loader.h" |
19 #include "components/arc/intent_helper/link_handler_model_impl.h" | 19 #include "components/arc/intent_helper/link_handler_model_impl.h" |
20 #include "components/arc/intent_helper/local_activity_resolver.h" | 20 #include "components/arc/intent_helper/local_activity_resolver.h" |
21 #include "ui/base/layout.h" | 21 #include "ui/base/layout.h" |
22 #include "url/gurl.h" | 22 #include "url/gurl.h" |
23 | 23 |
24 namespace arc { | 24 namespace arc { |
25 | 25 |
26 // static | 26 // static |
| 27 const char ArcIntentHelperBridge::kArcServiceName[] = |
| 28 "arc::ArcIntentHelperBridge"; |
| 29 |
| 30 // static |
27 const char ArcIntentHelperBridge::kArcIntentHelperPackageName[] = | 31 const char ArcIntentHelperBridge::kArcIntentHelperPackageName[] = |
28 "org.chromium.arc.intent_helper"; | 32 "org.chromium.arc.intent_helper"; |
29 | 33 |
30 ArcIntentHelperBridge::ArcIntentHelperBridge( | 34 ArcIntentHelperBridge::ArcIntentHelperBridge( |
31 ArcBridgeService* bridge_service, | 35 ArcBridgeService* bridge_service, |
32 const scoped_refptr<ActivityIconLoader>& icon_loader, | 36 const scoped_refptr<ActivityIconLoader>& icon_loader, |
33 const scoped_refptr<LocalActivityResolver>& activity_resolver) | 37 const scoped_refptr<LocalActivityResolver>& activity_resolver) |
34 : ArcService(bridge_service), | 38 : ArcService(bridge_service), |
35 binding_(this), | 39 binding_(this), |
36 icon_loader_(icon_loader), | 40 icon_loader_(icon_loader), |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 if (!intent_helper_holder->has_instance()) { | 150 if (!intent_helper_holder->has_instance()) { |
147 VLOG(2) << "ARC intent helper instance is not ready."; | 151 VLOG(2) << "ARC intent helper instance is not ready."; |
148 if (out_error_code) | 152 if (out_error_code) |
149 *out_error_code = GetResult::FAILED_ARC_NOT_READY; | 153 *out_error_code = GetResult::FAILED_ARC_NOT_READY; |
150 return false; | 154 return false; |
151 } | 155 } |
152 | 156 |
153 return true; | 157 return true; |
154 } | 158 } |
155 | 159 |
| 160 // static |
| 161 ArcIntentHelperBridge* ArcIntentHelperBridge::Get( |
| 162 ArcServiceManager* service_manager) { |
| 163 if (!service_manager) |
| 164 return nullptr; |
| 165 return service_manager->GetService<ArcIntentHelperBridge>(); |
| 166 } |
| 167 |
156 void ArcIntentHelperBridge::OnIntentFiltersUpdated( | 168 void ArcIntentHelperBridge::OnIntentFiltersUpdated( |
157 std::vector<IntentFilter> filters) { | 169 std::vector<IntentFilter> filters) { |
158 DCHECK(thread_checker_.CalledOnValidThread()); | 170 DCHECK(thread_checker_.CalledOnValidThread()); |
159 activity_resolver_->UpdateIntentFilters(std::move(filters)); | 171 activity_resolver_->UpdateIntentFilters(std::move(filters)); |
160 | 172 |
161 for (auto& observer : observer_list_) | 173 for (auto& observer : observer_list_) |
162 observer.OnIntentFiltersUpdated(); | 174 observer.OnIntentFiltersUpdated(); |
163 } | 175 } |
164 | 176 |
165 } // namespace arc | 177 } // namespace arc |
OLD | NEW |