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

Unified Diff: components/offline_pages/offline_page_client_policy.h

Issue 2364253002: [Offline Pages] Adds new policy bits and reverse lookup. (Closed)
Patch Set: Construction order. 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
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){};
chili 2016/09/23 23:52:43 nit: since you're changing this anyway... should w
dewittj 2016/09/23 23:55:55 Interestingly, git cl format removes the space. I
chili 2016/09/24 00:00:19 I'm ok keeping it as is. Didn't know that git cl
};
// 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_;

Powered by Google App Engine
This is Rietveld 408576698