OLD | NEW |
| (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_BACKGROUND_REQUEST_NOTIFIER_H_ | |
6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_NOTIFIER_H_ | |
7 | |
8 namespace offline_pages { | |
9 | |
10 class SavePageRequest; | |
11 | |
12 class RequestNotifier { | |
13 public: | |
14 // Status to return for failed notifications. | |
15 // NOTE: for any changes to the enum, please also update related switch code | |
16 // in RequestCoordinatorEventLogger. | |
17 // GENERATED_JAVA_ENUM_PACKAGE:org.chromium.components.offlinepages | |
18 enum class BackgroundSavePageResult { | |
19 SUCCESS, | |
20 PRERENDER_FAILURE, | |
21 PRERENDER_CANCELED, | |
22 FOREGROUND_CANCELED, | |
23 SAVE_FAILED, | |
24 EXPIRED, | |
25 RETRY_COUNT_EXCEEDED, | |
26 START_COUNT_EXCEEDED, | |
27 REMOVED, | |
28 }; | |
29 | |
30 virtual ~RequestNotifier() = default; | |
31 | |
32 // Notifies observers that |request| has been added. | |
33 virtual void NotifyAdded(const SavePageRequest& request) = 0; | |
34 | |
35 // Notifies observers that |request| has been completed with |status|. | |
36 virtual void NotifyCompleted(const SavePageRequest& request, | |
37 BackgroundSavePageResult status) = 0; | |
38 | |
39 // Notifies observers that |request| has been changed. | |
40 virtual void NotifyChanged(const SavePageRequest& request) = 0; | |
41 }; | |
42 | |
43 } // namespace offline_pages | |
44 | |
45 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_NOTIFIER_H_ | |
OLD | NEW |