summaryrefslogtreecommitdiffstats
path: root/components/offline_pages/offline_page_feature.cc
diff options
context:
space:
mode:
authorjianli <jianli@chromium.org>2015-08-03 18:06:46 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-04 01:07:48 +0000
commitf2c2a0d281d92e59150bd8f9fabfbdeeeb16d465 (patch)
tree8f128c9714f9576059cebad3e5f77622de17a56a /components/offline_pages/offline_page_feature.cc
parentc692afec196e08584c548f79db3e029606554a7f (diff)
downloadchromium_src-f2c2a0d281d92e59150bd8f9fabfbdeeeb16d465.zip
chromium_src-f2c2a0d281d92e59150bd8f9fabfbdeeeb16d465.tar.gz
chromium_src-f2c2a0d281d92e59150bd8f9fabfbdeeeb16d465.tar.bz2
Support field trial check for offline pages feature
BUG=491352 TEST=none Review URL: https://codereview.chromium.org/1257103005 Cr-Commit-Position: refs/heads/master@{#341661}
Diffstat (limited to 'components/offline_pages/offline_page_feature.cc')
-rw-r--r--components/offline_pages/offline_page_feature.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/components/offline_pages/offline_page_feature.cc b/components/offline_pages/offline_page_feature.cc
new file mode 100644
index 0000000..2d63da7
--- /dev/null
+++ b/components/offline_pages/offline_page_feature.cc
@@ -0,0 +1,28 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/offline_pages/offline_page_feature.h"
+
+#include <string>
+
+#include "base/metrics/field_trial.h"
+
+#if defined(OS_ANDROID)
+
+namespace offline_pages {
+
+namespace {
+const char kOfflinePagesFieldTrialName[] = "OfflinePages";
+const char kOfflinePagesFieldTrialEnabledGroupName[] = "Enabled";
+} // namespace
+
+bool IsOfflinePagesEnabled() {
+ std::string group_name =
+ base::FieldTrialList::FindFullName(kOfflinePagesFieldTrialName);
+ return group_name == kOfflinePagesFieldTrialEnabledGroupName;
+}
+
+} // namespace offline_pages
+
+#endif