Chromium Code Reviews| Index: chrome/browser/ui/webui/extensions/extension_settings_handler.cc |
| diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc |
| index a2972ec3fa83eb036e95fa4a744e9e92e4273dc9..f50c6242f91c312c15187511ff4794c10d385a4f 100644 |
| --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc |
| +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc |
| @@ -108,10 +108,24 @@ using content::RenderViewHost; |
| using content::WebContents; |
| namespace { |
| + |
| const char kAppsDeveloperToolsExtensionId[] = |
| "ohmmkhmmmpcnpikjeljgnaoabkaalbgc"; |
| + |
| +// Returns true if the extensions page should display the new-style extension |
| +// info dialog. If false, display the old permissions dialog. |
| +bool ShouldDisplayExtensionInfoDialog() { |
| + bool display_extension_info_dialog = false; |
|
benwells
2014/10/23 00:43:16
super nit: this would be simpler logically as
#if
sashab
2014/10/23 06:34:36
Done.
|
| +#if !defined(OS_MACOSX) |
| + display_extension_info_dialog = |
| + !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + extensions::switches::kDisableExtensionInfoDialog); |
| +#endif |
| + return display_extension_info_dialog; |
| } |
| +} // namespace |
| + |
| namespace extensions { |
| ExtensionPage::ExtensionPage(const GURL& url, |
| @@ -537,8 +551,7 @@ void ExtensionSettingsHandler::GetLocalizedValues( |
| l10n_util::GetStringUTF16(IDS_EXTENSIONS_RELOAD_UNPACKED)); |
| source->AddString("extensionSettingsOptions", |
| l10n_util::GetStringUTF16(IDS_EXTENSIONS_OPTIONS_LINK)); |
| - if (CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kEnableExtensionInfoDialog)) { |
| + if (ShouldDisplayExtensionInfoDialog()) { |
| source->AddString("extensionSettingsPermissions", |
| l10n_util::GetStringUTF16(IDS_EXTENSIONS_INFO_LINK)); |
| } else { |
| @@ -1199,8 +1212,7 @@ void ExtensionSettingsHandler::HandlePermissionsMessage( |
| // Show the new-style extensions dialog when the flag is set. The flag cannot |
| // be set on Mac platforms. |
| - if (CommandLine::ForCurrentProcess()->HasSwitch( |
| - switches::kEnableExtensionInfoDialog)) { |
| + if (ShouldDisplayExtensionInfoDialog()) { |
| UMA_HISTOGRAM_ENUMERATION("Apps.AppInfoDialog.Launches", |
| AppInfoLaunchSource::FROM_EXTENSIONS_PAGE, |
| AppInfoLaunchSource::NUM_LAUNCH_SOURCES); |