summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-01 20:33:18 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-01 20:33:18 +0000
commitd9e6b382fb96a52cd278324449b782829b15345e (patch)
tree3487b006f35f86897b41cddfc3a5b53d22c6f566 /chrome/browser
parent1a90589b00d23a2a42411159803649a290732058 (diff)
downloadchromium_src-d9e6b382fb96a52cd278324449b782829b15345e.zip
chromium_src-d9e6b382fb96a52cd278324449b782829b15345e.tar.gz
chromium_src-d9e6b382fb96a52cd278324449b782829b15345e.tar.bz2
Converted TalkMediator to use a delegate instead of a channel
Simplified handling of TalkMediator events. BUG=none TEST=unittests + manual testing of notifications Review URL: http://codereview.chromium.org/2232004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48652 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/sync/engine/all_status.cc47
-rw-r--r--chrome/browser/sync/engine/all_status.h16
-rw-r--r--chrome/browser/sync/engine/auth_watcher.cc2
-rw-r--r--chrome/browser/sync/engine/auth_watcher.h4
-rw-r--r--chrome/browser/sync/engine/auth_watcher_unittest.cc4
-rw-r--r--chrome/browser/sync/engine/syncapi.cc113
-rw-r--r--chrome/browser/sync/engine/syncer_thread.cc56
-rw-r--r--chrome/browser/sync/engine/syncer_thread.h11
8 files changed, 93 insertions, 160 deletions
diff --git a/chrome/browser/sync/engine/all_status.cc b/chrome/browser/sync/engine/all_status.cc
index abd0e56..68d2513a 100644
--- a/chrome/browser/sync/engine/all_status.cc
+++ b/chrome/browser/sync/engine/all_status.cc
@@ -257,38 +257,6 @@ void AllStatus::HandleServerConnectionEvent(
}
}
-void AllStatus::WatchTalkMediator(const notifier::TalkMediator* mediator) {
- status_.notifications_enabled = false;
- talk_mediator_hookup_.reset(
- NewEventListenerHookup(mediator->channel(), this,
- &AllStatus::HandleTalkMediatorEvent));
-}
-
-void AllStatus::HandleTalkMediatorEvent(
- const notifier::TalkMediatorEvent& event) {
- ScopedStatusLockWithNotify lock(this);
- switch (event.what_happened) {
- case notifier::TalkMediatorEvent::SUBSCRIPTIONS_ON:
- status_.notifications_enabled = true;
- break;
- case notifier::TalkMediatorEvent::LOGOUT_SUCCEEDED:
- case notifier::TalkMediatorEvent::SUBSCRIPTIONS_OFF:
- case notifier::TalkMediatorEvent::TALKMEDIATOR_DESTROYED:
- status_.notifications_enabled = false;
- break;
- case notifier::TalkMediatorEvent::NOTIFICATION_RECEIVED:
- status_.notifications_received++;
- break;
- case notifier::TalkMediatorEvent::NOTIFICATION_SENT:
- status_.notifications_sent++;
- break;
- case notifier::TalkMediatorEvent::LOGIN_SUCCEEDED:
- default:
- lock.set_notify_plan(DONT_NOTIFY);
- break;
- }
-}
-
AllStatus::Status AllStatus::status() const {
AutoLock lock(mutex_);
return status_;
@@ -319,6 +287,21 @@ int AllStatus::GetRecommendedDelay(int base_delay_ms) const {
return GetRecommendedDelaySeconds(base_delay_ms / 1000) * 1000;
}
+void AllStatus::SetNotificationsEnabled(bool notifications_enabled) {
+ ScopedStatusLockWithNotify lock(this);
+ status_.notifications_enabled = notifications_enabled;
+}
+
+void AllStatus::IncrementNotificationsSent() {
+ ScopedStatusLockWithNotify lock(this);
+ ++status_.notifications_sent;
+}
+
+void AllStatus::IncrementNotificationsReceived() {
+ ScopedStatusLockWithNotify lock(this);
+ ++status_.notifications_received;
+}
+
ScopedStatusLockWithNotify::ScopedStatusLockWithNotify(AllStatus* allstatus)
: allstatus_(allstatus), plan_(NOTIFY_IF_STATUS_CHANGED) {
event_.what_changed = 0;
diff --git a/chrome/browser/sync/engine/all_status.h b/chrome/browser/sync/engine/all_status.h
index 3e70119..f19d6ca 100644
--- a/chrome/browser/sync/engine/all_status.h
+++ b/chrome/browser/sync/engine/all_status.h
@@ -20,11 +20,6 @@ class GaiaAuthenticator;
struct GaiaAuthEvent;
}
-namespace notifier {
-class TalkMediator;
-struct TalkMediatorEvent;
-}
-
namespace browser_sync {
class AuthWatcher;
@@ -118,11 +113,6 @@ class AllStatus {
void WatchSyncerThread(SyncerThread* syncer_thread);
void HandleSyncerEvent(const SyncerEvent& event);
- void WatchTalkMediator(
- const notifier::TalkMediator* talk_mediator);
- void HandleTalkMediatorEvent(
- const notifier::TalkMediatorEvent& event);
-
// Returns a string description of the SyncStatus (currently just the ascii
// version of the enum). Will LOG(FATAL) if the status us out of range.
static const char* GetSyncStatusString(SyncStatus status);
@@ -137,6 +127,12 @@ class AllStatus {
// This uses AllStatus' max_consecutive_errors as the error count
int GetRecommendedDelay(int base_delay) const;
+ void SetNotificationsEnabled(bool notifications_enabled);
+
+ void IncrementNotificationsSent();
+
+ void IncrementNotificationsReceived();
+
protected:
typedef std::map<Syncer*, EventListenerHookup*> Syncers;
diff --git a/chrome/browser/sync/engine/auth_watcher.cc b/chrome/browser/sync/engine/auth_watcher.cc
index e75b6de..e674ab3 100644
--- a/chrome/browser/sync/engine/auth_watcher.cc
+++ b/chrome/browser/sync/engine/auth_watcher.cc
@@ -40,7 +40,6 @@ namespace browser_sync {
AuthWatcher::AuthWatcher(DirectoryManager* dirman,
ServerConnectionManager* scm,
- AllStatus* allstatus,
const string& user_agent,
const string& service_id,
const string& gaia_url,
@@ -50,7 +49,6 @@ AuthWatcher::AuthWatcher(DirectoryManager* dirman,
: gaia_(gaia_auth),
dirman_(dirman),
scm_(scm),
- allstatus_(allstatus),
status_(NOT_AUTHENTICATED),
user_settings_(user_settings),
talk_mediator_(talk_mediator),
diff --git a/chrome/browser/sync/engine/auth_watcher.h b/chrome/browser/sync/engine/auth_watcher.h
index 5649136..60f3ed8 100644
--- a/chrome/browser/sync/engine/auth_watcher.h
+++ b/chrome/browser/sync/engine/auth_watcher.h
@@ -32,7 +32,6 @@ class DirectoryManager;
namespace browser_sync {
-class AllStatus;
class AuthWatcher;
class ServerConnectionManager;
class URLFactory;
@@ -89,7 +88,6 @@ class AuthWatcher : public base::RefCountedThreadSafe<AuthWatcher> {
AuthWatcher(DirectoryManager* dirman,
ServerConnectionManager* scm,
- AllStatus* allstatus,
const std::string& user_agent,
const std::string& service_id,
const std::string& gaia_url,
@@ -138,7 +136,6 @@ class AuthWatcher : public base::RefCountedThreadSafe<AuthWatcher> {
std::string email() const;
syncable::DirectoryManager* dirman() const { return dirman_; }
ServerConnectionManager* scm() const { return scm_; }
- AllStatus* allstatus() const { return allstatus_; }
UserSettings* settings() const { return user_settings_; }
Status status() const { return (Status)status_; }
@@ -207,7 +204,6 @@ class AuthWatcher : public base::RefCountedThreadSafe<AuthWatcher> {
syncable::DirectoryManager* const dirman_;
ServerConnectionManager* const scm_;
scoped_ptr<EventListenerHookup> connmgr_hookup_;
- AllStatus* const allstatus_;
Status status_;
UserSettings* const user_settings_;
// Interface to the notifications engine.
diff --git a/chrome/browser/sync/engine/auth_watcher_unittest.cc b/chrome/browser/sync/engine/auth_watcher_unittest.cc
index 9a33e59..eb39772 100644
--- a/chrome/browser/sync/engine/auth_watcher_unittest.cc
+++ b/chrome/browser/sync/engine/auth_watcher_unittest.cc
@@ -93,7 +93,6 @@ class AuthWatcherTest : public testing::Test {
// Mock out data that would normally be sent back from a server.
connection()->SetAuthenticationResponseInfo(kValidAuthToken,
kUserDisplayName, kUserDisplayEmail, "ID");
- allstatus_.reset(new AllStatus());
user_settings_.reset(new UserSettings());
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
FilePath user_settings_path = temp_dir_.path().Append(kUserSettingsDB);
@@ -103,7 +102,7 @@ class AuthWatcherTest : public testing::Test {
talk_mediator_.reset(new notifier::TalkMediatorImpl(
&fake_network_change_notifier_thread_, false));
auth_watcher_ = new AuthWatcher(metadb_.manager(), connection_.get(),
- allstatus_.get(), kTestUserAgent, kTestServiceId, kTestGaiaURL,
+ kTestUserAgent, kTestServiceId, kTestGaiaURL,
user_settings_.get(), gaia_auth_, talk_mediator_.get());
authwatcher_hookup_.reset(NewEventListenerHookup(auth_watcher_->channel(),
this, &AuthWatcherTest::HandleAuthWatcherEvent));
@@ -150,7 +149,6 @@ class AuthWatcherTest : public testing::Test {
// The sync engine pieces necessary to run an AuthWatcher.
TriggeredOpenTestDirectorySetterUpper metadb_;
scoped_ptr<MockConnectionManager> connection_;
- scoped_ptr<AllStatus> allstatus_;
scoped_ptr<UserSettings> user_settings_;
GaiaAuthMockForAuthWatcher* gaia_auth_; // Owned by auth_watcher_.
scoped_ptr<notifier::TalkMediator> talk_mediator_;
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index e052bc6..b35a549 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -69,7 +69,6 @@ using browser_sync::UserSettings;
using browser_sync::sessions::SyncSessionContext;
using notifier::TalkMediator;
using notifier::TalkMediatorImpl;
-using notifier::TalkMediatorEvent;
using std::list;
using std::hex;
using std::string;
@@ -769,7 +768,8 @@ class BridgedGaiaAuthenticator : public gaia::GaiaAuthenticator {
//////////////////////////////////////////////////////////////////////////
// SyncManager's implementation: SyncManager::SyncInternal
class SyncManager::SyncInternal
- : public net::NetworkChangeNotifier::Observer {
+ : public net::NetworkChangeNotifier::Observer,
+ public TalkMediator::Delegate {
static const int kDefaultNudgeDelayMilliseconds;
static const int kPreferencesNudgeDelayMilliseconds;
public:
@@ -844,9 +844,15 @@ class SyncManager::SyncInternal
// on startup, to serve our UI needs.
void HandleAuthWatcherEvent(const AuthWatcherEvent& event);
- // We listen to TalkMediator events so that we can send an
- // XMPP notification when subscriptions are on.
- void HandleTalkMediatorEvent(const TalkMediatorEvent& event);
+ // TalkMediator::Delegate implementation.
+
+ virtual void OnNotificationStateChange(
+ bool notifications_enabled);
+
+ virtual void OnIncomingNotification(
+ const IncomingNotificationData& notification_data);
+
+ virtual void OnOutgoingNotification();
// Accessors for the private members.
DirectoryManager* dir_manager() { return share_.dir_manager.get(); }
@@ -856,7 +862,6 @@ class SyncManager::SyncInternal
SyncerThread* syncer_thread() { return syncer_thread_.get(); }
TalkMediator* talk_mediator() { return talk_mediator_.get(); }
AuthWatcher* auth_watcher() { return auth_watcher_.get(); }
- AllStatus* allstatus() { return &allstatus_; }
void set_observer(SyncManager::Observer* observer) { observer_ = observer; }
UserShare* GetUserShare() { return &share_; }
@@ -1019,9 +1024,6 @@ class SyncManager::SyncInternal
// Notification (xmpp) handler.
scoped_ptr<TalkMediator> talk_mediator_;
- // XMPP notifications event handler
- scoped_ptr<EventListenerHookup> talk_mediator_hookup_;
-
// A multi-purpose status watch object that aggregates stats from various
// sync components.
AllStatus allstatus_;
@@ -1189,7 +1191,7 @@ bool SyncManager::SyncInternal::Init(
post_factory));
// Watch various objects for aggregated status.
- allstatus()->WatchConnectionManager(connection_manager());
+ allstatus_.WatchConnectionManager(connection_manager());
network_change_notifier_.reset(
new chrome_common_net::NetworkChangeNotifierProxy(
@@ -1208,13 +1210,9 @@ bool SyncManager::SyncInternal::Init(
}
talk_mediator_->AddSubscribedServiceUrl(browser_sync::kSyncServiceUrl);
}
- allstatus()->WatchTalkMediator(talk_mediator());
// Listen to TalkMediator events ourselves
- talk_mediator_hookup_.reset(
- NewEventListenerHookup(talk_mediator_->channel(),
- this,
- &SyncInternal::HandleTalkMediatorEvent));
+ talk_mediator_->SetDelegate(this);
std::string gaia_url = gaia::kGaiaUrl;
const char* service_id = gaia_service_id ?
@@ -1227,7 +1225,6 @@ bool SyncManager::SyncInternal::Init(
auth_watcher_ = new AuthWatcher(dir_manager(),
connection_manager(),
- &allstatus_,
gaia_source,
service_id,
gaia_url,
@@ -1235,7 +1232,7 @@ bool SyncManager::SyncInternal::Init(
gaia_auth,
talk_mediator());
- allstatus()->WatchAuthWatcher(auth_watcher());
+ allstatus_.WatchAuthWatcher(auth_watcher());
authwatcher_hookup_.reset(NewEventListenerHookup(auth_watcher_->channel(),
this, &SyncInternal::HandleAuthWatcherEvent));
@@ -1246,8 +1243,7 @@ bool SyncManager::SyncInternal::Init(
// The SyncerThread takes ownership of |context|.
syncer_thread_ = new SyncerThread(context, &allstatus_);
- syncer_thread()->WatchTalkMediator(talk_mediator());
- allstatus()->WatchSyncerThread(syncer_thread());
+ allstatus_.WatchSyncerThread(syncer_thread());
// Subscribe to the syncer thread's channel.
syncer_event_.reset(
@@ -1323,7 +1319,7 @@ void SyncManager::SyncInternal::Authenticate(const std::string& username,
const std::string& captcha) {
DCHECK(username_for_share().empty() || username == username_for_share())
<< "Username change from valid username detected";
- if (allstatus()->status().authenticated)
+ if (allstatus_.status().authenticated)
return;
if (password.empty()) {
// TODO(timsteele): Seems like this shouldn't be needed, but auth_watcher
@@ -1572,7 +1568,7 @@ void SyncManager::SyncInternal::HandleCalculateChangesChangeEventFromSyncer(
SyncManager::Status::Summary
SyncManager::SyncInternal::ComputeAggregatedStatusSummary() {
- switch (allstatus()->status().icon) {
+ switch (allstatus_.status().icon) {
case AllStatus::OFFLINE:
return Status::OFFLINE;
case AllStatus::OFFLINE_UNSYNCED:
@@ -1593,23 +1589,23 @@ SyncManager::SyncInternal::ComputeAggregatedStatusSummary() {
SyncManager::Status SyncManager::SyncInternal::ComputeAggregatedStatus() {
Status return_status =
{ ComputeAggregatedStatusSummary(),
- allstatus()->status().authenticated,
- allstatus()->status().server_up,
- allstatus()->status().server_reachable,
- allstatus()->status().server_broken,
- allstatus()->status().notifications_enabled,
- allstatus()->status().notifications_received,
- allstatus()->status().notifications_sent,
- allstatus()->status().unsynced_count,
- allstatus()->status().conflicting_count,
- allstatus()->status().syncing,
- allstatus()->status().initial_sync_ended,
- allstatus()->status().syncer_stuck,
- allstatus()->status().updates_available,
- allstatus()->status().updates_received,
- allstatus()->status().disk_full,
+ allstatus_.status().authenticated,
+ allstatus_.status().server_up,
+ allstatus_.status().server_reachable,
+ allstatus_.status().server_broken,
+ allstatus_.status().notifications_enabled,
+ allstatus_.status().notifications_received,
+ allstatus_.status().notifications_sent,
+ allstatus_.status().unsynced_count,
+ allstatus_.status().conflicting_count,
+ allstatus_.status().syncing,
+ allstatus_.status().initial_sync_ended,
+ allstatus_.status().syncer_stuck,
+ allstatus_.status().updates_available,
+ allstatus_.status().updates_received,
+ allstatus_.status().disk_full,
false, // TODO(ncarter): invalid store?
- allstatus()->status().max_consecutive_errors};
+ allstatus_.status().max_consecutive_errors};
return return_status;
}
@@ -1758,18 +1754,45 @@ void SyncManager::SyncInternal::HandleAuthWatcherEvent(
observer_->OnAuthError(AuthError(auth_problem_));
}
-void SyncManager::SyncInternal::HandleTalkMediatorEvent(
- const TalkMediatorEvent& event) {
- // Send a notification as soon as subscriptions are on.
- // This is to fix Bug 38563.
- // See http://code.google.com/p/chromium/issues/detail?id=38563.
- // This was originally fixed in http://codereview.chromium.org/1545024
- // but it got moved here when the refactoring of TalkMediator happened.
- if (event.what_happened == TalkMediatorEvent::SUBSCRIPTIONS_ON) {
+void SyncManager::SyncInternal::OnNotificationStateChange(
+ bool notifications_enabled) {
+ LOG(INFO) << "P2P: Notifications enabled = "
+ << (notifications_enabled ? "true" : "false");
+ allstatus_.SetNotificationsEnabled(notifications_enabled);
+ if (syncer_thread()) {
+ syncer_thread()->SetNotificationsEnabled(notifications_enabled);
+ }
+ if (notifications_enabled) {
+ // Send a notification as soon as subscriptions are on
+ // (see http://code.google.com/p/chromium/issues/detail?id=38563 ).
SendXMPPNotification();
}
}
+void SyncManager::SyncInternal::OnIncomingNotification(
+ const IncomingNotificationData& notification_data) {
+ // Check if the service url is a sync URL. An empty service URL
+ // is treated as a legacy sync notification
+ if (notification_data.service_url.empty() ||
+ (notification_data.service_url ==
+ browser_sync::kSyncLegacyServiceUrl) ||
+ (notification_data.service_url ==
+ browser_sync::kSyncServiceUrl)) {
+ LOG(INFO) << "P2P: Updates on server, pushing syncer";
+ if (syncer_thread()) {
+ syncer_thread()->NudgeSyncer(0, SyncerThread::kNotification);
+ }
+ allstatus_.IncrementNotificationsReceived();
+ } else {
+ LOG(WARNING) << "Notification fron unexpected source: "
+ << notification_data.service_url;
+ }
+}
+
+void SyncManager::SyncInternal::OnOutgoingNotification() {
+ allstatus_.IncrementNotificationsSent();
+}
+
SyncManager::Status::Summary SyncManager::GetStatusSummary() const {
return data_->ComputeAggregatedStatusSummary();
}
diff --git a/chrome/browser/sync/engine/syncer_thread.cc b/chrome/browser/sync/engine/syncer_thread.cc
index c543f6a..ed8b023 100644
--- a/chrome/browser/sync/engine/syncer_thread.cc
+++ b/chrome/browser/sync/engine/syncer_thread.cc
@@ -16,7 +16,6 @@
#include <queue>
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
-#include "chrome/browser/sync/sync_constants.h"
#include "chrome/browser/sync/engine/auth_watcher.h"
#include "chrome/browser/sync/engine/model_safe_worker.h"
#include "chrome/browser/sync/engine/net/server_connection_manager.h"
@@ -24,8 +23,6 @@
#include "chrome/browser/sync/syncable/directory_manager.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/net/notifier/listener/notification_constants.h"
-#include "chrome/common/net/notifier/listener/talk_mediator.h"
-#include "chrome/common/net/notifier/listener/talk_mediator_impl.h"
using std::priority_queue;
using std::min;
@@ -72,7 +69,6 @@ SyncerThread::SyncerThread(sessions::SyncSessionContext* context,
syncer_long_poll_interval_seconds_(kDefaultLongPollIntervalSeconds),
syncer_polling_interval_(kDefaultShortPollIntervalSeconds),
syncer_max_interval_(kDefaultMaxPollIntervalMs),
- talk_mediator_hookup_(NULL),
directory_manager_hookup_(NULL),
syncer_events_(NULL),
session_context_(context),
@@ -98,7 +94,6 @@ SyncerThread::~SyncerThread() {
directory_manager_hookup_.reset();
syncer_events_.reset();
delete vault_.syncer_;
- talk_mediator_hookup_.reset();
CHECK(!thread_.IsRunning());
}
@@ -602,56 +597,9 @@ void SyncerThread::NudgeSyncImpl(int milliseconds_from_now,
vault_field_changed_.Broadcast();
}
-void SyncerThread::WatchTalkMediator(notifier::TalkMediator* mediator) {
- talk_mediator_hookup_.reset(
- NewEventListenerHookup(
- mediator->channel(),
- this,
- &SyncerThread::HandleTalkMediatorEvent));
-}
-
-void SyncerThread::HandleTalkMediatorEvent(
- const notifier::TalkMediatorEvent& event) {
+void SyncerThread::SetNotificationsEnabled(bool notifications_enabled) {
AutoLock lock(lock_);
- switch (event.what_happened) {
- case notifier::TalkMediatorEvent::LOGIN_SUCCEEDED:
- LOG(INFO) << "P2P: Login succeeded.";
- p2p_authenticated_ = true;
- break;
- case notifier::TalkMediatorEvent::LOGOUT_SUCCEEDED:
- LOG(INFO) << "P2P: Login succeeded.";
- p2p_authenticated_ = false;
- break;
- case notifier::TalkMediatorEvent::SUBSCRIPTIONS_ON:
- LOG(INFO) << "P2P: Subscriptions successfully enabled.";
- p2p_subscribed_ = true;
- if (NULL != vault_.syncer_) {
- LOG(INFO) << "Subscriptions on. Nudging syncer for initial push.";
- NudgeSyncImpl(0, kLocal);
- }
- break;
- case notifier::TalkMediatorEvent::SUBSCRIPTIONS_OFF:
- LOG(INFO) << "P2P: Subscriptions are not enabled.";
- p2p_subscribed_ = false;
- break;
- case notifier::TalkMediatorEvent::NOTIFICATION_RECEIVED:
- // Check if the service url is a sync URL. An empty service URL
- // is treated as a legacy sync notification
- if (event.notification_data.service_url.empty() ||
- (event.notification_data.service_url == kSyncLegacyServiceUrl) ||
- (event.notification_data.service_url == kSyncServiceUrl)) {
- LOG(INFO) << "P2P: Updates on server, pushing syncer";
- if (NULL != vault_.syncer_) {
- NudgeSyncImpl(0, kNotification);
- }
- }
- break;
- default:
- break;
- }
-
- session_context_->set_notifications_enabled(p2p_authenticated_ &&
- p2p_subscribed_);
+ session_context_->set_notifications_enabled(notifications_enabled);
}
// Returns the amount of time since the user last interacted with the computer,
diff --git a/chrome/browser/sync/engine/syncer_thread.h b/chrome/browser/sync/engine/syncer_thread.h
index ac1ea7b..5a34b97 100644
--- a/chrome/browser/sync/engine/syncer_thread.h
+++ b/chrome/browser/sync/engine/syncer_thread.h
@@ -30,10 +30,6 @@
class EventListenerHookup;
-namespace notifier {
-class TalkMediator;
-}
-
namespace syncable {
class DirectoryManager;
struct DirectoryManagerEvent;
@@ -48,7 +44,6 @@ class URLFactory;
struct ServerConnectionEvent;
struct SyncerEvent;
struct SyncerShutdownEvent;
-struct TalkMediatorEvent;
class SyncerThread : public base::RefCountedThreadSafe<SyncerThread>,
public sessions::SyncSession::Delegate {
@@ -134,8 +129,7 @@ class SyncerThread : public base::RefCountedThreadSafe<SyncerThread>,
// from the SyncerThread's controller and will cause a mutex lock.
virtual void NudgeSyncer(int milliseconds_from_now, NudgeSource source);
- // Registers this thread to watch talk mediator events.
- virtual void WatchTalkMediator(notifier::TalkMediator* talk_mediator);
+ void SetNotificationsEnabled(bool notifications_enabled);
virtual SyncerEventChannel* relay_channel();
@@ -238,8 +232,6 @@ class SyncerThread : public base::RefCountedThreadSafe<SyncerThread>,
void HandleServerConnectionEvent(const ServerConnectionEvent& event);
- void HandleTalkMediatorEvent(const notifier::TalkMediatorEvent& event);
-
void SyncMain(Syncer* syncer);
// Calculates the next sync wait time and exponential backoff state.
@@ -309,7 +301,6 @@ class SyncerThread : public base::RefCountedThreadSafe<SyncerThread>,
// this is called.
void NudgeSyncImpl(int milliseconds_from_now, NudgeSource source);
- scoped_ptr<EventListenerHookup> talk_mediator_hookup_;
scoped_ptr<EventListenerHookup> directory_manager_hookup_;
scoped_ptr<EventListenerHookup> syncer_events_;