summaryrefslogtreecommitdiffstats
path: root/chrome/service/cloud_print
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-22 05:25:29 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-22 05:25:29 +0000
commit8cd2caff620e9a28c8afa78d2fe9fc6f153f6a78 (patch)
treed1ec54520d1faac609dc14db24e6efc4d82c7fa9 /chrome/service/cloud_print
parenteda9b15026bcaf66cfbf99c4f54ebf4667fcc1ed (diff)
downloadchromium_src-8cd2caff620e9a28c8afa78d2fe9fc6f153f6a78.zip
chromium_src-8cd2caff620e9a28c8afa78d2fe9fc6f153f6a78.tar.gz
chromium_src-8cd2caff620e9a28c8afa78d2fe9fc6f153f6a78.tar.bz2
Revert 138216 - [Sync] Turn notifier::PushClient into an interface
Split the previous implementation into two pieces: XmppPushClient and NonBlockingPushClient. Add FakePushClient and FakePushClientObserver. Remove use of ThreadSafeObserverList. Add PushClient::CreateDefault() function, which creates a NonBlockingPushClient for an XmppPushClient. Dep-inject PushClient into P2PNotifier. Add some helper functions to notification_defines.{h,cc}. BUG=76764 TEST= Review URL: https://chromiumcodereview.appspot.com/10413014 TBR=akalin@chromium.org Review URL: https://chromiumcodereview.appspot.com/10388227 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138221 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/cloud_print')
-rw-r--r--chrome/service/cloud_print/cloud_print_proxy_backend.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.cc b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
index e14e33b..e318c1a 100644
--- a/chrome/service/cloud_print/cloud_print_proxy_backend.cc
+++ b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
@@ -26,7 +26,6 @@
#include "grit/generated_resources.h"
#include "jingle/notifier/base/notifier_options.h"
#include "jingle/notifier/listener/push_client.h"
-#include "jingle/notifier/listener/push_client_observer.h"
#include "ui/base/l10n/l10n_util.h"
// The real guts of CloudPrintProxyBackend, to keep the public client API clean.
@@ -34,7 +33,7 @@ class CloudPrintProxyBackend::Core
: public base::RefCountedThreadSafe<CloudPrintProxyBackend::Core>,
public CloudPrintAuth::Client,
public CloudPrintConnector::Client,
- public notifier::PushClientObserver {
+ public notifier::PushClient::Observer {
public:
// It is OK for print_server_url to be empty. In this case system should
// use system default (local) print server.
@@ -87,7 +86,7 @@ class CloudPrintProxyBackend::Core
// CloudPrintConnector::Client implementation.
virtual void OnAuthFailed() OVERRIDE;
- // notifier::PushClientObserver implementation.
+ // notifier::PushClient::Delegate implementation.
virtual void OnNotificationStateChange(
bool notifications_enabled) OVERRIDE;
virtual void OnIncomingNotification(
@@ -391,7 +390,7 @@ void CloudPrintProxyBackend::Core::InitNotifications(
notifier_options.request_context_getter =
g_service_process->GetServiceURLRequestContextGetter();
notifier_options.auth_mechanism = "X-OAUTH2";
- push_client_ = notifier::PushClient::CreateDefault(notifier_options);
+ push_client_.reset(new notifier::PushClient(notifier_options));
push_client_->AddObserver(this);
notifier::Subscription subscription;
subscription.channel = kCloudPrintPushNotificationsSource;