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

Unified Diff: extensions/browser/warning_set.h

Issue 503033002: Move ExtensionWarningService and ExtensionsWarningSet to extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@3_web_view_internal
Patch Set: rebase Created 6 years, 4 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 | « extensions/browser/warning_service_unittest.cc ('k') | extensions/browser/warning_set.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/warning_set.h
diff --git a/chrome/browser/extensions/extension_warning_set.h b/extensions/browser/warning_set.h
similarity index 68%
rename from chrome/browser/extensions/extension_warning_set.h
rename to extensions/browser/warning_set.h
index 2d7d034709c4cd16072f70da215c82b44c37bc49..015c98aebced566c6749359d762f2c969460c2a0 100644
--- a/chrome/browser/extensions/extension_warning_set.h
+++ b/extensions/browser/warning_set.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_SET_H_
-#define CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_SET_H_
+#ifndef EXTENSIONS_BROWSER_WARNING_SET_H_
+#define EXTENSIONS_BROWSER_WARNING_SET_H_
#include <set>
#include <string>
@@ -11,8 +11,6 @@
#include "url/gurl.h"
-// TODO(battre) Remove the Extension prefix.
-
namespace base {
class FilePath;
}
@@ -21,10 +19,10 @@ namespace extensions {
class ExtensionSet;
-// This class is used by the ExtensionWarningService to represent warnings if
-// extensions misbehave. Note that the ExtensionWarningService deals only with
-// specific warnings that should trigger a badge on the Chrome menu button.
-class ExtensionWarning {
+// This class is used by the WarningService to represent warnings if extensions
+// misbehave. Note that the WarningService deals only with specific warnings
+// that should trigger a badge on the Chrome menu button.
+class Warning {
public:
enum WarningType {
// Don't use this, it is only intended for the default constructor and
@@ -48,41 +46,40 @@ class ExtensionWarning {
kMaxWarningType
};
- // We allow copy&assign for passing containers of ExtensionWarnings between
- // threads.
- ExtensionWarning(const ExtensionWarning& other);
- ~ExtensionWarning();
- ExtensionWarning& operator=(const ExtensionWarning& other);
+ // We allow copy&assign for passing containers of Warnings between threads.
+ Warning(const Warning& other);
+ ~Warning();
+ Warning& operator=(const Warning& other);
// Factory methods for various warning types.
- static ExtensionWarning CreateNetworkDelayWarning(
+ static Warning CreateNetworkDelayWarning(
const std::string& extension_id);
- static ExtensionWarning CreateNetworkConflictWarning(
+ static Warning CreateNetworkConflictWarning(
const std::string& extension_id);
- static ExtensionWarning CreateRedirectConflictWarning(
+ static Warning CreateRedirectConflictWarning(
const std::string& extension_id,
const std::string& winning_extension_id,
const GURL& attempted_redirect_url,
const GURL& winning_redirect_url);
- static ExtensionWarning CreateRequestHeaderConflictWarning(
+ static Warning CreateRequestHeaderConflictWarning(
const std::string& extension_id,
const std::string& winning_extension_id,
const std::string& conflicting_header);
- static ExtensionWarning CreateResponseHeaderConflictWarning(
+ static Warning CreateResponseHeaderConflictWarning(
const std::string& extension_id,
const std::string& winning_extension_id,
const std::string& conflicting_header);
- static ExtensionWarning CreateCredentialsConflictWarning(
+ static Warning CreateCredentialsConflictWarning(
const std::string& extension_id,
const std::string& winning_extension_id);
- static ExtensionWarning CreateRepeatedCacheFlushesWarning(
+ static Warning CreateRepeatedCacheFlushesWarning(
const std::string& extension_id);
- static ExtensionWarning CreateDownloadFilenameConflictWarning(
+ static Warning CreateDownloadFilenameConflictWarning(
const std::string& losing_extension_id,
const std::string& winning_extension_id,
const base::FilePath& losing_filename,
const base::FilePath& winning_filename);
- static ExtensionWarning CreateReloadTooFrequentWarning(
+ static Warning CreateReloadTooFrequentWarning(
const std::string& extension_id);
// Returns the specific warning type.
@@ -99,7 +96,7 @@ class ExtensionWarning {
// could indicate for example the fact that an extension conflicted with
// others. The |message_id| refers to an IDS_ string ID. The
// |message_parameters| are filled into the message template.
- ExtensionWarning(WarningType type,
+ Warning(WarningType type,
const std::string& extension_id,
int message_id,
const std::vector<std::string>& message_parameters);
@@ -112,13 +109,13 @@ class ExtensionWarning {
std::vector<std::string> message_parameters_;
};
-// Compare ExtensionWarnings based on the tuple of (extension_id, type).
-// The message associated with ExtensionWarnings is purely informational
+// Compare Warnings based on the tuple of (extension_id, type).
+// The message associated with Warnings is purely informational
// and does not contribute to distinguishing extensions.
-bool operator<(const ExtensionWarning& a, const ExtensionWarning& b);
+bool operator<(const Warning& a, const Warning& b);
-typedef std::set<ExtensionWarning> ExtensionWarningSet;
+typedef std::set<Warning> WarningSet;
} // namespace extensions
-#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WARNING_SET_H_
+#endif // EXTENSIONS_BROWSER_WARNING_SET_H_
« no previous file with comments | « extensions/browser/warning_service_unittest.cc ('k') | extensions/browser/warning_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698