summaryrefslogtreecommitdiffstats
path: root/chrome/browser/webdata
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/webdata')
-rw-r--r--chrome/browser/webdata/web_data_service.cc34
-rw-r--r--chrome/browser/webdata/web_data_service_unittest.cc30
2 files changed, 32 insertions, 32 deletions
diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc
index 74f07e1..cc77219 100644
--- a/chrome/browser/webdata/web_data_service.cc
+++ b/chrome/browser/webdata/web_data_service.cc
@@ -16,10 +16,10 @@
#include "chrome/browser/webdata/autofill_entry.h"
#include "chrome/browser/webdata/web_database.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/chrome_notification_types.h"
#include "content/common/notification_details.h"
#include "content/common/notification_service.h"
#include "content/common/notification_source.h"
-#include "content/common/notification_type.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -606,9 +606,9 @@ void WebDataService::InitializeDatabaseIfNecessary() {
void WebDataService::NotifyDatabaseLoadedOnUIThread() {
// Notify that the database has been initialized.
- NotificationService::current()->Notify(NotificationType::WEB_DATABASE_LOADED,
- Source<WebDataService>(this),
- NotificationService::NoDetails());
+ NotificationService::current()->Notify(
+ chrome::NOTIFICATION_WEB_DATABASE_LOADED, Source<WebDataService>(this),
+ NotificationService::NoDetails());
}
void WebDataService::ShutdownDatabase() {
@@ -935,7 +935,7 @@ void WebDataService::AddFormElementsImpl(
// This is sent here so that work resulting from this notification will be
// done on the DB thread, and not the UI thread.
NotificationService::current()->Notify(
- NotificationType::AUTOFILL_ENTRIES_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED,
Source<WebDataService>(this),
Details<AutofillChangeList>(&changes));
}
@@ -971,7 +971,7 @@ void WebDataService::RemoveFormElementsAddedBetweenImpl(
// This is sent here so that work resulting from this notification
// will be done on the DB thread, and not the UI thread.
NotificationService::current()->Notify(
- NotificationType::AUTOFILL_ENTRIES_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED,
Source<WebDataService>(this),
Details<AutofillChangeList>(&changes));
}
@@ -998,7 +998,7 @@ void WebDataService::RemoveFormValueForElementNameImpl(
// Post the notifications including the list of affected keys.
NotificationService::current()->Notify(
- NotificationType::AUTOFILL_ENTRIES_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED,
Source<WebDataService>(this),
Details<AutofillChangeList>(&changes));
}
@@ -1021,7 +1021,7 @@ void WebDataService::AddAutofillProfileImpl(
AutofillProfileChange change(AutofillProfileChange::ADD,
profile.guid(), &profile);
NotificationService::current()->Notify(
- NotificationType::AUTOFILL_PROFILE_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED,
Source<WebDataService>(this),
Details<AutofillProfileChange>(&change));
}
@@ -1055,7 +1055,7 @@ void WebDataService::UpdateAutofillProfileImpl(
AutofillProfileChange change(AutofillProfileChange::UPDATE,
profile.guid(), &profile);
NotificationService::current()->Notify(
- NotificationType::AUTOFILL_PROFILE_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED,
Source<WebDataService>(this),
Details<AutofillProfileChange>(&change));
}
@@ -1084,7 +1084,7 @@ void WebDataService::RemoveAutofillProfileImpl(
// Send GUID-based notification.
AutofillProfileChange change(AutofillProfileChange::REMOVE, guid, NULL);
NotificationService::current()->Notify(
- NotificationType::AUTOFILL_PROFILE_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED,
Source<WebDataService>(this),
Details<AutofillProfileChange>(&change));
}
@@ -1121,7 +1121,7 @@ void WebDataService::EmptyMigrationTrashImpl(
AutofillProfileChange change(AutofillProfileChange::REMOVE,
*iter, NULL);
NotificationService::current()->Notify(
- NotificationType::AUTOFILL_PROFILE_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED,
Source<WebDataService>(this),
Details<AutofillProfileChange>(&change));
}
@@ -1137,7 +1137,7 @@ void WebDataService::EmptyMigrationTrashImpl(
AutofillProfileChange change(AutofillProfileChange::UPDATE,
(*iter)->guid(), *iter);
NotificationService::current()->Notify(
- NotificationType::AUTOFILL_PROFILE_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED,
Source<WebDataService>(this),
Details<AutofillProfileChange>(&change));
}
@@ -1169,7 +1169,7 @@ void WebDataService::AddCreditCardImpl(
AutofillCreditCardChange change(AutofillCreditCardChange::ADD,
credit_card.guid(), &credit_card);
NotificationService::current()->Notify(
- NotificationType::AUTOFILL_CREDIT_CARD_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_CREDIT_CARD_CHANGED,
Source<WebDataService>(this),
Details<AutofillCreditCardChange>(&change));
}
@@ -1202,7 +1202,7 @@ void WebDataService::UpdateCreditCardImpl(
AutofillCreditCardChange change(AutofillCreditCardChange::UPDATE,
credit_card.guid(), &credit_card);
NotificationService::current()->Notify(
- NotificationType::AUTOFILL_CREDIT_CARD_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_CREDIT_CARD_CHANGED,
Source<WebDataService>(this),
Details<AutofillCreditCardChange>(&change));
}
@@ -1224,7 +1224,7 @@ void WebDataService::RemoveCreditCardImpl(
AutofillCreditCardChange change(AutofillCreditCardChange::REMOVE, guid,
NULL);
NotificationService::current()->Notify(
- NotificationType::AUTOFILL_CREDIT_CARD_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_CREDIT_CARD_CHANGED,
Source<WebDataService>(this),
Details<AutofillCreditCardChange>(&change));
}
@@ -1260,7 +1260,7 @@ void WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl(
AutofillProfileChange change(AutofillProfileChange::REMOVE, *iter,
NULL);
NotificationService::current()->Notify(
- NotificationType::AUTOFILL_PROFILE_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED,
Source<WebDataService>(this),
Details<AutofillProfileChange>(&change));
}
@@ -1270,7 +1270,7 @@ void WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl(
AutofillCreditCardChange change(AutofillCreditCardChange::REMOVE,
*iter, NULL);
NotificationService::current()->Notify(
- NotificationType::AUTOFILL_CREDIT_CARD_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_CREDIT_CARD_CHANGED,
Source<WebDataService>(this),
Details<AutofillCreditCardChange>(&change));
}
diff --git a/chrome/browser/webdata/web_data_service_unittest.cc b/chrome/browser/webdata/web_data_service_unittest.cc
index da66435..0f7d861 100644
--- a/chrome/browser/webdata/web_data_service_unittest.cc
+++ b/chrome/browser/webdata/web_data_service_unittest.cc
@@ -24,13 +24,13 @@
#include "chrome/browser/webdata/autofill_entry.h"
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/browser/webdata/web_data_service_test_util.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/guid.h"
#include "chrome/test/thread_observer_helper.h"
#include "content/browser/browser_thread.h"
#include "content/common/notification_details.h"
#include "content/common/notification_service.h"
-#include "content/common/notification_type.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/glue/form_field.h"
@@ -56,13 +56,13 @@ class AutofillDBThreadObserverHelper : public DBThreadObserverHelper {
protected:
virtual void RegisterObservers() {
registrar_.Add(&observer_,
- NotificationType::AUTOFILL_ENTRIES_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED,
NotificationService::AllSources());
registrar_.Add(&observer_,
- NotificationType::AUTOFILL_PROFILE_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED,
NotificationService::AllSources());
registrar_.Add(&observer_,
- NotificationType::AUTOFILL_CREDIT_CARD_CHANGED,
+ chrome::NOTIFICATION_AUTOFILL_CREDIT_CARD_CHANGED,
NotificationService::AllSources());
}
};
@@ -161,7 +161,7 @@ TEST_F(WebDataServiceAutofillTest, FormFillAdd) {
// passing the correct list of autofill keys in the details.
EXPECT_CALL(
*observer_helper_->observer(),
- Observe(NotificationType(NotificationType::AUTOFILL_ENTRIES_CHANGED),
+ Observe(int(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED),
Source<WebDataService>(wds_.get()),
Property(&Details<const AutofillChangeList>::ptr,
Pointee(ElementsAreArray(expected_changes))))).
@@ -207,7 +207,7 @@ TEST_F(WebDataServiceAutofillTest, FormFillRemoveOne) {
};
EXPECT_CALL(
*observer_helper_->observer(),
- Observe(NotificationType(NotificationType::AUTOFILL_ENTRIES_CHANGED),
+ Observe(int(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED),
Source<WebDataService>(wds_.get()),
Property(&Details<const AutofillChangeList>::ptr,
Pointee(ElementsAreArray(expected_changes))))).
@@ -240,7 +240,7 @@ TEST_F(WebDataServiceAutofillTest, FormFillRemoveMany) {
};
EXPECT_CALL(
*observer_helper_->observer(),
- Observe(NotificationType(NotificationType::AUTOFILL_ENTRIES_CHANGED),
+ Observe(int(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED),
Source<WebDataService>(wds_.get()),
Property(&Details<const AutofillChangeList>::ptr,
Pointee(ElementsAreArray(expected_changes))))).
@@ -259,7 +259,7 @@ TEST_F(WebDataServiceAutofillTest, ProfileAdd) {
AutofillProfileChange::ADD, profile.guid(), &profile);
EXPECT_CALL(
*observer_helper_->observer(),
- Observe(NotificationType(NotificationType::AUTOFILL_PROFILE_CHANGED),
+ Observe(int(chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED),
Source<WebDataService>(wds_.get()),
Property(&Details<const AutofillProfileChange>::ptr,
Pointee(expected_change)))).
@@ -302,7 +302,7 @@ TEST_F(WebDataServiceAutofillTest, ProfileRemove) {
AutofillProfileChange::REMOVE, profile.guid(), NULL);
EXPECT_CALL(
*observer_helper_->observer(),
- Observe(NotificationType(NotificationType::AUTOFILL_PROFILE_CHANGED),
+ Observe(int(chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED),
Source<WebDataService>(wds_.get()),
Property(&Details<const AutofillProfileChange>::ptr,
Pointee(expected_change)))).
@@ -350,7 +350,7 @@ TEST_F(WebDataServiceAutofillTest, ProfileUpdate) {
EXPECT_CALL(
*observer_helper_->observer(),
- Observe(NotificationType(NotificationType::AUTOFILL_PROFILE_CHANGED),
+ Observe(int(chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED),
Source<WebDataService>(wds_.get()),
Property(&Details<const AutofillProfileChange>::ptr,
Pointee(expected_change)))).
@@ -380,7 +380,7 @@ TEST_F(WebDataServiceAutofillTest, CreditAdd) {
EXPECT_CALL(
*observer_helper_->observer(),
Observe(
- NotificationType(NotificationType::AUTOFILL_CREDIT_CARD_CHANGED),
+ int(chrome::NOTIFICATION_AUTOFILL_CREDIT_CARD_CHANGED),
Source<WebDataService>(wds_.get()),
Property(&Details<const AutofillCreditCardChange>::ptr,
Pointee(expected_change)))).
@@ -423,7 +423,7 @@ TEST_F(WebDataServiceAutofillTest, CreditCardRemove) {
EXPECT_CALL(
*observer_helper_->observer(),
Observe(
- NotificationType(NotificationType::AUTOFILL_CREDIT_CARD_CHANGED),
+ int(chrome::NOTIFICATION_AUTOFILL_CREDIT_CARD_CHANGED),
Source<WebDataService>(wds_.get()),
Property(&Details<const AutofillCreditCardChange>::ptr,
Pointee(expected_change)))).
@@ -471,7 +471,7 @@ TEST_F(WebDataServiceAutofillTest, CreditUpdate) {
EXPECT_CALL(
*observer_helper_->observer(),
Observe(
- NotificationType(NotificationType::AUTOFILL_CREDIT_CARD_CHANGED),
+ int(chrome::NOTIFICATION_AUTOFILL_CREDIT_CARD_CHANGED),
Source<WebDataService>(wds_.get()),
Property(&Details<const AutofillCreditCardChange>::ptr,
Pointee(expected_change)))).
@@ -533,7 +533,7 @@ TEST_F(WebDataServiceAutofillTest, AutofillRemoveModifiedBetween) {
AutofillProfileChange::REMOVE, profile.guid(), NULL);
EXPECT_CALL(
*observer_helper_->observer(),
- Observe(NotificationType(NotificationType::AUTOFILL_PROFILE_CHANGED),
+ Observe(int(chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED),
Source<WebDataService>(wds_.get()),
Property(&Details<const AutofillProfileChange>::ptr,
Pointee(expected_profile_change)))).
@@ -545,7 +545,7 @@ TEST_F(WebDataServiceAutofillTest, AutofillRemoveModifiedBetween) {
EXPECT_CALL(
*observer_helper_->observer(),
Observe(
- NotificationType(NotificationType::AUTOFILL_CREDIT_CARD_CHANGED),
+ int(chrome::NOTIFICATION_AUTOFILL_CREDIT_CARD_CHANGED),
Source<WebDataService>(wds_.get()),
Property(&Details<const AutofillCreditCardChange>::ptr,
Pointee(expected_card_change)))).