Add-a-flag-to-allow-screenshots-in-Incognito-mode.patch 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. From: csagan5 <32685696+csagan5@users.noreply.github.com>
  2. Date: Sat, 9 May 2020 08:33:15 +0200
  3. Subject: Add a flag to allow screenshots in Incognito mode
  4. See also:
  5. * https://github.com/bromite/bromite/issues/551
  6. * https://bugs.chromium.org/p/chromium/issues/detail?id=920762
  7. ---
  8. chrome/browser/about_flags.cc | 6 ++++++
  9. chrome/browser/flag_descriptions.cc | 5 +++++
  10. chrome/browser/flag_descriptions.h | 3 +++
  11. .../flags/android/java_templates/ChromeSwitches.java.tmpl | 4 ----
  12. chrome/common/chrome_switches.cc | 3 +++
  13. chrome/common/chrome_switches.h | 1 +
  14. 6 files changed, 18 insertions(+), 4 deletions(-)
  15. diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
  16. --- a/chrome/browser/about_flags.cc
  17. +++ b/chrome/browser/about_flags.cc
  18. @@ -7538,6 +7538,12 @@ const FeatureEntry kFeatureEntries[] = {
  19. "AndroidDynamicColor")},
  20. #endif // defined(OS_ANDROID)
  21. +#if defined(OS_ANDROID)
  22. + {switches::kEnableIncognitoSnapshotsInAndroidRecents, flag_descriptions::kEnableIncognitoSnapshotsInAndroidRecentsName,
  23. + flag_descriptions::kEnableIncognitoSnapshotsInAndroidRecentsDescription, kOsAndroid,
  24. + SINGLE_VALUE_TYPE(switches::kEnableIncognitoSnapshotsInAndroidRecents)},
  25. +#endif
  26. +
  27. #if defined(OS_WIN)
  28. {"win-10-tab-search-caption-button",
  29. flag_descriptions::kWin10TabSearchCaptionButtonName,
  30. diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
  31. --- a/chrome/browser/flag_descriptions.cc
  32. +++ b/chrome/browser/flag_descriptions.cc
  33. @@ -712,6 +712,11 @@ const char kEnableAutofillCreditCardAuthenticationDescription[] =
  34. "authenticator (if available) to verify card ownership when retrieving "
  35. "credit cards from Google Payments.";
  36. +const char kEnableIncognitoSnapshotsInAndroidRecentsName[] =
  37. + "Enable Incognito snapshots in Android Recents";
  38. +const char kEnableIncognitoSnapshotsInAndroidRecentsDescription[] =
  39. + "Enable the secure flag for Incognito tabs which prevent taking screenshots and seeing snapshots in Android Recents.";
  40. +
  41. const char
  42. kEnableAutofillInfoBarAccountIndicationFooterForSingleAccountUsersName[] =
  43. "Display InfoBar footers with account indication information for "
  44. diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
  45. --- a/chrome/browser/flag_descriptions.h
  46. +++ b/chrome/browser/flag_descriptions.h
  47. @@ -446,6 +446,9 @@ extern const char kEnableAutofillSaveCardInfoBarAccountIndicationFooterName[];
  48. extern const char
  49. kEnableAutofillSaveCardInfoBarAccountIndicationFooterDescription[];
  50. +extern const char kEnableIncognitoSnapshotsInAndroidRecentsName[];
  51. +extern const char kEnableIncognitoSnapshotsInAndroidRecentsDescription[];
  52. +
  53. extern const char kEnableExperimentalCookieFeaturesName[];
  54. extern const char kEnableExperimentalCookieFeaturesDescription[];
  55. diff --git a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl b/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
  56. --- a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
  57. +++ b/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
  58. @@ -123,10 +123,6 @@ public abstract class ChromeSwitches {{
  59. /** Switch for enabling the Chrome Survey. Only works when UMA is accepted. */
  60. public static final String CHROME_FORCE_ENABLE_SURVEY = "force-enable-chrome-survey";
  61. - /** Switch to enable incognito tabs to be seen in Android Recents. */
  62. - public static final String ENABLE_INCOGNITO_SNAPSHOTS_IN_ANDROID_RECENTS =
  63. - "enable-incognito-snapshots-in-android-recents";
  64. -
  65. /** Open all custom tabs in a new task. Used only for experimental purposes. */
  66. public static final String OPEN_CUSTOM_TABS_IN_NEW_TASK = "open-custom-tabs-in-new-task";
  67. diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
  68. --- a/chrome/common/chrome_switches.cc
  69. +++ b/chrome/common/chrome_switches.cc
  70. @@ -335,6 +335,9 @@ const char kHomePage[] = "homepage";
  71. // Causes the browser to launch directly in incognito mode.
  72. const char kIncognito[] = "incognito";
  73. +// Allows incognito tabs to be seen in Android Recents and thus user screenshots.
  74. +const char kEnableIncognitoSnapshotsInAndroidRecents[] = "enable-incognito-snapshots-in-android-recents";
  75. +
  76. // Installs an autogenerated theme based on the given RGB value.
  77. // The format is "r,g,b", where r, g, b are a numeric values from 0 to 255.
  78. const char kInstallAutogeneratedTheme[] = "install-autogenerated-theme";
  79. diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
  80. --- a/chrome/common/chrome_switches.h
  81. +++ b/chrome/common/chrome_switches.h
  82. @@ -110,6 +110,7 @@ extern const char kForceStackedTabStripLayout[];
  83. extern const char kHideCrashRestoreBubble[];
  84. extern const char kHomePage[];
  85. extern const char kIncognito[];
  86. +extern const char kEnableIncognitoSnapshotsInAndroidRecents[];
  87. extern const char kInstallAutogeneratedTheme[];
  88. extern const char kInstallChromeApp[];
  89. extern const char kInstantProcess[];
  90. --
  91. 2.20.1