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

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: Synchronized page loading, support multiple load errors 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..4b137dcc5c04eaacf652f23e06e5656aa4f20eed 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 {
@@ -27,6 +28,14 @@ class Profile;
// report errors that are specific to a particular extension.
class ExtensionErrorReporter {
public:
+ class Observer {
+ public:
Devlin 2014/06/27 22:31:08 nit: one space indentation for public:, private:,
gpdavis 2014/06/28 02:31:17 Cursed auto indentation ;) Done.
+ virtual ~Observer() {}
+
+ virtual void OnLoadFailure(const base::FilePath& extension_path,
Devlin 2014/06/27 22:31:08 nit: comment.
gpdavis 2014/06/28 02:31:17 // Observer function called when an unpacked exten
+ const std::string& error) = 0;
+ };
+
// 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(Observer* observer);
+ void RemoveObserver(Observer* 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<Observer> observers_;
};
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_REPORTER_H_
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_error_reporter.cc » ('j') | chrome/browser/extensions/extension_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698