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

Unified Diff: chrome/browser/extensions/extension_error_reporter.h

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: Minor changes, moved observer class 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
Index: chrome/browser/extensions/extension_error_reporter.h
diff --git a/chrome/browser/extensions/extension_error_reporter.h b/chrome/browser/extensions/extension_error_reporter.h
index ccc188754651c540defdefd89cac9986fda148f4..7c7d919be5264386844d16dc986a31600ca66bcb 100644
--- a/chrome/browser/extensions/extension_error_reporter.h
+++ b/chrome/browser/extensions/extension_error_reporter.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/observer_list.h"
#include "base/strings/string16.h"
namespace base {
@@ -16,6 +17,7 @@ class FilePath;
}
class Profile;
+class ExtensionErrorReporterObserver;
// Exposes an easy way for the various components of the extension system to
// report errors. This is a singleton that lives on the UI thread, with the
@@ -27,6 +29,13 @@ class Profile;
// report errors that are specific to a particular extension.
class ExtensionErrorReporter {
public:
+ class ExtensionErrorReporterObserver {
Devlin 2014/06/25 19:49:36 Since any other classes will prefix this by Extens
+ public:
+ virtual ~ExtensionErrorReporterObserver() {}
+
+ virtual void OnLoadFailure(const base::FilePath& extension_path,
+ const std::string& error) = 0;
+ };
Devlin 2014/06/25 19:49:36 nit: newline after class declaration.
// Initializes the error reporter. Must be called before any other methods
// and on the UI thread.
static void Init(bool enable_noisy_errors);
@@ -54,6 +63,9 @@ class ExtensionErrorReporter {
// Clear the list of errors reported so far.
void ClearErrors();
+ void AddObserver(ExtensionErrorReporterObserver* observer);
+ void RemoveObserver(ExtensionErrorReporterObserver* observer);
+
private:
static ExtensionErrorReporter* instance_;
@@ -63,6 +75,8 @@ class ExtensionErrorReporter {
base::MessageLoop* ui_loop_;
std::vector<base::string16> errors_;
bool enable_noisy_errors_;
+
+ ObserverList<ExtensionErrorReporterObserver> observers_;
};
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_REPORTER_H_

Powered by Google App Engine
This is Rietveld 408576698