diff options
author | rdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-09 23:48:28 +0000 |
---|---|---|
committer | rdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-09 23:48:28 +0000 |
commit | 19db94feaaa7e875d09ac8022e88aee455b88887 (patch) | |
tree | 0a0e60c354d610f1aa755684fcd8089f20024cdf | |
parent | aaeb7d61dd5b45a8e516f2825c793440eca44014 (diff) | |
download | chromium_src-19db94feaaa7e875d09ac8022e88aee455b88887.zip chromium_src-19db94feaaa7e875d09ac8022e88aee455b88887.tar.gz chromium_src-19db94feaaa7e875d09ac8022e88aee455b88887.tar.bz2 |
Enable Error Console only for Unpacked extensions
Having it enabled for all extensions leads to too much noise. Let's only have
it for unpacked extensions for now.
We have the backend implementation to turn it on or off for only particular
extensions (and error severity), but we don't have the UI for it yet. In the
interim, let's do this.
BUG=360459
TBR=finnur@chromium.org (for small changes to extension_settings_handler.cc)
Review URL: https://codereview.chromium.org/231523002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262861 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/api/developer_private/developer_private_api.cc | 10 | ||||
-rw-r--r-- | chrome/browser/ui/webui/extensions/extension_settings_handler.cc | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc index 7657899..22954c2 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc @@ -59,6 +59,7 @@ #include "extensions/common/extension_resource.h" #include "extensions/common/extension_set.h" #include "extensions/common/install_warning.h" +#include "extensions/common/manifest.h" #include "extensions/common/manifest_handlers/background_info.h" #include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/manifest_handlers/incognito_info.h" @@ -361,11 +362,12 @@ DeveloperPrivateGetItemsInfoFunction::CreateItemInfo(const Extension& item, if (Manifest::IsUnpackedLocation(item.location())) { info->path.reset( new std::string(base::UTF16ToUTF8(item.path().LossyDisplayName()))); - // If the ErrorConsole is enabled, get the errors for the extension and add - // them to the list. Otherwise, use the install warnings (using both is - // redundant). + // If the ErrorConsole is enabled and the extension is unpacked, use the + // more detailed errors from the ErrorConsole. Otherwise, use the install + // warnings (using both is redundant). ErrorConsole* error_console = ErrorConsole::Get(GetProfile()); - if (error_console->IsEnabledForAppsDeveloperTools()) { + if (error_console->IsEnabledForAppsDeveloperTools() && + item.location() == Manifest::UNPACKED) { const ErrorList& errors = error_console->GetErrorsForExtension(item.id()); if (!errors.empty()) { for (ErrorList::const_iterator iter = errors.begin(); diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc index 12db280..bce5145 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc @@ -82,6 +82,7 @@ #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" #include "grit/browser_resources.h" @@ -334,12 +335,13 @@ base::DictionaryValue* ExtensionSettingsHandler::CreateExtensionDetailValue( } } - // If the ErrorConsole is enabled, get the errors for the extension and add - // them to the list. Otherwise, use the install warnings (using both is - // redundant). + // If the ErrorConsole is enabled and the extension is unpacked, use the more + // detailed errors from the ErrorConsole. Otherwise, use the install warnings + // (using both is redundant). ErrorConsole* error_console = ErrorConsole::Get(extension_service_->profile()); - if (error_console->IsEnabledForChromeExtensionsPage()) { + if (error_console->IsEnabledForChromeExtensionsPage() && + extension->location() == Manifest::UNPACKED) { const ErrorList& errors = error_console->GetErrorsForExtension(extension->id()); if (!errors.empty()) { |