diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-23 05:20:40 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-23 05:20:40 +0000 |
commit | 6618e73fbaaf0857b9432bd945f2d3e5ffb5f782 (patch) | |
tree | e85a5ba4b8e8c80a116b7cc51c7c6e4adf2af07c /chrome/service/cloud_print | |
parent | 136ee30001e433408bf59a3324fec04cac22cf9a (diff) | |
download | chromium_src-6618e73fbaaf0857b9432bd945f2d3e5ffb5f782.zip chromium_src-6618e73fbaaf0857b9432bd945f2d3e5ffb5f782.tar.gz chromium_src-6618e73fbaaf0857b9432bd945f2d3e5ffb5f782.tar.bz2 |
[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=
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=138216
Review URL: https://chromiumcodereview.appspot.com/10413014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138431 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/cloud_print')
-rw-r--r-- | chrome/service/cloud_print/cloud_print_proxy_backend.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.cc b/chrome/service/cloud_print/cloud_print_proxy_backend.cc index e318c1a..e14e33b 100644 --- a/chrome/service/cloud_print/cloud_print_proxy_backend.cc +++ b/chrome/service/cloud_print/cloud_print_proxy_backend.cc @@ -26,6 +26,7 @@ #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. @@ -33,7 +34,7 @@ class CloudPrintProxyBackend::Core : public base::RefCountedThreadSafe<CloudPrintProxyBackend::Core>, public CloudPrintAuth::Client, public CloudPrintConnector::Client, - public notifier::PushClient::Observer { + public notifier::PushClientObserver { public: // It is OK for print_server_url to be empty. In this case system should // use system default (local) print server. @@ -86,7 +87,7 @@ class CloudPrintProxyBackend::Core // CloudPrintConnector::Client implementation. virtual void OnAuthFailed() OVERRIDE; - // notifier::PushClient::Delegate implementation. + // notifier::PushClientObserver implementation. virtual void OnNotificationStateChange( bool notifications_enabled) OVERRIDE; virtual void OnIncomingNotification( @@ -390,7 +391,7 @@ void CloudPrintProxyBackend::Core::InitNotifications( notifier_options.request_context_getter = g_service_process->GetServiceURLRequestContextGetter(); notifier_options.auth_mechanism = "X-OAUTH2"; - push_client_.reset(new notifier::PushClient(notifier_options)); + push_client_ = notifier::PushClient::CreateDefault(notifier_options); push_client_->AddObserver(this); notifier::Subscription subscription; subscription.channel = kCloudPrintPushNotificationsSource; |