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

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: resolve Created 4 years, 9 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 ed390b8815e0abe9990d76c5fa0f1bfefbb11ebb..ab00925cf73069a62c29a4fdd30c6057a5374372 100644
--- a/components/offline_pages/offline_page_feature.cc
+++ b/components/offline_pages/offline_page_feature.cc
@@ -7,14 +7,13 @@
#include <string>
#include "base/command_line.h"
+#include "base/feature_list.h"
#include "base/metrics/field_trial.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "components/offline_pages/offline_page_switches.h"
#include "components/version_info/version_info.h"
-#if defined(OS_ANDROID)
-
namespace offline_pages {
namespace {
@@ -26,6 +25,10 @@ const char kEnabledAsBookmarksGroupName[] = "EnabledAsBookmarks";
const char kEnabledAsSavedPagesGroupName[] = "EnabledAsSavedPages";
} // namespace
+const base::Feature kOffliningRecentPagesFeature {
+ "offline-recent-pages", base::FEATURE_DISABLED_BY_DEFAULT
+};
+
FeatureMode GetOfflinePageFeatureMode() {
// Note: It's important to query the field trial state first, to ensure that
// UMA reports the correct group.
@@ -75,6 +78,9 @@ bool IsOfflinePagesEnabled() {
mode == FeatureMode::ENABLED_AS_SAVED_PAGES;
}
-} // namespace offline_pages
+bool IsOffliningRecentPagesEnabled() {
+ return base::FeatureList::IsEnabled(kOffliningRecentPagesFeature) &&
+ IsOfflinePagesEnabled();
+}
-#endif
+} // namespace offline_pages
« 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