Store external protocol prompt exceptions per-origin

Modify the external protocol launch prompt behavior, specifically the
behavior of the checkbox that allows the user to opt out of future
prompts. Today that opt-out applies universally for a protocol, across
all origins. The new behavior is that the opt-out applies only for the
current {protocol,origin} tuple. The checkbox is only shown for
trustworthy origins, and only if the relevant group policy
is not explicitly disabled.

This change completely removes the old exceptions and does not
migrate them. These old exceptions are from a privacy/security
point of view "opt-ins", i.e. they are a relaxation of the
default security settings. Clearing the old exceptions recovers users
who had encountered the inferior version of this prompt in the past,
and gets them into a known safe state.

Bug: 1065116
Change-Id: I6c81857894ca479ac723aa642d6ed6795e204f59
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2124967
Commit-Queue: Todd Sahl <[email protected]>
Reviewed-by: Balazs Engedy <[email protected]>
Reviewed-by: Dominick Ng <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Drew Wilson <[email protected]>
Cr-Commit-Position: refs/heads/master@{#760151}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 4cea944..00ab630 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -524,6 +524,9 @@
 const char kPrintingAllowedPageSizes[] = "printing.allowed_page_sizes";
 #endif  // defined(OS_CHROMEOS)
 
+// Deprecated 4/2020
+const char kExcludedSchemes[] = "protocol_handler.excluded_schemes";
+
 // Register local state used only for migration (clearing or moving to a new
 // key).
 void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -616,6 +619,8 @@
   registry->RegisterIntegerPref(kAmbientModeTopicSource, 0);
   registry->RegisterListPref(kPrintingAllowedPageSizes);
 #endif  // defined(OS_CHROMEOS)
+
+  registry->RegisterDictionaryPref(kExcludedSchemes);
 }
 
 }  // namespace
@@ -1222,4 +1227,7 @@
   // Added 4/2020.
   profile_prefs->ClearPref(kPrintingAllowedPageSizes);
 #endif
+
+  // Added 4/2020
+  profile_prefs->ClearPref(kExcludedSchemes);
 }