Skip to content

Commit

Permalink
Use CachedFeatureFlag for ChromeFeatureList.CCT_INCOGNITO.
Browse files Browse the repository at this point in the history
Merge approved at crbug.com/1184667#c5

This CL makes use of CachedFeatureFlag instead of relying directly on
ChromeFeatureList as it may require native to be initialised.

This would help 3P apps launch incognito CCT without the need of
having an active custom tab connection. 3P apps can open Incognito CCT
by enabling the ChromeFeatureList.CCT_INCOGNITO_AVAILABLE_TO_THIRD_PARTY
flag which is disabled by default.


(cherry picked from commit 454d959)

Bug: 1184667
Change-Id: Iaa014aab95c10586d8e7b2cce7457cce3f5a115b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2735494
Reviewed-by: Peter Conn <peconn@chromium.org>
Reviewed-by: Theresa  <twellington@chromium.org>
Reviewed-by: Ramin Halavati <rhalavati@chromium.org>
Commit-Queue: Rohit Agarwal <roagarwal@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#860198}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2741122
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/branch-heads/4430@{#220}
Cr-Branched-From: e5ce7dc-refs/heads/master@{#857950}
  • Loading branch information
Rohit Agarwal authored and Chromium LUCI CQ committed Mar 8, 2021
1 parent 16d3600 commit 2380c82
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public void cacheNativeFlags() {
ChromeFeatureList.ADAPTIVE_BUTTON_IN_TOP_TOOLBAR,
ChromeFeatureList.ANDROID_MANAGED_BY_MENU_ITEM,
ChromeFeatureList.ANDROID_PARTNER_CUSTOMIZATION_PHENOTYPE,
ChromeFeatureList.CCT_INCOGNITO,
ChromeFeatureList.CCT_INCOGNITO_AVAILABLE_TO_THIRD_PARTY,
ChromeFeatureList.CCT_REMOVE_REMOTE_VIEW_IDS,
ChromeFeatureList.CHROME_STARTUP_DELEGATE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ public static boolean isValidIncognitoIntent(Intent intent) {
return true;
}
if (!isTrustedIntent(intent)) return false;
assert ChromeFeatureList.isInitialized();
return ChromeFeatureList.isEnabled(ChromeFeatureList.CCT_INCOGNITO);
return CachedFeatureFlags.isEnabled(ChromeFeatureList.CCT_INCOGNITO);
}

private String resolveUrlToLoad(Intent intent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public class CachedFeatureFlags {
put(ChromeFeatureList.READ_LATER, false);
put(ChromeFeatureList.CCT_REMOVE_REMOTE_VIEW_IDS, true);
put(ChromeFeatureList.OFFLINE_MEASUREMENTS_BACKGROUND_TASK, false);
put(ChromeFeatureList.CCT_INCOGNITO, true);
}
};

Expand Down

0 comments on commit 2380c82

Please sign in to comment.