| Index: chrome/browser/prerender/prerender_field_trial.cc
|
| diff --git a/chrome/browser/prerender/prerender_field_trial.cc b/chrome/browser/prerender/prerender_field_trial.cc
|
| index 54d3c3801cec1c567d686fc035122ee450a3bc5c..484e665ab4fa6d9de0e5b15ea003c32ed89216ba 100644
|
| --- a/chrome/browser/prerender/prerender_field_trial.cc
|
| +++ b/chrome/browser/prerender/prerender_field_trial.cc
|
| @@ -4,34 +4,21 @@
|
|
|
| #include "chrome/browser/prerender/prerender_field_trial.h"
|
|
|
| +#include <string>
|
| +
|
| #include "base/command_line.h"
|
| #include "base/logging.h"
|
| -#include "chrome/browser/net/prediction_options.h"
|
| -#include "chrome/browser/predictors/autocomplete_action_predictor.h"
|
| +#include "base/metrics/field_trial.h"
|
| #include "chrome/browser/prerender/prerender_manager.h"
|
| -#include "chrome/browser/profiles/profile.h"
|
| -#include "chrome/browser/sync/profile_sync_service.h"
|
| -#include "chrome/browser/sync/profile_sync_service_factory.h"
|
| #include "chrome/common/chrome_switches.h"
|
|
|
| -using std::string;
|
| -
|
| namespace prerender {
|
|
|
| -namespace {
|
| -
|
| -const char kDefaultPrerenderServiceURLPrefix[] =
|
| - "https://clients4.google.com/prerenderservice/?q=";
|
| -const int kDefaultPrerenderServiceTimeoutMs = 1000;
|
| -const int kDefaultPrefetchListTimeoutSeconds = 300;
|
| -
|
| -} // end namespace
|
| -
|
| void ConfigurePrerender(const base::CommandLine& command_line) {
|
| PrerenderManager::PrerenderManagerMode mode =
|
| PrerenderManager::PRERENDER_MODE_ENABLED;
|
| if (command_line.HasSwitch(switches::kPrerenderMode)) {
|
| - const string switch_value =
|
| + const std::string switch_value =
|
| command_line.GetSwitchValueASCII(switches::kPrerenderMode);
|
|
|
| if (switch_value == switches::kPrerenderModeSwitchValueDisabled) {
|
| @@ -62,7 +49,7 @@ bool IsOmniboxEnabled(Profile* profile) {
|
| // Override any field trial groups if the user has set a command line flag.
|
| if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kPrerenderFromOmnibox)) {
|
| - const string switch_value =
|
| + const std::string switch_value =
|
| base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
| switches::kPrerenderFromOmnibox);
|
|
|
| @@ -79,123 +66,7 @@ bool IsOmniboxEnabled(Profile* profile) {
|
| "OmniboxPrerenderDisabled");
|
| }
|
|
|
| -bool IsUnencryptedSyncEnabled(Profile* profile) {
|
| - ProfileSyncService* service = ProfileSyncServiceFactory::GetInstance()->
|
| - GetForProfile(profile);
|
| - return service && service->GetOpenTabsUIDelegate() &&
|
| - !service->EncryptEverythingEnabled();
|
| -}
|
| -
|
| -// Indicates whether the Local Predictor is enabled based on field trial
|
| -// selection.
|
| -bool IsLocalPredictorEnabled() {
|
| - return false;
|
| -}
|
| -
|
| -bool ShouldDisableLocalPredictorBasedOnSyncAndConfiguration(Profile* profile) {
|
| - return false;
|
| -}
|
| -
|
| -bool ShouldDisableLocalPredictorDueToPreferencesAndNetwork(Profile* profile) {
|
| - return false;
|
| -}
|
| -
|
| -bool IsLoggedInPredictorEnabled() {
|
| - return IsLocalPredictorEnabled();
|
| -}
|
| -
|
| bool IsSideEffectFreeWhitelistEnabled() {
|
| - return IsLocalPredictorEnabled();
|
| -}
|
| -
|
| -bool IsLocalPredictorPrerenderLaunchEnabled() {
|
| - return true;
|
| -}
|
| -
|
| -bool IsLocalPredictorPrerenderAlwaysControlEnabled() {
|
| - // If we prefetch rather than prerender, we automatically also prerender
|
| - // as a control group only.
|
| - return IsLocalPredictorPrerenderPrefetchEnabled();
|
| -}
|
| -
|
| -bool IsLocalPredictorPrerenderPrefetchEnabled() {
|
| - return false;
|
| -}
|
| -
|
| -bool ShouldQueryPrerenderService(Profile* profile) {
|
| - return false;
|
| -}
|
| -
|
| -bool ShouldQueryPrerenderServiceForCurrentURL() {
|
| - return true;
|
| -}
|
| -
|
| -bool ShouldQueryPrerenderServiceForCandidateURLs() {
|
| - return true;
|
| -}
|
| -
|
| -string GetPrerenderServiceURLPrefix() {
|
| - return kDefaultPrerenderServiceURLPrefix;
|
| -}
|
| -
|
| -int GetPrerenderServiceBehaviorID() {
|
| - return 0;
|
| -}
|
| -
|
| -int GetPrerenderServiceFetchTimeoutMs() {
|
| - return kDefaultPrerenderServiceTimeoutMs;
|
| -}
|
| -
|
| -int GetPrerenderPrefetchListTimeoutSeconds() {
|
| - return kDefaultPrefetchListTimeoutSeconds;
|
| -}
|
| -
|
| -int GetLocalPredictorTTLSeconds() {
|
| - // Use a default value of 180s.
|
| - return 180;
|
| -}
|
| -
|
| -int GetLocalPredictorPrerenderPriorityHalfLifeTimeSeconds() {
|
| - return 0;
|
| -}
|
| -
|
| -int GetLocalPredictorMaxConcurrentPrerenders() {
|
| - return 1;
|
| -}
|
| -
|
| -int GetLocalPredictorMaxLaunchPrerenders() {
|
| - return 1;
|
| -}
|
| -
|
| -bool SkipLocalPredictorFragment() {
|
| - return false;
|
| -}
|
| -
|
| -bool SkipLocalPredictorHTTPS() {
|
| - return false;
|
| -}
|
| -
|
| -bool SkipLocalPredictorWhitelist() {
|
| - return false;
|
| -}
|
| -
|
| -bool SkipLocalPredictorServiceWhitelist() {
|
| - return false;
|
| -}
|
| -
|
| -bool SkipLocalPredictorLoggedIn() {
|
| - return false;
|
| -}
|
| -
|
| -bool SkipLocalPredictorDefaultNoPrerender() {
|
| - return false;
|
| -}
|
| -
|
| -bool SkipLocalPredictorLocalCandidates() {
|
| - return false;
|
| -}
|
| -
|
| -bool SkipLocalPredictorServiceCandidates() {
|
| return false;
|
| }
|
|
|
|
|