Add about flag for offline page experiment
BUG=491352 Review URL: https://codereview.chromium.org/1260403004 Cr-Commit-Position: refs/heads/master@{#341967}
This commit is contained in:
@ -15870,6 +15870,15 @@ After you create a new supervised user, you can manage their settings at any tim
|
||||
</message>
|
||||
</if>
|
||||
|
||||
<if expr="is_android">
|
||||
<message name="IDS_FLAGS_OFFLINE_PAGES_NAME" desc="Name for the flag to enable offline pages.">
|
||||
Enable offline pages
|
||||
</message>
|
||||
<message name="IDS_FLAGS_OFFLINE_PAGES_DESCRIPTION" desc="Description for the flag to enable offline pages.">
|
||||
Enable storing pages locally for offline use. Requires Enhanced Bookmarks to be enabled.
|
||||
</message>
|
||||
</if>
|
||||
|
||||
</messages>
|
||||
</release>
|
||||
</grit>
|
||||
|
@ -57,6 +57,7 @@ include_rules = [
|
||||
"+components/navigation_metrics",
|
||||
"+components/network_hints",
|
||||
"+components/network_time",
|
||||
"+components/offline_pages",
|
||||
"+components/omnibox/browser",
|
||||
"+components/os_crypt",
|
||||
"+components/password_manager",
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "components/enhanced_bookmarks/enhanced_bookmark_switches.h"
|
||||
#include "components/metrics/metrics_hashes.h"
|
||||
#include "components/nacl/common/nacl_switches.h"
|
||||
#include "components/offline_pages/offline_page_switches.h"
|
||||
#include "components/omnibox/browser/omnibox_switches.h"
|
||||
#include "components/plugins/common/plugins_switches.h"
|
||||
#include "components/proximity_auth/switches.h"
|
||||
@ -2099,6 +2100,14 @@ const Experiment kExperiments[] = {
|
||||
kOsAndroid,
|
||||
MULTI_VALUE_TYPE(kProgressBarAnimationChoices)},
|
||||
#endif // defined(OS_ANDROID)
|
||||
#if defined(OS_ANDROID)
|
||||
{"offline-pages",
|
||||
IDS_FLAGS_OFFLINE_PAGES_NAME,
|
||||
IDS_FLAGS_OFFLINE_PAGES_DESCRIPTION,
|
||||
kOsAndroid,
|
||||
ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOfflinePages,
|
||||
switches::kDisableOfflinePages)},
|
||||
#endif // defined(OS_ANDROID)
|
||||
|
||||
// NOTE: Adding new command-line switches requires adding corresponding
|
||||
// entries to enum "LoginCustomFlags" in histograms.xml. See note in
|
||||
|
@ -32,6 +32,8 @@
|
||||
'offline_pages/offline_page_metadata_store.h',
|
||||
'offline_pages/offline_page_metadata_store_impl.cc',
|
||||
'offline_pages/offline_page_metadata_store_impl.h',
|
||||
'offline_pages/offline_page_switches.cc',
|
||||
'offline_pages/offline_page_switches.h',
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@ -20,6 +20,8 @@ static_library("offline_pages") {
|
||||
"offline_page_metadata_store_impl.h",
|
||||
"offline_page_model.cc",
|
||||
"offline_page_model.h",
|
||||
"offline_page_switches.cc",
|
||||
"offline_page_switches.h",
|
||||
]
|
||||
|
||||
deps = [
|
||||
|
@ -6,7 +6,9 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/metrics/field_trial.h"
|
||||
#include "components/offline_pages/offline_page_switches.h"
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
|
||||
@ -18,6 +20,15 @@ const char kOfflinePagesFieldTrialEnabledGroupName[] = "Enabled";
|
||||
} // namespace
|
||||
|
||||
bool IsOfflinePagesEnabled() {
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kEnableOfflinePages)) {
|
||||
return true;
|
||||
}
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kDisableOfflinePages)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string group_name =
|
||||
base::FieldTrialList::FindFullName(kOfflinePagesFieldTrialName);
|
||||
return group_name == kOfflinePagesFieldTrialEnabledGroupName;
|
||||
|
15
components/offline_pages/offline_page_switches.cc
Normal file
15
components/offline_pages/offline_page_switches.cc
Normal file
@ -0,0 +1,15 @@
|
||||
// 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_switches.h"
|
||||
|
||||
namespace switches {
|
||||
|
||||
// Enable Offline Pages.
|
||||
const char kEnableOfflinePages[] = "enable-offline-pages";
|
||||
|
||||
// Disable Offline Pages.
|
||||
const char kDisableOfflinePages[] = "disable-offline-pages";
|
||||
|
||||
} // namespace switches
|
15
components/offline_pages/offline_page_switches.h
Normal file
15
components/offline_pages/offline_page_switches.h
Normal file
@ -0,0 +1,15 @@
|
||||
// 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.
|
||||
|
||||
#ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGES_SWITCHES_H_
|
||||
#define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGES_SWITCHES_H_
|
||||
|
||||
namespace switches {
|
||||
|
||||
extern const char kEnableOfflinePages[];
|
||||
extern const char kDisableOfflinePages[];
|
||||
|
||||
} // namespace switches
|
||||
|
||||
#endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGES_SWITCHES_H_
|
@ -61459,6 +61459,7 @@ To add a new entry, add it with any value and run test to compute valid value.
|
||||
<int value="-1930720286" label="nacl-debug-mask"/>
|
||||
<int value="-1928198763" label="enable-async-dns"/>
|
||||
<int value="-1925117279" label="disable-quic-https"/>
|
||||
<int value="-1915854488" label="enable-offline-pages"/>
|
||||
<int value="-1911153473" label="enable-easy-signin"/>
|
||||
<int value="-1888273969" label="tab-capture-upscale-quality"/>
|
||||
<int value="-1887053262"
|
||||
@ -61763,6 +61764,7 @@ To add a new entry, add it with any value and run test to compute valid value.
|
||||
<int value="880510010" label="enable-permissions-bubbles"/>
|
||||
<int value="884106779" label="supervised-user-safesites"/>
|
||||
<int value="887011602" label="enable-spelling-auto-correct"/>
|
||||
<int value="903267263" label="disable-offline-pages"/>
|
||||
<int value="909439558" label="disable-device-discovery"/>
|
||||
<int value="916316159" label="disable-new-app-list-mixer"/>
|
||||
<int value="929462705" label="disable-link-disambiguation-popup"/>
|
||||
|
Reference in New Issue
Block a user