Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / jingle / notifier / listener / push_client.cc
blobf18ed52d30be31dd51825ffcef001b762f00cb55
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "jingle/notifier/listener/push_client.h"
7 #include <cstddef>
9 #include "base/bind.h"
10 #include "base/single_thread_task_runner.h"
11 #include "jingle/notifier/listener/non_blocking_push_client.h"
12 #include "jingle/notifier/listener/xmpp_push_client.h"
14 namespace notifier {
16 PushClient::~PushClient() {}
18 namespace {
20 scoped_ptr<PushClient> CreateXmppPushClient(
21 const NotifierOptions& notifier_options) {
22 return scoped_ptr<PushClient>(new XmppPushClient(notifier_options));
25 } // namespace
27 scoped_ptr<PushClient> PushClient::CreateDefault(
28 const NotifierOptions& notifier_options) {
29 return scoped_ptr<PushClient>(new NonBlockingPushClient(
30 notifier_options.request_context_getter->GetNetworkTaskRunner(),
31 base::Bind(&CreateXmppPushClient, notifier_options)));
34 scoped_ptr<PushClient> PushClient::CreateDefaultOnIOThread(
35 const NotifierOptions& notifier_options) {
36 CHECK(notifier_options.request_context_getter->GetNetworkTaskRunner()->
37 BelongsToCurrentThread());
38 return CreateXmppPushClient(notifier_options);
41 } // namespace notifier