Index: chrome/browser/ui/app_list/arc/arc_app_utils.cc |
diff --git a/chrome/browser/ui/app_list/arc/arc_app_utils.cc b/chrome/browser/ui/app_list/arc/arc_app_utils.cc |
index 1589e30f076388ace68bb5a580d978c085ea8c8d..3e401b237edc00298c4828dc1815174c145f57c2 100644 |
--- a/chrome/browser/ui/app_list/arc/arc_app_utils.cc |
+++ b/chrome/browser/ui/app_list/arc/arc_app_utils.cc |
@@ -60,21 +60,8 @@ arc::mojom::AppInstance* GetAppInstance(int required_version, |
return nullptr; |
} |
- arc::mojom::AppInstance* app_instance = bridge_service->app()->instance(); |
- if (!app_instance) { |
- VLOG(2) << "Request to " << service_name |
- << " when mojom::app_instance is not ready."; |
- return nullptr; |
- } |
- |
- int bridge_version = bridge_service->app()->version(); |
- if (bridge_version < required_version) { |
- VLOG(2) << "Request to " << service_name << " when Arc version " |
- << bridge_version << " does not support it."; |
- return nullptr; |
- } |
- |
- return app_instance; |
+ return bridge_service->app()->GetInstanceForVersion(required_version, |
+ service_name.c_str()); |
} |
void PrioritizeArcInstanceCallback(bool success) { |
@@ -304,16 +291,11 @@ void ShowTalkBackSettings() { |
return; |
} |
- arc::mojom::IntentHelperInstance *intent_helper_instance = |
- bridge_service->intent_helper()->instance(); |
- if (!intent_helper_instance) { |
- VLOG(2) << "ARC intent helper instance is not ready"; |
+ auto* intent_helper_instance = |
+ bridge_service->intent_helper()->GetInstanceForVersion( |
+ kSendBroadcastMinVersion, "SendBroadcast"); |
+ if (!intent_helper_instance) |
return; |
- } |
- if (bridge_service->intent_helper()->version() < kSendBroadcastMinVersion) { |
- VLOG(2) << "ARC intent helper instance is too old"; |
- return; |
- } |
intent_helper_instance->SendBroadcast( |
"org.chromium.arc.intent_helper.SHOW_TALKBACK_SETTINGS", |