Chromium Code Reviews| 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..56e67fa15d355004aaa56522687b86db5d777f1a 100644 |
| --- a/chrome/browser/prerender/prerender_field_trial.cc |
| +++ b/chrome/browser/prerender/prerender_field_trial.cc |
| @@ -5,33 +5,17 @@ |
| #include "chrome/browser/prerender/prerender_field_trial.h" |
| #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 = |
|
mmenke
2015/04/10 16:42:04
#include <string> (As you just removed it from the
davidben
2015/04/13 15:51:14
Done. (We really should have have a tool for this
mmenke
2015/04/13 16:02:42
But then I'd have nothing to whine about on CLs!
|
| command_line.GetSwitchValueASCII(switches::kPrerenderMode); |
| if (switch_value == switches::kPrerenderModeSwitchValueDisabled) { |
| @@ -62,7 +46,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 +63,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; |
| } |