Add 'did_proceed' and 'repeat_visit' to ClientMalwareReportRequest to track CTR.
[chromium-blink-merge.git] / components / offline_pages / offline_page_feature.cc
blob8d51f527564137aff2d33e4f89293572ae5c2f54
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/offline_pages/offline_page_feature.h"
7 #include <string>
9 #include "base/command_line.h"
10 #include "base/metrics/field_trial.h"
11 #include "components/offline_pages/offline_page_switches.h"
13 #if defined(OS_ANDROID)
15 namespace offline_pages {
17 namespace {
18 const char kOfflinePagesFieldTrialName[] = "OfflinePages";
19 const char kOfflinePagesFieldTrialEnabledGroupName[] = "Enabled";
20 } // namespace
22 bool IsOfflinePagesEnabled() {
23 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
24 switches::kEnableOfflinePages)) {
25 return true;
27 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
28 switches::kDisableOfflinePages)) {
29 return false;
32 std::string group_name =
33 base::FieldTrialList::FindFullName(kOfflinePagesFieldTrialName);
34 return group_name == kOfflinePagesFieldTrialEnabledGroupName;
37 } // namespace offline_pages
39 #endif