1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_FIELD_TRIAL_H_
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_FIELD_TRIAL_H_
18 // Parse the --prerender= command line switch, which controls prerendering. If
19 // the switch is unset or is set to "auto" then the user is assigned to a
21 void ConfigurePrerender(const base::CommandLine
& command_line
);
23 // Returns true if the user has opted in or has been opted in to the
24 // prerendering from Omnibox experiment.
25 bool IsOmniboxEnabled(Profile
* profile
);
27 // Returns true if session storage namespace merging is not disabled.
28 bool ShouldMergeSessionStorageNamespaces();
30 // Returns true iff the Prerender Local Predictor is enabled.
31 bool IsLocalPredictorEnabled();
33 // Indicates whether to disable the local predictor due to unencrypted sync
34 // settings and configuration.
35 bool DisableLocalPredictorBasedOnSyncAndConfiguration(Profile
* profile
);
37 // Returns true iff the LoggedIn Predictor is enabled.
38 bool IsLoggedInPredictorEnabled();
40 // Returns true iff the side-effect free whitelist is enabled.
41 bool IsSideEffectFreeWhitelistEnabled();
43 // Returns true if the local predictor should actually launch prerenders.
44 bool IsLocalPredictorPrerenderLaunchEnabled();
46 // Returns true if the local predictor should prerender, but only as control
47 // group. If the local predictor never launches prerenders, then this setting
49 bool IsLocalPredictorPrerenderAlwaysControlEnabled();
51 // Returns true if we should query the prerender service for the profile
53 bool ShouldQueryPrerenderService(Profile
* profile
);
55 // Indicates whether we should query the prerender service for the current URL
56 // and candidate URLs, respectively.
57 bool ShouldQueryPrerenderServiceForCurrentURL();
58 bool ShouldQueryPrerenderServiceForCandidateURLs();
60 // Returns the URL prefix to be used for the prerender service. The only thing
61 // that will be appended is the urlencoded query json.
62 std::string
GetPrerenderServiceURLPrefix();
64 // Returns the prerender service behavior ID that should be passed to the
65 // to the prerender service in requests.
66 int GetPrerenderServiceBehaviorID();
68 // Returns the fetch timeout to be used for the prerender service, in ms.
69 int GetPrerenderServiceFetchTimeoutMs();
71 // Returns the TTL to be used for the local predictor.
72 int GetLocalPredictorTTLSeconds();
74 // Returns the half-life time to use to decay local predictor prerender
76 int GetLocalPredictorPrerenderPriorityHalfLifeTimeSeconds();
78 // Returns the maximum number of concurrent prerenders the local predictor
80 int GetLocalPredictorMaxConcurrentPrerenders();
82 // The following functions return whether certain LocalPredictor checks should
83 // be skipped, as indicated by the name.
84 bool SkipLocalPredictorFragment();
85 bool SkipLocalPredictorHTTPS();
86 bool SkipLocalPredictorWhitelist();
87 bool SkipLocalPredictorServiceWhitelist();
88 bool SkipLocalPredictorLoggedIn();
89 bool SkipLocalPredictorDefaultNoPrerender();
90 bool SkipLocalPredictorLocalCandidates();
91 bool SkipLocalPredictorServiceCandidates();
93 // Indicates whether no prerender cookie stores should be used for prerendering.
94 bool IsPrerenderCookieStoreEnabled();
96 } // namespace prerender
98 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_FIELD_TRIAL_H_