Chromium Code Reviews| 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_PREVIEWS_PREVIEWS_OPT_OUT_STORE_H_ | |
| 6 #define COMPONENTS_PREVIEWS_PREVIEWS_OPT_OUT_STORE_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/callback.h" | |
| 13 #include "components/previews/previews_black_list_item.h" | |
| 14 | |
| 15 class GURL; | |
| 16 | |
| 17 namespace base { | |
| 18 class Time; | |
| 19 } | |
| 20 | |
| 21 namespace previews { | |
| 22 | |
| 23 enum class PreviewsType { | |
| 24 NONE = 0, | |
| 25 OFFLINE = 1, | |
| 26 LAST = 2, | |
| 27 }; | |
| 28 | |
| 29 typedef std::map<std::string, std::unique_ptr<PreviewsBlackListItem>> | |
|
tbansal1
2016/09/14 21:36:26
#include map
memory
string
RyanSturm
2016/09/14 22:41:26
Done.
| |
| 30 BlackListItemMap; | |
| 31 | |
| 32 typedef base::Callback<void(std::unique_ptr<BlackListItemMap>)> | |
| 33 LoadBlackListCallback; | |
| 34 | |
| 35 // PreviewsOptOutStore keeps opt out information for the previews. | |
| 36 // Ability to create multiple instances of the store as well as behavior of | |
| 37 // asynchronous operations when the object is being destroyed, before such | |
| 38 // operation finishes will depend on implementation. It should be possible to | |
|
tbansal1
2016/09/14 21:36:26
"should be" sounds vague.
s/should be/is/?
RyanSturm
2016/09/14 22:41:26
Done.
| |
| 39 // issue multiple asynchronous operations in parallel and maintain ordering. | |
| 40 class PreviewsOptOutStore { | |
| 41 public: | |
| 42 PreviewsOptOutStore(); | |
| 43 virtual ~PreviewsOptOutStore(); | |
| 44 | |
| 45 // Adds a new navigation to the store. |opt_out| is whether the uesr opted out | |
| 46 // of the preview or navigated away from the page by another way. | |
| 47 virtual void AddPreviewNavigation(bool opt_out, | |
| 48 const std::string& host_name, | |
| 49 PreviewsType type, | |
| 50 const base::Time& now) = 0; | |
|
tbansal1
2016/09/14 21:36:26
Pass Time by value and just include the base/time/
RyanSturm
2016/09/14 22:41:26
Done.
| |
| 51 | |
| 52 // Asynchronously loads a map of host names to PreviewsBlackListItem for that | |
| 53 // host from the store. | |
| 54 virtual void LoadBlackList(LoadBlackListCallback callback) = 0; | |
| 55 }; | |
| 56 | |
| 57 } // namespace previews | |
| 58 | |
| 59 #endif // COMPONENTS_PREVIEWS_PREVIEWS_OPT_OUT_STORE_H_ | |
| OLD | NEW |