[Reland] Clean up chrome_switches.{h,cc} and move to lib "non_code_constants"
This is a reland of issue 930368, which has a race condition with the following CL
in the CQ:
https://chromium.googlesource.com/chromium/src/+/6200d332518cd781f87ab86554bc71ff7a01ec4e%5E%21
This CL fixes the race condition by merging that CL.
For chrome_switches.{h,cc}, this CL makes the following changes:
1) Remove function PowerOverlayEnabled() which is not used.
2) Remove function ExtensionsDisabled() which is not used.
3) Move ExtensionsDisabled(base::CommandLine) to chrome_extensions_browser_client.cc,
which is the only call site.
4) Move them to lib "non_code_constants", as they don't contain any functions now.
Now notification_helper can have a deps on lib "non_code_constants" rather than lib
"constants", hence more lightweight.
Bug: 734095
Change-Id: I2b5ca5ffa873537c8df21315cd0850b2433dbc4d
Reviewed-on: https://chromium-review.googlesource.com/935826
Reviewed-by: Greg Thompson <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Commit-Queue: Xi Cheng <[email protected]>
Cr-Commit-Position: refs/heads/master@{#539195}
diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.cc b/chrome/browser/extensions/chrome_extensions_browser_client.cc
index 3d21dbf..dcf3fc7 100644
--- a/chrome/browser/extensions/chrome_extensions_browser_client.cc
+++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc
@@ -77,6 +77,11 @@
// new chrome update.
bool g_did_chrome_update_for_testing = false;
+bool ExtensionsDisabled(const base::CommandLine& command_line) {
+ return command_line.HasSwitch(switches::kDisableExtensions) ||
+ command_line.HasSwitch(switches::kDisableExtensionsExcept);
+}
+
} // namespace
ChromeExtensionsBrowserClient::ChromeExtensionsBrowserClient() {
@@ -96,7 +101,7 @@
const base::CommandLine& command_line,
content::BrowserContext* context) {
Profile* profile = static_cast<Profile*>(context);
- return switches::ExtensionsDisabled(command_line) ||
+ return ExtensionsDisabled(command_line) ||
profile->GetPrefs()->GetBoolean(prefs::kDisableExtensions);
}