diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-19 23:17:07 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-19 23:17:07 +0000 |
commit | ad50def5e1165d0cc74b98f988bbd5962587d9f4 (patch) | |
tree | 3a751abaed2cc056ca60b8b1e3ff54532a6f4d3f /chrome/browser/password_manager | |
parent | 75c920505ddfb2d49c194c76bde64edd6b3f91f2 (diff) | |
download | chromium_src-ad50def5e1165d0cc74b98f988bbd5962587d9f4.zip chromium_src-ad50def5e1165d0cc74b98f988bbd5962587d9f4.tar.gz chromium_src-ad50def5e1165d0cc74b98f988bbd5962587d9f4.tar.bz2 |
Make NotificationService an interface in the content namespace, and switch callers to use it. Move the implementation to content/browser. Stop creating it in all child processes since it's only used in the browser.
BUG=98716
Review URL: http://codereview.chromium.org/8342048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106403 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/password_manager')
4 files changed, 20 insertions, 17 deletions
diff --git a/chrome/browser/password_manager/password_store_default.cc b/chrome/browser/password_manager/password_store_default.cc index e35ce20..c30dd2f 100644 --- a/chrome/browser/password_manager/password_store_default.cc +++ b/chrome/browser/password_manager/password_store_default.cc @@ -16,7 +16,7 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" #include "content/browser/browser_thread.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" using webkit_glue::PasswordForm; @@ -130,7 +130,7 @@ void PasswordStoreDefault::AddLoginImpl(const PasswordForm& form) { if (login_db_->AddLogin(form)) { PasswordStoreChangeList changes; changes.push_back(PasswordStoreChange(PasswordStoreChange::ADD, form)); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGINS_CHANGED, content::Source<PasswordStore>(this), content::Details<PasswordStoreChangeList>(&changes)); @@ -141,7 +141,7 @@ void PasswordStoreDefault::UpdateLoginImpl(const PasswordForm& form) { if (login_db_->UpdateLogin(form, NULL)) { PasswordStoreChangeList changes; changes.push_back(PasswordStoreChange(PasswordStoreChange::UPDATE, form)); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGINS_CHANGED, content::Source<PasswordStore>(this), content::Details<PasswordStoreChangeList>(&changes)); @@ -152,7 +152,7 @@ void PasswordStoreDefault::RemoveLoginImpl(const PasswordForm& form) { if (login_db_->RemoveLogin(form)) { PasswordStoreChangeList changes; changes.push_back(PasswordStoreChange(PasswordStoreChange::REMOVE, form)); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGINS_CHANGED, content::Source<PasswordStore>(this), content::Details<PasswordStoreChangeList>(&changes)); @@ -170,7 +170,7 @@ void PasswordStoreDefault::RemoveLoginsCreatedBetweenImpl( changes.push_back(PasswordStoreChange(PasswordStoreChange::REMOVE, **it)); } - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGINS_CHANGED, content::Source<PasswordStore>(this), content::Details<PasswordStoreChangeList>(&changes)); diff --git a/chrome/browser/password_manager/password_store_mac.cc b/chrome/browser/password_manager/password_store_mac.cc index 81f1b55..43423cb 100644 --- a/chrome/browser/password_manager/password_store_mac.cc +++ b/chrome/browser/password_manager/password_store_mac.cc @@ -21,7 +21,7 @@ #include "chrome/browser/password_manager/login_database.h" #include "chrome/browser/password_manager/password_store_change.h" #include "chrome/common/chrome_notification_types.h" -#include "content/common/notification_service.h" +#include "content/browser/notification_service_impl.h" using webkit_glue::PasswordForm; @@ -775,7 +775,7 @@ void PasswordStoreMac::AddLoginImpl(const PasswordForm& form) { if (login_metadata_db_->AddLogin(form)) { PasswordStoreChangeList changes; changes.push_back(PasswordStoreChange(PasswordStoreChange::ADD, form)); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGINS_CHANGED, content::Source<PasswordStore>(this), content::Details<PasswordStoreChangeList>(&changes)); @@ -810,7 +810,7 @@ void PasswordStoreMac::UpdateLoginImpl(const PasswordForm& form) { form)); } if (!changes.empty()) { - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGINS_CHANGED, content::Source<PasswordStore>(this), content::Details<PasswordStoreChangeList>(&changes)); @@ -841,7 +841,7 @@ void PasswordStoreMac::RemoveLoginImpl(const PasswordForm& form) { PasswordStoreChangeList changes; changes.push_back(PasswordStoreChange(PasswordStoreChange::REMOVE, form)); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGINS_CHANGED, content::Source<PasswordStore>(this), content::Details<PasswordStoreChangeList>(&changes)); @@ -875,7 +875,7 @@ void PasswordStoreMac::RemoveLoginsCreatedBetweenImpl( changes.push_back(PasswordStoreChange(PasswordStoreChange::REMOVE, **it)); } - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGINS_CHANGED, content::Source<PasswordStore>(this), content::Details<PasswordStoreChangeList>(&changes)); @@ -1013,5 +1013,5 @@ void PasswordStoreMac::RemoveKeychainForms( } void PasswordStoreMac::CreateNotificationService() { - notification_service_.reset(new NotificationService); + notification_service_.reset(new NotificationServiceImpl); } diff --git a/chrome/browser/password_manager/password_store_mac.h b/chrome/browser/password_manager/password_store_mac.h index 3ee8339..cfd7297 100644 --- a/chrome/browser/password_manager/password_store_mac.h +++ b/chrome/browser/password_manager/password_store_mac.h @@ -15,7 +15,10 @@ #include "chrome/browser/password_manager/password_store.h" class MacKeychain; + +namespace content { class NotificationService; +} // Implements PasswordStore on top of the OS X Keychain, with an internal // database for extra metadata. For an overview of the interactions with the @@ -89,7 +92,7 @@ class PasswordStoreMac : public PasswordStore { // Since we aren't running on a well-known thread but still want to send out // notifications, we need to run our own service. - scoped_ptr<NotificationService> notification_service_; + scoped_ptr<content::NotificationService> notification_service_; DISALLOW_COPY_AND_ASSIGN(PasswordStoreMac); }; diff --git a/chrome/browser/password_manager/password_store_x.cc b/chrome/browser/password_manager/password_store_x.cc index f0e2319..c011ade 100644 --- a/chrome/browser/password_manager/password_store_x.cc +++ b/chrome/browser/password_manager/password_store_x.cc @@ -16,7 +16,7 @@ #include "chrome/common/pref_names.h" #include "content/browser/browser_thread.h" #include "chrome/common/chrome_notification_types.h" -#include "content/common/notification_service.h" +#include "content/public/browser/notification_service.h" using std::vector; using webkit_glue::PasswordForm; @@ -37,7 +37,7 @@ void PasswordStoreX::AddLoginImpl(const PasswordForm& form) { if (use_native_backend() && backend_->AddLogin(form)) { PasswordStoreChangeList changes; changes.push_back(PasswordStoreChange(PasswordStoreChange::ADD, form)); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGINS_CHANGED, content::Source<PasswordStore>(this), content::Details<PasswordStoreChangeList>(&changes)); @@ -52,7 +52,7 @@ void PasswordStoreX::UpdateLoginImpl(const PasswordForm& form) { if (use_native_backend() && backend_->UpdateLogin(form)) { PasswordStoreChangeList changes; changes.push_back(PasswordStoreChange(PasswordStoreChange::UPDATE, form)); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGINS_CHANGED, content::Source<PasswordStore>(this), content::Details<PasswordStoreChangeList>(&changes)); @@ -67,7 +67,7 @@ void PasswordStoreX::RemoveLoginImpl(const PasswordForm& form) { if (use_native_backend() && backend_->RemoveLogin(form)) { PasswordStoreChangeList changes; changes.push_back(PasswordStoreChange(PasswordStoreChange::REMOVE, form)); - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGINS_CHANGED, content::Source<PasswordStore>(this), content::Details<PasswordStoreChangeList>(&changes)); @@ -91,7 +91,7 @@ void PasswordStoreX::RemoveLoginsCreatedBetweenImpl( changes.push_back(PasswordStoreChange(PasswordStoreChange::REMOVE, **it)); } - NotificationService::current()->Notify( + content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGINS_CHANGED, content::Source<PasswordStore>(this), content::Details<PasswordStoreChangeList>(&changes)); |