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

Unified Diff: chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.h

Issue 2478923002: Ensure that Chrome is visible in the dialog by default (Closed)
Patch Set: address review comment 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_navigation_throttle.h
diff --git a/chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.h b/chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.h
index 5678f6e72930f71daa5f256a53d1bb1fd45c9a0d..6a1ec4fd78c98d275a78f5b1603e6de64784402c 100644
--- a/chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.h
+++ b/chrome/browser/chromeos/arc/intent_helper/arc_navigation_throttle.h
@@ -91,13 +91,18 @@ class ArcNavigationThrottle : public content::NavigationThrottle {
// continued or redirected to Chrome or ARC respectively, via UMA histograms.
static void RecordUma(CloseReason close_reason, Platform platform);
+ // Swaps Chrome app with any app in row |kMaxAppResults-1| iff its index is
+ // bigger, thus ensuring the user can always see Chrome without scrolling.
+ // When swap is needed, fills |out_indices| and returns true. If |handlers|
+ // do not have Chrome, returns false.
+ static bool IsSwapElementsNeeded(
+ const mojo::Array<mojom::IntentHandlerInfoPtr>& handlers,
+ std::pair<size_t, size_t>* out_indices);
+
static bool IsAppAvailableForTesting(
const mojo::Array<mojom::IntentHandlerInfoPtr>& handlers);
static size_t FindPreferredAppForTesting(
const mojo::Array<mojom::IntentHandlerInfoPtr>& handlers);
- static bool IsSwapElementsNeededForTesting(
- const mojo::Array<mojom::IntentHandlerInfoPtr>& handlers,
- std::pair<size_t, size_t>* out_indices);
private:
// content::Navigation implementation:

Powered by Google App Engine
This is Rietveld 408576698