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

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

Issue 342003005: Show alert failure for reloading unpacked extensions with bad manifest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 | « chrome/browser/ui/webui/extensions/extension_loader_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/extensions/extension_loader_handler.cc
diff --git a/chrome/browser/ui/webui/extensions/extension_loader_handler.cc b/chrome/browser/ui/webui/extensions/extension_loader_handler.cc
index 6e43177a4a3abd3fe57b684c2c362b5012a36f9b..18f64815040f810dd7629da1137620b87a8136d2 100644
--- a/chrome/browser/ui/webui/extensions/extension_loader_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_loader_handler.cc
@@ -31,6 +31,11 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/shell_dialogs/select_file_dialog.h"
+#include "base/debug/stack_trace.h"
+
+class ExtensionErrorReporter;
+class ExtensionErrorReporterObserver;
+
namespace extensions {
namespace {
@@ -131,8 +136,11 @@ void ExtensionLoaderHandler::FileHelper::MultiFilesSelected(
ExtensionLoaderHandler::ExtensionLoaderHandler(Profile* profile)
: profile_(profile),
file_helper_(new FileHelper(this)),
- weak_ptr_factory_(this) {
+ weak_ptr_factory_(this),
+ extension_error_reporter_observer_(this) {
DCHECK(profile_);
+ DLOG(ERROR) << "--------------Constructor";
+ extension_error_reporter_observer_.Add(ExtensionErrorReporter::GetInstance());
}
ExtensionLoaderHandler::~ExtensionLoaderHandler() {
@@ -182,19 +190,21 @@ void ExtensionLoaderHandler::LoadUnpackedExtensionImpl(
const base::FilePath& file_path) {
scoped_refptr<UnpackedInstaller> installer = UnpackedInstaller::Create(
ExtensionSystem::Get(profile_)->extension_service());
- installer->set_on_failure_callback(
- base::Bind(&ExtensionLoaderHandler::OnLoadFailure,
- weak_ptr_factory_.GetWeakPtr()));
+ // installer->set_on_failure_callback(
+ // base::Bind(&ExtensionLoaderHandler::OnLoadFailure,
+ // weak_ptr_factory_.GetWeakPtr()));
// We do our own error handling, so we don't want a load failure to trigger
// a dialog.
installer->set_be_noisy_on_failure(false);
+ DLOG(ERROR) << "----------LoadUnpackedExtensionImpl";
installer->Load(file_path);
}
void ExtensionLoaderHandler::OnLoadFailure(const base::FilePath& file_path,
const std::string& error) {
+ DLOG(ERROR) << "-------OnLoadFailure";
failed_path_ = file_path;
size_t line = 0u;
size_t column = 0u;
@@ -220,6 +230,12 @@ void ExtensionLoaderHandler::OnLoadFailure(const base::FilePath& file_path,
file_path,
error,
line));
+ /*
gpdavis 2014/06/18 23:53:16 Replacing the PostTaskAndReplyWithResult with this
+ const std::string& manifest =
+ ReadFileToString(file_path.Append(kManifestFilename));
+ ExtensionLoaderHandler::NotifyFrontendOfFailure(file_path, error, line,
+ manifest);
+ */
}
void ExtensionLoaderHandler::NotifyFrontendOfFailure(
@@ -236,6 +252,10 @@ void ExtensionLoaderHandler::NotifyFrontendOfFailure(
// full manifest.
highlighter.SetHighlightedRegions(&manifest_value);
+ DLOG(ERROR) << "-NotifyFrontendOfFailure";
+ base::debug::StackTrace trace;
+ LOG(WARNING) << "My trace is: " << trace.ToString();
+
web_ui()->CallJavascriptFunction(
"extensions.ExtensionLoader.notifyLoadFailed",
file_value,
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_loader_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698