diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/resources/extensions/extension_list.js | 22 | ||||
-rw-r--r-- | chrome/browser/resources/extensions/extensions.html | 10 | ||||
-rw-r--r-- | chrome/browser/ui/webui/extensions/extension_settings_handler.cc | 14 | ||||
-rw-r--r-- | chrome/common/url_constants.cc | 3 | ||||
-rw-r--r-- | chrome/common/url_constants.h | 3 |
5 files changed, 42 insertions, 10 deletions
diff --git a/chrome/browser/resources/extensions/extension_list.js b/chrome/browser/resources/extensions/extension_list.js index a3b02a5..713ac66 100644 --- a/chrome/browser/resources/extensions/extension_list.js +++ b/chrome/browser/resources/extensions/extension_list.js @@ -88,7 +88,7 @@ cr.define('options', function() { if (extension.managedInstall) { node.classList.add('may-not-modify'); node.classList.add('may-not-remove'); - } else if (extension.suspiciousInstall) { + } else if (extension.suspiciousInstall || extension.corruptInstall) { node.classList.add('may-not-modify'); } @@ -223,10 +223,12 @@ cr.define('options', function() { // The 'Enabled' checkbox. var enable = node.querySelector('.enable-checkbox'); enable.hidden = false; - enable.querySelector('input').disabled = extension.managedInstall || - extension.suspiciousInstall; + var managedOrHosedExtension = extension.managedInstall || + extension.suspiciousInstall || + extension.corruptInstall; + enable.querySelector('input').disabled = managedOrHosedExtension; - if (!extension.managedInstall && !extension.suspiciousInstall) { + if (!managedOrHosedExtension) { enable.addEventListener('click', function(e) { // When e.target is the label instead of the checkbox, it doesn't // have the checked property and the state of the checkbox is @@ -282,9 +284,15 @@ cr.define('options', function() { // Then the 'managed, cannot uninstall/disable' message. if (extension.managedInstall) { node.querySelector('.managed-message').hidden = false; - } else if (extension.suspiciousInstall) { - // Then the 'This isn't from the webstore, looks suspicious' message. - node.querySelector('.suspicious-install-message').hidden = false; + } else { + if (extension.suspiciousInstall) { + // Then the 'This isn't from the webstore, looks suspicious' message. + node.querySelector('.suspicious-install-message').hidden = false; + } + if (extension.corruptInstall) { + // Then the 'This is a corrupt extension' message. + node.querySelector('.corrupt-install-message').hidden = false; + } } // Then active views. diff --git a/chrome/browser/resources/extensions/extensions.html b/chrome/browser/resources/extensions/extensions.html index f85b37e..6ba6379 100644 --- a/chrome/browser/resources/extensions/extensions.html +++ b/chrome/browser/resources/extensions/extensions.html @@ -148,7 +148,15 @@ <span i18n-content="extensionSettingsSuspiciousInstall"></span> <a target="_blank" class="learn-more-link" i18n-values="href:extensionSettingsSuspiciousInstallHelpUrl" - i18n-content="extensionSettingsSuspiciousInstallLearnMore" + i18n-content="extensionSettingsLearnMore" + href="#"> + </a> + </div> + <div class="corrupt-install-message" hidden> + <span i18n-content="extensionSettingsCorruptInstall"></span> + <a target="_blank" class="learn-more-link" + i18n-values="href:extensionSettingsCorruptInstallHelpUrl" + i18n-content="extensionSettingsLearnMore" href="#"> </a> </div> diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc index d7788af..da10080 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc @@ -213,12 +213,16 @@ base::DictionaryValue* ExtensionSettingsHandler::CreateExtensionDetailValue( if (suspicious_install) should_do_verification_check_ = true; + bool corrupt_install = + (disable_reasons & Extension::DISABLE_CORRUPTED) != 0; + extension_data->SetBoolean("corruptInstall", corrupt_install); + bool managed_install = !management_policy_->UserMayModifySettings(extension, NULL); extension_data->SetBoolean("managedInstall", managed_install); // We should not get into a state where both are true. - DCHECK(managed_install == false || suspicious_install == false); + DCHECK(!managed_install || !suspicious_install); GURL icon = ExtensionIconSource::GetIconURL(extension, @@ -457,12 +461,18 @@ void ExtensionSettingsHandler::GetLocalizedValues( l10n_util::GetStringUTF16(IDS_EXTENSIONS_POLICY_CONTROLLED)); source->AddString("extensionSettingsManagedMode", l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOCKED_MANAGED_USER)); + source->AddString("extensionSettingsCorruptInstall", + l10n_util::GetStringUTF16( + IDS_EXTENSIONS_CORRUPTED_EXTENSION)); source->AddString("extensionSettingsSuspiciousInstall", l10n_util::GetStringFUTF16( IDS_EXTENSIONS_ADDED_WITHOUT_KNOWLEDGE, l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE))); - source->AddString("extensionSettingsSuspiciousInstallLearnMore", + source->AddString("extensionSettingsLearnMore", l10n_util::GetStringUTF16(IDS_LEARN_MORE)); + source->AddString("extensionSettingsCorruptInstallHelpUrl", + base::ASCIIToUTF16(google_util::AppendGoogleLocaleParam( + GURL(chrome::kCorruptExtensionURL)).spec())); source->AddString("extensionSettingsSuspiciousInstallHelpUrl", base::ASCIIToUTF16(google_util::AppendGoogleLocaleParam( GURL(chrome::kRemoveNonCWSExtensionURL)).spec())); diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc index 8d3b820..2c60e8a 100644 --- a/chrome/common/url_constants.cc +++ b/chrome/common/url_constants.cc @@ -548,6 +548,9 @@ const char kRemoveNonCWSExtensionURL[] = "https://support.google.com/chrome/answer/2811969?" "p=ui_remove_non_cws_extensions&rd=1"; +const char kCorruptExtensionURL[] = + "https://support.google.com/chrome/?p=settings_corrupt_extension"; + const char kNotificationsHelpURL[] = "https://support.google.com/chrome/?p=ui_notifications"; diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h index bd84788..9d6fe17 100644 --- a/chrome/common/url_constants.h +++ b/chrome/common/url_constants.h @@ -463,6 +463,9 @@ extern const char kLearnMoreEnterpriseURL[]; // The URL for the Learn More link of the non-CWS bubble. extern const char kRemoveNonCWSExtensionURL[]; +// The URL for the Learn More link for the corrupt extension message. +extern const char kCorruptExtensionURL[]; + extern const char kNotificationsHelpURL[]; // The Welcome Notification More Info URL. |