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 bce514598a8ae7d8576c3e46aa935116ca6450f1..8550e29dac73e5278a825ed478fcfe51f4c96ab4 100644 |
| --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc |
| +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc |
| @@ -52,7 +52,9 @@ |
| #include "chrome/browser/ui/webui/extensions/extension_basic_info.h" |
| #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| #include "chrome/common/chrome_switches.h" |
| +#include "chrome/common/chrome_version_info.h" |
| #include "chrome/common/extensions/extension_constants.h" |
| +#include "chrome/common/extensions/features/feature_channel.h" |
| #include "chrome/common/extensions/manifest_url_handler.h" |
| #include "chrome/common/pref_names.h" |
| #include "chrome/common/url_constants.h" |
| @@ -81,7 +83,6 @@ |
| #include "extensions/common/extension.h" |
| #include "extensions/common/extension_icon_set.h" |
| #include "extensions/common/extension_set.h" |
| -#include "extensions/common/feature_switch.h" |
| #include "extensions/common/manifest.h" |
| #include "extensions/common/manifest_handlers/background_info.h" |
| #include "extensions/common/manifest_handlers/incognito_info.h" |
| @@ -97,6 +98,11 @@ using base::ListValue; |
| using content::RenderViewHost; |
| using content::WebContents; |
| +namespace { |
| +const char kAppsDeveloperToolsExtensionId[] = |
| + "ohmmkhmmmpcnpikjeljgnaoabkaalbgc"; |
| +} |
| + |
| namespace extensions { |
| ExtensionPage::ExtensionPage(const GURL& url, |
| @@ -467,6 +473,17 @@ void ExtensionSettingsHandler::GetLocalizedValues( |
| l10n_util::GetStringUTF16(IDS_EXTENSIONS_COMMANDS_CONFIGURE)); |
| source->AddString("extensionSettingsUpdateButton", |
| l10n_util::GetStringUTF16(IDS_EXTENSIONS_UPDATE_BUTTON)); |
| + source->AddString( |
| + "extensionSettingsAppsDevToolsPromoText", |
|
Dan Beam
2014/04/18 21:27:28
I don't really think the "extensionSettings" prefi
Devlin
2014/04/18 22:19:55
Yeah, went with consistency over easy typing. :/
|
| + l10n_util::GetStringUTF16(IDS_EXTENSIONS_APPS_DEV_TOOLS_PROMO_TEXT)); |
| + source->AddString( |
| + "extensionSettingsAppsDevToolsLinkText", |
| + l10n_util::GetStringUTF16(IDS_EXTENSIONS_APPS_DEV_TOOLS_LINK_TEXT)); |
| + source->AddString( |
| + "extensionSettingsAppsDevToolsUrl", |
| + base::ASCIIToUTF16(google_util::AppendGoogleLocaleParam( |
| + GURL(extension_urls::GetWebstoreItemDetailURLPrefix() + |
| + kAppsDeveloperToolsExtensionId)).spec())); |
| source->AddString("extensionSettingsCrashMessage", |
| l10n_util::GetStringUTF16(IDS_EXTENSIONS_CRASHED_EXTENSION)); |
| source->AddString("extensionSettingsInDevelopment", |
| @@ -814,6 +831,15 @@ void ExtensionSettingsHandler::HandleRequestExtensionsData( |
| results.SetBoolean("profileIsManaged", is_managed); |
| results.SetBoolean("developerMode", developer_mode); |
| + // We should promote the Apps Developer Tools if the user does not have it |
| + // already. If they do, we shouldn't promote it. |
|
Dan Beam
2014/04/18 21:27:28
nit: // Promote Apps Developer Tools if they're no
Devlin
2014/04/18 22:19:55
Done.
|
| + bool promote_apps_dev_tools = |
| + GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV && |
| + ExtensionRegistry::Get(Profile::FromWebUI(web_ui())) |
| + ->GetExtensionById(kAppsDeveloperToolsExtensionId, |
|
Dan Beam
2014/04/18 21:27:28
nit: -> at end, CLANG FORMATTTTTTTTTTTTT!
Devlin
2014/04/18 22:19:55
Haha done. :)
|
| + ExtensionRegistry::EVERYTHING) == NULL; |
|
Dan Beam
2014/04/18 21:27:28
Get(...) == NULL -> !Get(...)
Devlin
2014/04/18 22:19:55
Done (sometimes people have preferences when testi
|
| + results.SetBoolean("promoteAppsDevTools", promote_apps_dev_tools); |
| + |
| bool load_unpacked_disabled = |
| ExtensionPrefs::Get(profile)->ExtensionsBlacklistedByDefault(); |
| results.SetBoolean("loadUnpackedDisabled", load_unpacked_disabled); |