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

Unified Diff: chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog.cc

Issue 2655233007: Get rid of RefCounted for ActivityIconLoader. (Closed)
Patch Set: Created 3 years, 11 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
Index: chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog.cc
diff --git a/chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog.cc b/chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog.cc
index 21a2c15ec965cfe66892a7ae6e48745ff5063e36..0e92a48816a2cb559f44f937a0205d66b447207a 100644
--- a/chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog.cc
+++ b/chrome/browser/chromeos/arc/intent_helper/arc_external_protocol_dialog.cc
@@ -48,12 +48,6 @@ void ShowFallbackExternalProtocolDialog(int render_process_host_id,
new ExternalProtocolDialog(web_contents, url);
}
-scoped_refptr<ActivityIconLoader> GetIconLoader() {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- ArcServiceManager* arc_service_manager = ArcServiceManager::Get();
- return arc_service_manager ? arc_service_manager->icon_loader() : nullptr;
-}
-
void CloseTabIfNeeded(int render_process_host_id, int routing_id) {
WebContents* web_contents =
tab_util::GetWebContentsByID(render_process_host_id, routing_id);
@@ -372,9 +366,9 @@ void OnUrlHandlerList(int render_process_host_id,
auto* instance = ARC_GET_INSTANCE_FOR_METHOD(
arc_service_manager->arc_bridge_service()->intent_helper(), HandleUrl);
- scoped_refptr<ActivityIconLoader> icon_loader = GetIconLoader();
-
- if (!instance || !icon_loader) {
+ auto* intent_helper_bridge =
+ ArcServiceManager::GetGlobalService<ArcIntentHelperBridge>();
+ if (!instance || !intent_helper_bridge) {
// ARC is not running anymore. Show the Chrome OS dialog.
ShowFallbackExternalProtocolDialog(render_process_host_id, routing_id, url);
return;
@@ -405,7 +399,7 @@ void OnUrlHandlerList(int render_process_host_id,
for (const auto& handler : handlers) {
activities.emplace_back(handler->package_name, handler->activity_name);
}
- icon_loader->GetActivityIcons(
+ intent_helper_bridge->icon_loader()->GetActivityIcons(
activities, base::Bind(OnAppIconsReceived, render_process_host_id,
routing_id, url, base::Passed(&handlers)));
}

Powered by Google App Engine
This is Rietveld 408576698