Add support to chrome://flags for command line flags that need to be treated as a list of origins
This CL adds support for command line flags that are lists of url::Origins. E.g. The value in --flag=value will now be modifyable from the chrome://flags page using a free form textbox, and will be treated as a comma separated list of origins (e.g. http://example1.test,http://example2.test)
The string from the textbox is transformed as follows:
- Continuous whitespace characters are collapsed into single a space
- String is tokenized using space and comma as delimiters
- Each token is parsed as a GURL. Invalid URLs or URLs with a scheme other than http and https are discarded.
- Remaining URLs are converted to url::Origins, then joined into a single, comma separated string.
The CL also adds --unsafely-treat-insecure-origin-as-secure as the first such flag to chrome://flags. Developers will now be able to modify the list of insecure origins treated as secure from the chrome://flags page on all platforms.
Bug: 834381
Change-Id: Iad44b5b2724687c7bea1ae45c23ccc910eb5cc9f
Reviewed-on: https://chromium-review.googlesource.com/1038152
Reviewed-by: Lei Zhang <[email protected]>
Reviewed-by: Mattias Nissler <[email protected]>
Reviewed-by: Mike West <[email protected]>
Reviewed-by: Edward Jung <[email protected]>
Reviewed-by: Alexei Svitkine <[email protected]>
Commit-Queue: Mustafa Emre Acer <[email protected]>
Cr-Commit-Position: refs/heads/master@{#560791}
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 82e23c59..e264c03 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -1043,6 +1043,9 @@
extern const char kTranslateRankerEnforcementName[];
extern const char kTranslateRankerEnforcementDescription[];
+extern const char kTreatInsecureOriginAsSecureName[];
+extern const char kTreatInsecureOriginAsSecureDescription[];
+
extern const char kTrySupportedChannelLayoutsName[];
extern const char kTrySupportedChannelLayoutsDescription[];