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

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

Issue 2133503002: arc: Revamp the ArcBridgeService interface (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: More rebasing 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/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
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
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
OLDNEW
« no previous file with comments | « components/arc/intent_helper/arc_intent_helper_bridge.cc ('k') | components/arc/metrics/arc_metrics_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698