Home | History | Annotate | Download | only in prerender
      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.
      4 
      5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_FIELD_TRIAL_H_
      6 #define CHROME_BROWSER_PRERENDER_PRERENDER_FIELD_TRIAL_H_
      7 
      8 #include <string>
      9 
     10 class CommandLine;
     11 class Profile;
     12 
     13 namespace prerender {
     14 
     15 // Parse the --prerender= command line switch, which controls both prerendering
     16 // and prefetching.  If the switch is unset, or is set to "auto", then the user
     17 // is assigned to a field trial.
     18 void ConfigurePrefetchAndPrerender(const CommandLine& command_line);
     19 
     20 // Returns true if the user has opted in or has been opted in to the
     21 // prerendering from Omnibox experiment.
     22 bool IsOmniboxEnabled(Profile* profile);
     23 
     24 // Returns true iff the Prerender Local Predictor is enabled.
     25 bool IsLocalPredictorEnabled();
     26 
     27 // Returns true iff the LoggedIn Predictor is enabled.
     28 bool IsLoggedInPredictorEnabled();
     29 
     30 // Returns true iff the side-effect free whitelist is enabled.
     31 bool IsSideEffectFreeWhitelistEnabled();
     32 
     33 // Returns true if the local predictor should actually launch prerenders.
     34 bool IsLocalPredictorPrerenderLaunchEnabled();
     35 
     36 // Returns true if the local predictor should prerender, but only as control
     37 // group. If the local predictor never launches prerenders, then this setting
     38 // is irrelevant.
     39 bool IsLocalPredictorPrerenderAlwaysControlEnabled();
     40 
     41 // Returns the TTL to be used for the local predictor.
     42 int GetLocalPredictorTTLSeconds();
     43 
     44 // Returns the half-life time to use to decay local predictor prerender
     45 // priorities.
     46 int GetLocalPredictorPrerenderPriorityHalfLifeTimeSeconds();
     47 
     48 // Returns the maximum number of concurrent prerenders the local predictor
     49 // may maintain.
     50 int GetLocalPredictorMaxConcurrentPrerenders();
     51 
     52 // The following functions return whether certain LocalPredictor checks should
     53 // be skipped, as indicated by the name.
     54 bool SkipLocalPredictorFragment();
     55 bool SkipLocalPredictorHTTPS();
     56 bool SkipLocalPredictorWhitelist();
     57 bool SkipLocalPredictorLoggedIn();
     58 bool SkipLocalPredictorDefaultNoPrerender();
     59 
     60 }  // namespace prerender
     61 
     62 #endif  // CHROME_BROWSER_PRERENDER_PRERENDER_FIELD_TRIAL_H_
     63