| 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_OFFLINE_PAGES_CORE_OFFLINE_PAGE_MODEL_QUERY_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_MODEL_QUERY_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_MODEL_QUERY_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_MODEL_QUERY_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // times, overwrites previous client ID restrictions. | 79 // times, overwrites previous client ID restrictions. |
| 80 OfflinePageModelQueryBuilder& SetClientIds(Requirement requirement, | 80 OfflinePageModelQueryBuilder& SetClientIds(Requirement requirement, |
| 81 const std::vector<ClientId>& ids); | 81 const std::vector<ClientId>& ids); |
| 82 | 82 |
| 83 // Sets the URLs that are valid for this request. If called multiple times, | 83 // Sets the URLs that are valid for this request. If called multiple times, |
| 84 // overwrites previous URL restrictions. | 84 // overwrites previous URL restrictions. |
| 85 OfflinePageModelQueryBuilder& SetUrls(Requirement requirement, | 85 OfflinePageModelQueryBuilder& SetUrls(Requirement requirement, |
| 86 const std::vector<GURL>& urls); | 86 const std::vector<GURL>& urls); |
| 87 | 87 |
| 88 // Only include pages whose namespaces satisfy | 88 // Only include pages whose namespaces satisfy |
| 89 // ClientPolicyController::IsRemovedOnCacheReset(|namespace|) == |
| 90 // |removed_on_cache_reset| |
| 91 // Multiple calls overwrite previous ones. |
| 92 OfflinePageModelQueryBuilder& RequireRemovedOnCacheReset( |
| 93 Requirement removed_on_cache_reset); |
| 94 |
| 95 // Only include pages whose namespaces satisfy |
| 89 // ClientPolicyController::IsSupportedByDownload(|namespace|) == | 96 // ClientPolicyController::IsSupportedByDownload(|namespace|) == |
| 90 // |supported_by_download| | 97 // |supported_by_download| |
| 91 // Multiple calls overwrite previous ones. | 98 // Multiple calls overwrite previous ones. |
| 92 OfflinePageModelQueryBuilder& RequireSupportedByDownload( | 99 OfflinePageModelQueryBuilder& RequireSupportedByDownload( |
| 93 Requirement supported_by_download); | 100 Requirement supported_by_download); |
| 94 | 101 |
| 95 // Only include pages whose namespaces satisfy | 102 // Only include pages whose namespaces satisfy |
| 96 // ClientPolicyController::IsShownAsRecentlyVisitedSite(|namespace|) == | 103 // ClientPolicyController::IsShownAsRecentlyVisitedSite(|namespace|) == |
| 97 // |recently_visited| | 104 // |recently_visited| |
| 98 // Multiple calls overwrite previous ones. | 105 // Multiple calls overwrite previous ones. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 116 // |inverted| is true, intersects the allowed namespaces with all namespaces | 123 // |inverted| is true, intersects the allowed namespaces with all namespaces |
| 117 // except those provided in |namespaces|. | 124 // except those provided in |namespaces|. |
| 118 void IntersectWithNamespaces(ClientPolicyController* controller, | 125 void IntersectWithNamespaces(ClientPolicyController* controller, |
| 119 const std::vector<std::string>& namespaces, | 126 const std::vector<std::string>& namespaces, |
| 120 Requirement match_requirement); | 127 Requirement match_requirement); |
| 121 | 128 |
| 122 std::pair<Requirement, std::vector<int64_t>> offline_ids_; | 129 std::pair<Requirement, std::vector<int64_t>> offline_ids_; |
| 123 std::pair<Requirement, std::vector<ClientId>> client_ids_; | 130 std::pair<Requirement, std::vector<ClientId>> client_ids_; |
| 124 std::pair<Requirement, std::vector<GURL>> urls_; | 131 std::pair<Requirement, std::vector<GURL>> urls_; |
| 125 | 132 |
| 133 Requirement removed_on_cache_reset_ = Requirement::UNSET; |
| 126 Requirement supported_by_download_ = Requirement::UNSET; | 134 Requirement supported_by_download_ = Requirement::UNSET; |
| 127 Requirement shown_as_recently_visited_site_ = Requirement::UNSET; | 135 Requirement shown_as_recently_visited_site_ = Requirement::UNSET; |
| 128 Requirement restricted_to_original_tab_ = Requirement::UNSET; | 136 Requirement restricted_to_original_tab_ = Requirement::UNSET; |
| 129 | 137 |
| 130 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelQueryBuilder); | 138 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelQueryBuilder); |
| 131 }; | 139 }; |
| 132 | 140 |
| 133 } // namespace offline_pages | 141 } // namespace offline_pages |
| 134 | 142 |
| 135 #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_MODEL_QUERY_H_ | 143 #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_MODEL_QUERY_H_ |
| OLD | NEW |