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

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

Issue 2478923002: Ensure that Chrome is visible in the dialog by default (Closed)
Patch Set: review Created 4 years, 1 month 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 f49f39f6e5b238741031a5bb3addcbba703ad0c2..020554ff137b3a0325c4be743993566b43ca148b 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
@@ -329,7 +329,15 @@ void OnUrlHandlerList(int render_process_host_id,
return; // the |url| has been handled.
}
- // Otherwise, retrieve icons of the activities.
+ // Otherwise, retrieve icons of the activities. First, swap |handler| elements
+ // to ensure Chrome is not visible in the UI by defalult. Since This function
djacobo_ 2016/11/05 04:49:21 "to ensure Chrome IS visible..." , right?
Yusuke Sato 2016/11/07 17:11:36 oops, good catch. Fixed.
+ // is for handling external protocols, Chrome is rarely in the list, but if
+ // the |url| is intent: with fallback or geo:, for example, it may be.
+ std::pair<size_t, size_t> indices;
+ if (ArcNavigationThrottle::IsSwapElementsNeeded(handlers, &indices))
+ std::swap(handlers[indices.first], handlers[indices.second]);
+
+ // Then request the icons.
std::vector<ActivityIconLoader::ActivityName> activities;
for (const auto& handler : handlers) {
activities.emplace_back(handler->package_name, handler->activity_name);

Powered by Google App Engine
This is Rietveld 408576698