| // Copyright 2015 The Chromium OS Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #ifndef LIBWEAVE_SRC_NOTIFICATION_PULL_CHANNEL_H_ |
| #define LIBWEAVE_SRC_NOTIFICATION_PULL_CHANNEL_H_ |
| #include <base/memory/weak_ptr.h> |
| #include "libweave/src/notification/notification_channel.h" |
| class PullChannel : public NotificationChannel { |
| PullChannel(base::TimeDelta pull_interval, TaskRunner* task_runner); |
| ~PullChannel() override = default; |
| // Overrides from NotificationChannel. |
| std::string GetName() const override; |
| bool IsConnected() const override; |
| void AddChannelParameters(base::DictionaryValue* channel_json) override; |
| void Start(NotificationDelegate* delegate) override; |
| void UpdatePullInterval(base::TimeDelta pull_interval); |
| base::TimeDelta pull_interval_; |
| TaskRunner* task_runner_{nullptr}; |
| NotificationDelegate* delegate_{nullptr}; |
| base::WeakPtrFactory<PullChannel> weak_ptr_factory_{this}; |
| DISALLOW_COPY_AND_ASSIGN(PullChannel); |
| #endif // LIBWEAVE_SRC_NOTIFICATION_PULL_CHANNEL_H_ |