Chromium Code Reviews| 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); |