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/link_handler_model_impl.h" | 5 #include "components/arc/intent_helper/link_handler_model_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 handlers_[handler_id]->package_name); | 86 handlers_[handler_id]->package_name); |
87 } | 87 } |
88 | 88 |
89 mojom::IntentHelperInstance* LinkHandlerModelImpl::GetIntentHelper() { | 89 mojom::IntentHelperInstance* LinkHandlerModelImpl::GetIntentHelper() { |
90 ArcBridgeService* bridge_service = arc::ArcBridgeService::Get(); | 90 ArcBridgeService* bridge_service = arc::ArcBridgeService::Get(); |
91 if (!bridge_service) { | 91 if (!bridge_service) { |
92 DLOG(WARNING) << "ARC bridge is not ready."; | 92 DLOG(WARNING) << "ARC bridge is not ready."; |
93 return nullptr; | 93 return nullptr; |
94 } | 94 } |
95 mojom::IntentHelperInstance* intent_helper_instance = | 95 mojom::IntentHelperInstance* intent_helper_instance = |
96 bridge_service->intent_helper_instance(); | 96 bridge_service->intent_helper()->instance(); |
97 if (!intent_helper_instance) { | 97 if (!intent_helper_instance) { |
98 DLOG(WARNING) << "ARC intent helper instance is not ready."; | 98 DLOG(WARNING) << "ARC intent helper instance is not ready."; |
99 return nullptr; | 99 return nullptr; |
100 } | 100 } |
101 if (bridge_service->intent_helper_version() < kMinInstanceVersion) { | 101 if (bridge_service->intent_helper()->version() < kMinInstanceVersion) { |
102 DLOG(WARNING) << "ARC intent helper instance is too old."; | 102 DLOG(WARNING) << "ARC intent helper instance is too old."; |
103 return nullptr; | 103 return nullptr; |
104 } | 104 } |
105 return intent_helper_instance; | 105 return intent_helper_instance; |
106 } | 106 } |
107 | 107 |
108 void LinkHandlerModelImpl::OnUrlHandlerList( | 108 void LinkHandlerModelImpl::OnUrlHandlerList( |
109 mojo::Array<mojom::UrlHandlerInfoPtr> handlers) { | 109 mojo::Array<mojom::UrlHandlerInfoPtr> handlers) { |
110 handlers_ = ArcIntentHelperBridge::FilterOutIntentHelper(std::move(handlers)); | 110 handlers_ = ArcIntentHelperBridge::FilterOutIntentHelper(std::move(handlers)); |
111 | 111 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 if (!GetQueryValue(url, kKeyToFind, &value)) | 174 if (!GetQueryValue(url, kKeyToFind, &value)) |
175 return url; | 175 return url; |
176 | 176 |
177 const GURL new_url(value); | 177 const GURL new_url(value); |
178 if (!new_url.is_valid()) | 178 if (!new_url.is_valid()) |
179 return url; | 179 return url; |
180 return new_url; | 180 return new_url; |
181 } | 181 } |
182 | 182 |
183 } // namespace arc | 183 } // namespace arc |
OLD | NEW |