Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Unified Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 10689097: Enforce the 'requirements' field in manifests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 9146c2ef3e730d31d2e1b0852f0c14cb42c13f65..729a60ab83ac160239ed4732abd794187ea2754f 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/debugger/devtools_window.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/extension_disabled_ui.h"
+#include "chrome/browser/extensions/extension_error_reporter.h"
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
@@ -192,7 +193,9 @@ DictionaryValue* ExtensionSettingsHandler::CreateExtensionDetailValue(
}
// Add install warnings (these are not the same as warnings!).
- if (extension->location() == Extension::LOAD) {
+ if (extension->location() == Extension::LOAD ||
+ extension_service_->extension_prefs()->HasUnsupportedRequirements(
Aaron Boodman 2012/08/01 03:58:54 Yeah, I don't think we want to do this. Did I say
eaugusti 2012/08/03 01:06:26 This wasn't in the doc, but I think it is the best
+ extension->id())) {
const Extension::InstallWarningVector& install_warnings =
extension->install_warnings();
if (!install_warnings.empty()) {
@@ -622,6 +625,11 @@ void ExtensionSettingsHandler::HandleEnableMessage(const ListValue* args) {
web_ui()->GetWebContents());
extensions::ShowExtensionDisabledDialog(
extension_service_, browser, extension);
+ } else if (prefs->HasUnsupportedRequirements(extension_id)) {
Aaron Boodman 2012/08/01 03:58:54 Seems like you could check the disable reason inst
eaugusti 2012/08/03 01:06:26 Done.
+ // TODO(eriq): i18n
+ ExtensionErrorReporter::GetInstance()->ReportError(
+ ASCIIToUTF16("Cannot enable, not all requirements are met."),
+ true /* be noisy */);
} else {
extension_service_->EnableExtension(extension_id);
}

Powered by Google App Engine
This is Rietveld 408576698