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, |