Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1095)

Unified Diff: components/offline_pages/offline_page_client_policy.h

Issue 2364253002: [Offline Pages] Adds new policy bits and reverse lookup. (Closed)
Patch Set: Rename. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/offline_pages/client_policy_controller_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/offline_page_client_policy.h
diff --git a/components/offline_pages/offline_page_client_policy.h b/components/offline_pages/offline_page_client_policy.h
index 20fd564ecb99c22f42f66bac909581b67e3d3e4e..b52d51dcaed08ab057d4bbd5b467356cb37b6121 100644
--- a/components/offline_pages/offline_page_client_policy.h
+++ b/components/offline_pages/offline_page_client_policy.h
@@ -49,11 +49,18 @@ struct LifetimePolicy {
struct FeaturePolicy {
// Whether pages are shown in download ui.
bool is_supported_by_download;
+ // Whether pages are shown in recent tabs ui.
+ bool is_supported_by_recent_tabs;
+ // Whether pages should only be viewed in the tab they were generated in.
+ bool only_shown_in_original_tab;
// Whether pages are removed on user-initiated cache reset. Defaults to true.
bool is_removed_on_cache_reset;
FeaturePolicy()
- : is_supported_by_download(false), is_removed_on_cache_reset(true){};
+ : is_supported_by_download(false),
+ is_supported_by_recent_tabs(false),
+ only_shown_in_original_tab(false),
+ is_removed_on_cache_reset(true){};
};
// The struct describing policies for various namespaces (Bookmark, Last-N etc.)
@@ -118,12 +125,25 @@ class OfflinePageClientPolicyBuilder {
return *this;
}
+ OfflinePageClientPolicyBuilder& SetIsSupportedByRecentTabs(
+ const bool is_recent_tabs) {
+ policy_.feature_policy.is_supported_by_recent_tabs = is_recent_tabs;
+ return *this;
+ }
+
OfflinePageClientPolicyBuilder& SetIsRemovedOnCacheReset(
const bool removed_on_cache_reset) {
policy_.feature_policy.is_removed_on_cache_reset = removed_on_cache_reset;
return *this;
}
+ OfflinePageClientPolicyBuilder& SetIsOnlyShownInOriginalTab(
+ const bool only_shown_in_original_tab) {
+ policy_.feature_policy.only_shown_in_original_tab =
+ only_shown_in_original_tab;
+ return *this;
+ }
+
private:
OfflinePageClientPolicy policy_;
« no previous file with comments | « components/offline_pages/client_policy_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698