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

Unified Diff: chrome/browser/chromeos/arc/arc_navigation_throttle.cc

Issue 2337193005: Consolidate 4 GetIntentHelper functions (Closed)
Patch Set: Address comments2 Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_manager/arc_file_tasks.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/arc_navigation_throttle.cc
diff --git a/chrome/browser/chromeos/arc/arc_navigation_throttle.cc b/chrome/browser/chromeos/arc/arc_navigation_throttle.cc
index bb275cc60c8c32b44ed0b2e6f5cf6d563a6aa946..db0fe5afeea4fc52dc68b96cd8b4138034dd75c5 100644
--- a/chrome/browser/chromeos/arc/arc_navigation_throttle.cc
+++ b/chrome/browser/chromeos/arc/arc_navigation_throttle.cc
@@ -31,26 +31,6 @@ scoped_refptr<ActivityIconLoader> GetIconLoader() {
return arc_service_manager ? arc_service_manager->icon_loader() : nullptr;
}
-mojom::IntentHelperInstance* GetIntentHelper() {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- ArcBridgeService* bridge_service = ArcBridgeService::Get();
- if (!bridge_service) {
- VLOG(1) << "ARC bridge is not ready.";
- return nullptr;
- }
- mojom::IntentHelperInstance* intent_helper_instance =
- bridge_service->intent_helper()->instance();
- if (!intent_helper_instance) {
- VLOG(1) << "ARC intent helper instance is not ready.";
- return nullptr;
- }
- if (bridge_service->intent_helper()->version() < kMinInstanceVersion) {
- VLOG(1) << "ARC intent helper instance is too old.";
- return nullptr;
- }
- return intent_helper_instance;
-}
-
} // namespace
ArcNavigationThrottle::ArcNavigationThrottle(
@@ -131,7 +111,8 @@ ArcNavigationThrottle::HandleRequest() {
return content::NavigationThrottle::PROCEED;
}
- mojom::IntentHelperInstance* bridge_instance = GetIntentHelper();
+ mojom::IntentHelperInstance* bridge_instance =
+ arc::ArcIntentHelperBridge::GetIntentHelperInstance(kMinInstanceVersion);
if (!bridge_instance)
return content::NavigationThrottle::PROCEED;
bridge_instance->RequestUrlHandlerList(
@@ -236,7 +217,8 @@ void ArcNavigationThrottle::OnIntentPickerClosed(
previous_user_action_ = close_reason;
- mojom::IntentHelperInstance* bridge = GetIntentHelper();
+ mojom::IntentHelperInstance* bridge =
+ arc::ArcIntentHelperBridge::GetIntentHelperInstance(kMinInstanceVersion);
if (!bridge || selected_app_index >= handlers.size()) {
close_reason = CloseReason::ERROR;
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_manager/arc_file_tasks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698