Chromium Code Reviews| Index: chrome/browser/extensions/extension_error_reporter.cc |
| diff --git a/chrome/browser/extensions/extension_error_reporter.cc b/chrome/browser/extensions/extension_error_reporter.cc |
| index 837402bea19937013fae60b73f8da0d825aefec4..d2fc844b8d98021bc337ff255b18fc989f62f36a 100644 |
| --- a/chrome/browser/extensions/extension_error_reporter.cc |
| +++ b/chrome/browser/extensions/extension_error_reporter.cc |
| @@ -3,6 +3,7 @@ |
| // found in the LICENSE file. |
| #include "chrome/browser/extensions/extension_error_reporter.h" |
| +#include "chrome/browser/extensions/extension_error_reporter_observer.h" |
|
Devlin
2014/06/24 22:21:12
Only the associated .h file goes at the top, all o
|
| #include "build/build_config.h" |
| @@ -55,6 +56,7 @@ void ExtensionErrorReporter::ReportLoadError( |
| path_str.c_str(), |
| error.c_str())); |
| ReportError(message, be_noisy); |
| + TriggerOnLoadFailure(extension_path, error); |
|
Devlin
2014/06/24 22:21:12
You can just inline the notification here.
|
| } |
| void ExtensionErrorReporter::ReportError(const base::string16& message, |
| @@ -86,3 +88,21 @@ const std::vector<base::string16>* ExtensionErrorReporter::GetErrors() { |
| void ExtensionErrorReporter::ClearErrors() { |
| errors_.clear(); |
| } |
| + |
| +void ExtensionErrorReporter::AddObserver( |
|
Devlin
2014/06/24 22:21:11
Methods should be defined in the .cc in the same o
gpdavis
2014/06/25 00:21:01
They are implemented in the same order as in the h
Devlin
2014/06/25 19:49:36
Whoops, you're right, my bad.
|
| + ExtensionErrorReporterObserver* observer) { |
| + observers_.AddObserver(observer); |
| +} |
| + |
| +void ExtensionErrorReporter::RemoveObserver( |
| + ExtensionErrorReporterObserver* observer) { |
| + observers_.RemoveObserver(observer); |
| +} |
| + |
| +void ExtensionErrorReporter::TriggerOnLoadFailure( |
| + const base::FilePath& extension_path, |
| + const std::string& error) { |
| + FOR_EACH_OBSERVER(ExtensionErrorReporterObserver, |
| + observers_, |
| + OnLoadFailure(extension_path, error)); |
| +} |