| 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_CLIENT_POLICY_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_CLIENT_POLICY_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_CLIENT_POLICY_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_CLIENT_POLICY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // The struct describing feature set of the offline pages. | 48 // The struct describing feature set of the offline pages. |
| 49 struct FeaturePolicy { | 49 struct FeaturePolicy { |
| 50 // Whether pages are shown in download ui. | 50 // Whether pages are shown in download ui. |
| 51 bool is_supported_by_download; | 51 bool is_supported_by_download; |
| 52 // Whether pages are shown in recent tabs ui. | 52 // Whether pages are shown in recent tabs ui. |
| 53 bool is_supported_by_recent_tabs; | 53 bool is_supported_by_recent_tabs; |
| 54 // Whether pages should only be viewed in the tab they were generated in. | 54 // Whether pages should only be viewed in the tab they were generated in. |
| 55 bool only_shown_in_original_tab; | 55 bool only_shown_in_original_tab; |
| 56 // Whether pages are removed on user-initiated cache reset. Defaults to true. | 56 // Whether pages are removed on user-initiated cache reset. Defaults to true. |
| 57 bool is_removed_on_cache_reset; | 57 bool is_removed_on_cache_reset; |
| 58 // Whether to remove popup overlay that obstructs viewing normal content. |
| 59 bool remove_popup_overlay; |
| 58 | 60 |
| 59 FeaturePolicy() | 61 FeaturePolicy() |
| 60 : is_supported_by_download(false), | 62 : is_supported_by_download(false), |
| 61 is_supported_by_recent_tabs(false), | 63 is_supported_by_recent_tabs(false), |
| 62 only_shown_in_original_tab(false), | 64 only_shown_in_original_tab(false), |
| 63 is_removed_on_cache_reset(true){}; | 65 is_removed_on_cache_reset(true), |
| 66 remove_popup_overlay(false) {} |
| 64 }; | 67 }; |
| 65 | 68 |
| 66 // The struct describing policies for various namespaces (Bookmark, Last-N etc.) | 69 // The struct describing policies for various namespaces (Bookmark, Last-N etc.) |
| 67 // used by offline page model. The name_space is supposed to be key, so that | 70 // used by offline page model. The name_space is supposed to be key, so that |
| 68 // it's sufficient to compare name_space only when doing comparisons. | 71 // it's sufficient to compare name_space only when doing comparisons. |
| 69 struct OfflinePageClientPolicy { | 72 struct OfflinePageClientPolicy { |
| 70 // Namespace to which the policy applied. | 73 // Namespace to which the policy applied. |
| 71 std::string name_space; | 74 std::string name_space; |
| 72 | 75 |
| 73 // Policy to control the lifetime of a page generated by this namespace. | 76 // Policy to control the lifetime of a page generated by this namespace. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 return *this; | 140 return *this; |
| 138 } | 141 } |
| 139 | 142 |
| 140 OfflinePageClientPolicyBuilder& SetIsOnlyShownInOriginalTab( | 143 OfflinePageClientPolicyBuilder& SetIsOnlyShownInOriginalTab( |
| 141 const bool only_shown_in_original_tab) { | 144 const bool only_shown_in_original_tab) { |
| 142 policy_.feature_policy.only_shown_in_original_tab = | 145 policy_.feature_policy.only_shown_in_original_tab = |
| 143 only_shown_in_original_tab; | 146 only_shown_in_original_tab; |
| 144 return *this; | 147 return *this; |
| 145 } | 148 } |
| 146 | 149 |
| 150 OfflinePageClientPolicyBuilder& SetRemovePopupOverlay( |
| 151 const bool remove_popup_overlay) { |
| 152 policy_.feature_policy.remove_popup_overlay = remove_popup_overlay; |
| 153 return *this; |
| 154 } |
| 155 |
| 147 private: | 156 private: |
| 148 OfflinePageClientPolicy policy_; | 157 OfflinePageClientPolicy policy_; |
| 149 | 158 |
| 150 DISALLOW_COPY_AND_ASSIGN(OfflinePageClientPolicyBuilder); | 159 DISALLOW_COPY_AND_ASSIGN(OfflinePageClientPolicyBuilder); |
| 151 }; | 160 }; |
| 152 | 161 |
| 153 } // namespace offline_pages | 162 } // namespace offline_pages |
| 154 | 163 |
| 155 #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_CLIENT_POLICY_H_ | 164 #endif // COMPONENTS_OFFLINE_PAGES_CORE_OFFLINE_PAGE_CLIENT_POLICY_H_ |
| OLD | NEW |