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

Unified Diff: chrome/browser/extensions/extension_notification_observer.cc

Issue 425303002: Move extension notifications to extensions/browser/notification_types.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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_notification_observer.cc
diff --git a/chrome/browser/extensions/extension_notification_observer.cc b/chrome/browser/extensions/extension_notification_observer.cc
index e7bb65a606f07f5548c545bc302e261f26efd0e2..3bb372f1a02a76b7ee5b5bcc2537d547ef4c8dbe 100644
--- a/chrome/browser/extensions/extension_notification_observer.cc
+++ b/chrome/browser/extensions/extension_notification_observer.cc
@@ -14,10 +14,10 @@ namespace extensions {
namespace {
-std::string Str(const std::vector<chrome::NotificationType>& types) {
+std::string Str(const std::vector<chrome::ExtensionNotificationType>& types) {
std::string str = "[";
bool needs_comma = false;
- for (std::vector<chrome::NotificationType>::const_iterator it =
+ for (std::vector<chrome::ExtensionNotificationType>::const_iterator it =
types.begin(); it != types.end(); ++it) {
if (needs_comma)
str += ",";
@@ -46,28 +46,28 @@ ExtensionNotificationObserver::ExtensionNotificationObserver(
ExtensionNotificationObserver::~ExtensionNotificationObserver() {}
testing::AssertionResult ExtensionNotificationObserver::CheckNotifications() {
- return CheckNotifications(std::vector<chrome::NotificationType>());
+ return CheckNotifications(std::vector<chrome::ExtensionNotificationType>());
}
testing::AssertionResult ExtensionNotificationObserver::CheckNotifications(
- chrome::NotificationType type) {
- return CheckNotifications(std::vector<chrome::NotificationType>(1, type));
+ chrome::ExtensionNotificationType type) {
+ return CheckNotifications(std::vector<chrome::ExtensionNotificationType>(1, type));
}
testing::AssertionResult ExtensionNotificationObserver::CheckNotifications(
- chrome::NotificationType t1,
- chrome::NotificationType t2) {
- std::vector<chrome::NotificationType> types;
+ chrome::ExtensionNotificationType t1,
+ chrome::ExtensionNotificationType t2) {
+ std::vector<chrome::ExtensionNotificationType> types;
types.push_back(t1);
types.push_back(t2);
return CheckNotifications(types);
}
testing::AssertionResult ExtensionNotificationObserver::CheckNotifications(
- chrome::NotificationType t1,
- chrome::NotificationType t2,
- chrome::NotificationType t3) {
- std::vector<chrome::NotificationType> types;
+ chrome::ExtensionNotificationType t1,
+ chrome::ExtensionNotificationType t2,
+ chrome::ExtensionNotificationType t3) {
+ std::vector<chrome::ExtensionNotificationType> types;
types.push_back(t1);
types.push_back(t2);
types.push_back(t3);
@@ -75,13 +75,13 @@ testing::AssertionResult ExtensionNotificationObserver::CheckNotifications(
}
testing::AssertionResult ExtensionNotificationObserver::CheckNotifications(
- chrome::NotificationType t1,
- chrome::NotificationType t2,
- chrome::NotificationType t3,
- chrome::NotificationType t4,
- chrome::NotificationType t5,
- chrome::NotificationType t6) {
- std::vector<chrome::NotificationType> types;
+ chrome::ExtensionNotificationType t1,
+ chrome::ExtensionNotificationType t2,
+ chrome::ExtensionNotificationType t3,
+ chrome::ExtensionNotificationType t4,
+ chrome::ExtensionNotificationType t5,
+ chrome::ExtensionNotificationType t6) {
+ std::vector<chrome::ExtensionNotificationType> types;
types.push_back(t1);
types.push_back(t2);
types.push_back(t3);
@@ -101,7 +101,7 @@ void ExtensionNotificationObserver::Observe(
const Extension* extension =
content::Details<const InstalledExtensionInfo>(details)->extension;
if (extension_ids_.count(extension->id()))
- notifications_.push_back(static_cast<chrome::NotificationType>(type));
+ notifications_.push_back(static_cast<chrome::ExtensionNotificationType>(type));
break;
}
@@ -109,7 +109,7 @@ void ExtensionNotificationObserver::Observe(
const Extension* extension =
content::Details<const Extension>(details).ptr();
if (extension_ids_.count(extension->id()))
- notifications_.push_back(static_cast<chrome::NotificationType>(type));
+ notifications_.push_back(static_cast<chrome::ExtensionNotificationType>(type));
break;
}
@@ -117,7 +117,7 @@ void ExtensionNotificationObserver::Observe(
UnloadedExtensionInfo* reason =
content::Details<UnloadedExtensionInfo>(details).ptr();
if (extension_ids_.count(reason->extension->id())) {
- notifications_.push_back(static_cast<chrome::NotificationType>(type));
+ notifications_.push_back(static_cast<chrome::ExtensionNotificationType>(type));
// The only way that extensions are unloaded in these tests is
// by blacklisting.
EXPECT_EQ(UnloadedExtensionInfo::REASON_BLACKLIST,
@@ -133,7 +133,7 @@ void ExtensionNotificationObserver::Observe(
}
testing::AssertionResult ExtensionNotificationObserver::CheckNotifications(
- const std::vector<chrome::NotificationType>& types) {
+ const std::vector<chrome::ExtensionNotificationType>& types) {
testing::AssertionResult result = (notifications_ == types) ?
testing::AssertionSuccess() :
testing::AssertionFailure() << "Expected " << Str(types) << ", " <<

Powered by Google App Engine
This is Rietveld 408576698