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

Unified Diff: chrome/browser/extensions/api/developer_private/developer_private_api.cc

Issue 231523002: Enable Error Console only for Unpacked extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/extensions/extension_settings_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/developer_private/developer_private_api.cc
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 1440f33a5cba3f8a475c25ebc3a76e78ea00d94b..d91b4114847ad76be474cb33a5102ff65d6abe7c 100644
--- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc
+++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc
@@ -60,6 +60,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/incognito_info.h"
#include "extensions/common/manifest_handlers/offline_enabled_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();
« no previous file with comments | « no previous file | chrome/browser/ui/webui/extensions/extension_settings_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698