Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Side by Side Diff: components/offline_pages/downloads/download_notifying_observer.h

Issue 2260963003: [Offline pages] Enabling notifications for pages saved later (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing missed TODO Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #ifndef COMPONENTS_OFFLINE_PAGES_DOWNLOADS_DOWNLOAD_NOTIFYING_OBSERVER_H_
6 #define COMPONENTS_OFFLINE_PAGES_DOWNLOADS_DOWNLOAD_NOTIFYING_OBSERVER_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "components/offline_pages/background/request_coordinator.h"
12
13 namespace offline_pages {
14
15 struct OfflinePageDownloadNotifier;
16 class SavePageRequest;
17
18 // Class observing the save page requests and issuing corresponding user
19 // notifications as requests are added or updated.
20 class DownloadNotifyingObserver : public RequestCoordinator::Observer,
21 public base::SupportsUserData::Data {
22 public:
23 ~DownloadNotifyingObserver() override;
24
25 static DownloadNotifyingObserver* GetFromRequestCoordinator(
26 RequestCoordinator* request_coordinator);
27 static void CreateAndStartObserving(
28 RequestCoordinator* request_coordinator,
29 std::unique_ptr<OfflinePageDownloadNotifier> notifier);
30
31 // RequestCoordinator::Observer implementation:
32 void OnAdded(const SavePageRequest& request) override;
33 void OnChanged(const SavePageRequest& request) override;
34 void OnCompleted(const SavePageRequest& request,
35 RequestCoordinator::SavePageStatus status) override;
36
37 private:
38 friend class DownloadNotifyingObserverTest;
39
40 explicit DownloadNotifyingObserver(
41 std::unique_ptr<OfflinePageDownloadNotifier> notifier);
42
43 // Used to issue notifications related to save page requests.
44 std::unique_ptr<OfflinePageDownloadNotifier> notifier_;
45
46 DISALLOW_COPY_AND_ASSIGN(DownloadNotifyingObserver);
47 };
48
49 } // namespace offline_pages
50
51 #endif // COMPONENTS_OFFLINE_PAGES_DOWNLOADS_DOWNLOAD_NOTIFYING_OBSERVER_H_
OLDNEW
« no previous file with comments | « components/offline_pages/downloads/BUILD.gn ('k') | components/offline_pages/downloads/download_notifying_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698