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

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

Issue 22938005: Add ErrorConsole UI for Extension Install Warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dc_ec_install_warnings
Patch Set: License Created 7 years, 3 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 dacfd43b51f278b106161b0d6c5d1100e2dce911..7d3659ae26acd72fd7b416baeddbed6e2df8919e 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
@@ -28,6 +28,7 @@
#include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
#include "chrome/browser/extensions/component_loader.h"
#include "chrome/browser/extensions/crx_installer.h"
+#include "chrome/browser/extensions/error_console/error_console.h"
#include "chrome/browser/extensions/extension_action_manager.h"
#include "chrome/browser/extensions/extension_disabled_ui.h"
#include "chrome/browser/extensions/extension_error_reporter.h"
@@ -73,6 +74,7 @@
#include "content/public/browser/web_contents_view.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
+#include "extensions/browser/extension_error.h"
#include "extensions/browser/view_type_utils.h"
#include "extensions/common/constants.h"
#include "grit/browser_resources.h"
@@ -82,7 +84,8 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
-
+using base::DictionaryValue;
+using base::ListValue;
using content::RenderViewHost;
using content::WebContents;
@@ -253,8 +256,23 @@ base::DictionaryValue* ExtensionSettingsHandler::CreateExtensionDetailValue(
}
}
- // Add install warnings (these are not the same as warnings!).
- if (Manifest::IsUnpackedLocation(extension->location())) {
+ // 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).
+ ErrorConsole* error_console =
+ ErrorConsole::Get(extension_service_->profile());
+ if (error_console->enabled()) {
+ const ErrorConsole::ErrorList& errors =
+ error_console->GetErrorsForExtension(extension->id());
+ if (!errors.empty()) {
+ scoped_ptr<ListValue> list(new ListValue);
+ for (ErrorConsole::ErrorList::const_iterator iter = errors.begin();
+ iter != errors.end(); ++iter) {
+ list->Append((*iter)->ToValue().release());
+ }
+ extension_data->Set("manifestErrors", list.release());
+ }
+ } else if (Manifest::IsUnpackedLocation(extension->location())) {
const std::vector<InstallWarning>& install_warnings =
extension->install_warnings();
if (!install_warnings.empty()) {
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_error_handler.cc ('k') | chrome/browser/ui/webui/extensions/extensions_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698