summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/glue
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 18:13:03 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 18:13:03 +0000
commitac45ac54f31e5dd64a089b432525ecd8fab5e086 (patch)
tree9f06f6f3cb40dad1f618a32b52949fbbcbf89821 /chrome/browser/sync/glue
parent5d0f1d9523731593681d014d9534b244be0df5a0 (diff)
downloadchromium_src-ac45ac54f31e5dd64a089b432525ecd8fab5e086.zip
chromium_src-ac45ac54f31e5dd64a089b432525ecd8fab5e086.tar.gz
chromium_src-ac45ac54f31e5dd64a089b432525ecd8fab5e086.tar.bz2
Add Sources to several notifications.
BUG=none TEST=sync_integration_tests Review URL: http://codereview.chromium.org/3400011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59820 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/glue')
-rw-r--r--chrome/browser/sync/glue/data_type_manager_impl.cc4
-rw-r--r--chrome/browser/sync/glue/data_type_manager_mock.h17
-rw-r--r--chrome/browser/sync/glue/sync_backend_host.cc4
3 files changed, 16 insertions, 9 deletions
diff --git a/chrome/browser/sync/glue/data_type_manager_impl.cc b/chrome/browser/sync/glue/data_type_manager_impl.cc
index d170ec3..2266a3f 100644
--- a/chrome/browser/sync/glue/data_type_manager_impl.cc
+++ b/chrome/browser/sync/glue/data_type_manager_impl.cc
@@ -412,14 +412,14 @@ void DataTypeManagerImpl::RemoveObserver(NotificationType type) {
void DataTypeManagerImpl::NotifyStart() {
NotificationService::current()->Notify(
NotificationType::SYNC_CONFIGURE_START,
- NotificationService::AllSources(),
+ Source<DataTypeManager>(this),
NotificationService::NoDetails());
}
void DataTypeManagerImpl::NotifyDone(ConfigureResult result) {
NotificationService::current()->Notify(
NotificationType::SYNC_CONFIGURE_DONE,
- NotificationService::AllSources(),
+ Source<DataTypeManager>(this),
Details<ConfigureResult>(&result));
}
diff --git a/chrome/browser/sync/glue/data_type_manager_mock.h b/chrome/browser/sync/glue/data_type_manager_mock.h
index ce61e27..2a1705a 100644
--- a/chrome/browser/sync/glue/data_type_manager_mock.h
+++ b/chrome/browser/sync/glue/data_type_manager_mock.h
@@ -13,13 +13,19 @@
#include "chrome/common/notification_type.h"
#include "testing/gmock/include/gmock/gmock.h"
-ACTION_P2(NotifyWithResult, type, result) {
+ACTION_P3(NotifyFromDataTypeManagerWithResult, dtm, type, result) {
NotificationService::current()->Notify(
type,
- NotificationService::AllSources(),
+ Source<browser_sync::DataTypeManager>(dtm),
Details<browser_sync::DataTypeManager::ConfigureResult>(result));
}
+ACTION_P2(NotifyFromDataTypeManager, dtm, type) {
+ NotificationService::current()->Notify(type,
+ Source<browser_sync::DataTypeManager>(dtm),
+ NotificationService::NoDetails());
+}
+
namespace browser_sync {
class DataTypeManagerMock : public DataTypeManager {
@@ -30,9 +36,10 @@ class DataTypeManagerMock : public DataTypeManager {
// detail.
ON_CALL(*this, Configure(testing::_)).
WillByDefault(testing::DoAll(
- Notify(NotificationType::SYNC_CONFIGURE_START),
- NotifyWithResult(NotificationType::SYNC_CONFIGURE_DONE,
- &result_)));
+ NotifyFromDataTypeManager(this,
+ NotificationType::SYNC_CONFIGURE_START),
+ NotifyFromDataTypeManagerWithResult
+ (this, NotificationType::SYNC_CONFIGURE_DONE, &result_)));
}
MOCK_METHOD1(Configure, void(const TypeSet&));
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index 56c8b86..1df0905 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -337,7 +337,7 @@ void SyncBackendHost::Core::NotifyResumed() {
void SyncBackendHost::Core::NotifyPassphraseRequired() {
NotificationService::current()->Notify(
NotificationType::SYNC_PASSPHRASE_REQUIRED,
- NotificationService::AllSources(),
+ Source<SyncBackendHost>(host_),
NotificationService::NoDetails());
}
@@ -346,7 +346,7 @@ void SyncBackendHost::Core::NotifyPassphraseAccepted(
host_->PersistEncryptionBootstrapToken(bootstrap_token);
NotificationService::current()->Notify(
NotificationType::SYNC_PASSPHRASE_ACCEPTED,
- NotificationService::AllSources(),
+ Source<SyncBackendHost>(host_),
NotificationService::NoDetails());
}