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

Unified Diff: extensions/browser/extension_error.h

Issue 22938005: Add ErrorConsole UI for Extension Install Warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dc_ec_install_warnings
Patch Set: License Created 7 years, 3 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/chrome_tests_unit.gypi ('k') | extensions/browser/extension_error.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_error.h
diff --git a/extensions/browser/extension_error.h b/extensions/browser/extension_error.h
index ceb1504b3c6acfdfe58db05527f013e861469c7a..7e02bb33f89e18da20ddf1d696d911fcde973559 100644
--- a/extensions/browser/extension_error.h
+++ b/extensions/browser/extension_error.h
@@ -10,10 +10,15 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
#include "extensions/common/stack_frame.h"
#include "url/gurl.h"
+namespace base {
+class DictionaryValue;
+}
+
namespace extensions {
class ExtensionError {
@@ -25,6 +30,9 @@ class ExtensionError {
virtual ~ExtensionError();
+ // Serializes the ExtensionError into JSON format.
+ virtual scoped_ptr<base::DictionaryValue> ToValue() const;
+
virtual std::string PrintForTest() const;
// Return true if this error and |rhs| are considered equal, and should be
@@ -40,6 +48,14 @@ class ExtensionError {
size_t occurrences() const { return occurrences_; }
void set_occurrences(size_t occurrences) { occurrences_ = occurrences; }
+ // Keys used for retrieving JSON values.
+ static const char kExtensionIdKey[];
+ static const char kFromIncognitoKey[];
+ static const char kLevelKey[];
+ static const char kMessageKey[];
+ static const char kSourceKey[];
+ static const char kTypeKey[];
+
protected:
ExtensionError(Type type,
const std::string& extension_id,
@@ -78,10 +94,17 @@ class ManifestError : public ExtensionError {
const base::string16& manifest_specific);
virtual ~ManifestError();
+ virtual scoped_ptr<base::DictionaryValue> ToValue() const OVERRIDE;
+
virtual std::string PrintForTest() const OVERRIDE;
const base::string16& manifest_key() const { return manifest_key_; }
const base::string16& manifest_specific() const { return manifest_specific_; }
+
+ // Keys used for retrieving JSON values.
+ static const char kManifestKeyKey[];
+ static const char kManifestSpecificKey[];
+
private:
virtual bool IsEqualImpl(const ExtensionError* rhs) const OVERRIDE;
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | extensions/browser/extension_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698