summaryrefslogtreecommitdiffstats
path: root/chrome/service
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-16 17:12:08 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-16 17:12:08 +0000
commit0590a140d2291f2aebfb54179f1282d798faa6a8 (patch)
treecc8eba1baa094554d03b3727d12cf1f3ab1f95fc /chrome/service
parent37b01e6d24bf3c251708cff470b65b2574c582b5 (diff)
downloadchromium_src-0590a140d2291f2aebfb54179f1282d798faa6a8.zip
chromium_src-0590a140d2291f2aebfb54179f1282d798faa6a8.tar.gz
chromium_src-0590a140d2291f2aebfb54179f1282d798faa6a8.tar.bz2
[Sync] Merged MediatorThread and PushNotificationsThread
Removed most of the legacy XMPP notification code. Simplified notification structs and calls a bit. BUG=76130 TEST= Review URL: http://codereview.chromium.org/6693007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78385 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service')
-rw-r--r--chrome/service/cloud_print/cloud_print_proxy_backend.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.cc b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
index e9d05c3..68bc366 100644
--- a/chrome/service/cloud_print/cloud_print_proxy_backend.cc
+++ b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
@@ -24,7 +24,7 @@
#include "googleurl/src/gurl.h"
#include "grit/generated_resources.h"
#include "jingle/notifier/base/notifier_options.h"
-#include "jingle/notifier/listener/push_notifications_thread.h"
+#include "jingle/notifier/listener/mediator_thread_impl.h"
#include "jingle/notifier/listener/talk_mediator_impl.h"
#include "net/url_request/url_request_status.h"
#include "ui/base/l10n/l10n_util.h"
@@ -87,7 +87,7 @@ class CloudPrintProxyBackend::Core
virtual void OnNotificationStateChange(
bool notifications_enabled);
virtual void OnIncomingNotification(
- const IncomingNotificationData& notification_data);
+ const notifier::Notification& notification);
virtual void OnOutgoingNotification();
private:
@@ -375,15 +375,15 @@ void CloudPrintProxyBackend::Core::DoInitializeWithToken(
const bool kInvalidateXmppAuthToken = false;
const bool kAllowInsecureXmppConnection = false;
talk_mediator_.reset(new notifier::TalkMediatorImpl(
- new notifier::PushNotificationsThread(
- kNotifierOptions,
- kCloudPrintPushNotificationsSource),
+ new notifier::MediatorThreadImpl(kNotifierOptions),
kInvalidateXmppAuthToken,
kAllowInsecureXmppConnection));
- push_notifications_channel_ = kCloudPrintPushNotificationsSource;
- push_notifications_channel_.append("/proxy/");
- push_notifications_channel_.append(proxy_id);
- talk_mediator_->AddSubscribedServiceUrl(push_notifications_channel_);
+ notifier::Subscription subscription;
+ subscription.channel = kCloudPrintPushNotificationsSource;
+ subscription.channel.append("/proxy/");
+ subscription.channel.append(proxy_id);
+ subscription.from = kCloudPrintPushNotificationsSource;
+ talk_mediator_->AddSubscription(subscription);
talk_mediator_->SetDelegate(this);
talk_mediator_->SetAuthToken(email, cloud_print_xmpp_token,
kSyncGaiaServiceId);
@@ -902,12 +902,12 @@ void CloudPrintProxyBackend::Core::OnNotificationStateChange(
void CloudPrintProxyBackend::Core::OnIncomingNotification(
- const IncomingNotificationData& notification_data) {
+ const notifier::Notification& notification) {
DCHECK(MessageLoop::current() == backend_->core_thread_.message_loop());
VLOG(1) << "CP_PROXY: Incoming notification.";
if (0 == base::strcasecmp(push_notifications_channel_.c_str(),
- notification_data.service_url.c_str()))
- HandlePrinterNotification(notification_data.service_specific_data);
+ notification.channel.c_str()))
+ HandlePrinterNotification(notification.data);
}
void CloudPrintProxyBackend::Core::OnOutgoingNotification() {}