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

Unified Diff: components/offline_pages/offline_page_feature.cc

Issue 1750883002: Add enable-offlining-recent-pages feature switch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated histogram.xml Created 4 years, 10 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_feature.cc
diff --git a/components/offline_pages/offline_page_feature.cc b/components/offline_pages/offline_page_feature.cc
index beee145d8398d9618a126bcad5070aa3bbb0039c..f6b7dac57526cab19b58b50409d1eec491244726 100644
--- a/components/offline_pages/offline_page_feature.cc
+++ b/components/offline_pages/offline_page_feature.cc
@@ -71,6 +71,17 @@ bool IsOfflinePagesEnabled() {
mode == FeatureMode::ENABLED_AS_SAVED_PAGES;
}
+bool IsOffliningRecentPagesEnabled() {
+ bool hasDisableSwitch = base::CommandLine::ForCurrentProcess()->HasSwitch(
jianli 2016/03/02 00:52:31 nit: C++ style
+ switches::kDisableOffliningRecentPages);
+ bool hasEnableSwitch = base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableOffliningRecentPages);
+
+ // Default is 'disable'.
+ return !hasDisableSwitch && hasEnableSwitch && IsOfflinePagesEnabled();
+}
+
+
} // namespace offline_pages
#endif
« no previous file with comments | « components/offline_pages/offline_page_feature.h ('k') | components/offline_pages/offline_page_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698