OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_PREVIEWS_CORE_PREVIEWS_OPT_OUT_STORE_H_ | 5 #ifndef COMPONENTS_PREVIEWS_CORE_PREVIEWS_OPT_OUT_STORE_H_ |
6 #define COMPONENTS_PREVIEWS_CORE_PREVIEWS_OPT_OUT_STORE_H_ | 6 #define COMPONENTS_PREVIEWS_CORE_PREVIEWS_OPT_OUT_STORE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <unordered_map> | 12 #include <unordered_map> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/callback.h" | 15 #include "base/callback.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "components/previews/core/previews_black_list_item.h" | 17 #include "components/previews/core/previews_black_list_item.h" |
| 18 #include "components/previews/core/previews_experiments.h" |
18 | 19 |
19 class GURL; | 20 class GURL; |
20 | 21 |
21 namespace previews { | 22 namespace previews { |
22 | 23 |
23 enum class PreviewsType { | |
24 NONE = 0, | |
25 OFFLINE = 1, | |
26 LAST = 2, | |
27 }; | |
28 | |
29 typedef std::unordered_map<std::string, std::unique_ptr<PreviewsBlackListItem>> | 24 typedef std::unordered_map<std::string, std::unique_ptr<PreviewsBlackListItem>> |
30 BlackListItemMap; | 25 BlackListItemMap; |
31 | 26 |
32 typedef base::Callback<void(std::unique_ptr<BlackListItemMap>)> | 27 typedef base::Callback<void(std::unique_ptr<BlackListItemMap>)> |
33 LoadBlackListCallback; | 28 LoadBlackListCallback; |
34 | 29 |
35 // PreviewsOptOutStore keeps opt out information for the previews. | 30 // PreviewsOptOutStore keeps opt out information for the previews. |
36 // Ability to create multiple instances of the store as well as behavior of | 31 // Ability to create multiple instances of the store as well as behavior of |
37 // asynchronous operations when the object is being destroyed, before such | 32 // asynchronous operations when the object is being destroyed, before such |
38 // operation finishes will depend on implementation. It is possible to issue | 33 // operation finishes will depend on implementation. It is possible to issue |
(...skipping 13 matching lines...) Expand all Loading... |
52 // host from the store. And runs |callback| once loading is finished. | 47 // host from the store. And runs |callback| once loading is finished. |
53 virtual void LoadBlackList(LoadBlackListCallback callback) = 0; | 48 virtual void LoadBlackList(LoadBlackListCallback callback) = 0; |
54 | 49 |
55 // Deletes all history in the store between |begin_time| and |end_time|. | 50 // Deletes all history in the store between |begin_time| and |end_time|. |
56 virtual void ClearBlackList(base::Time begin_time, base::Time end_time) = 0; | 51 virtual void ClearBlackList(base::Time begin_time, base::Time end_time) = 0; |
57 }; | 52 }; |
58 | 53 |
59 } // namespace previews | 54 } // namespace previews |
60 | 55 |
61 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_OPT_OUT_STORE_H_ | 56 #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_OPT_OUT_STORE_H_ |
OLD | NEW |