OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 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 COMPONENTS_SEARCH_SEARCH_H_ | |
6 #define COMPONENTS_SEARCH_SEARCH_H_ | |
7 | |
8 #include <string> | |
9 #include <utility> | |
10 #include <vector> | |
11 | |
12 #include "base/basictypes.h" | |
13 #include "base/strings/string16.h" | |
14 | |
15 namespace chrome { | |
blundell
2014/07/16 08:58:30
This should be in the "search" namespace now. I'm
Jun Mukai
2014/07/16 20:00:09
let me do that in another CL.
| |
16 | |
17 // Returns whether the Instant Extended API is enabled. | |
18 bool IsInstantExtendedAPIEnabled(); | |
19 | |
20 // Returns the value to pass to the &espv CGI parameter when loading the | |
21 // embedded search page from the user's default search provider. Returns 0 if | |
22 // the Instant Extended API is not enabled. | |
23 uint64 EmbeddedSearchPageVersion(); | |
24 | |
25 // Type for a collection of experiment configuration parameters. | |
26 typedef std::vector<std::pair<std::string, std::string> > FieldTrialFlags; | |
27 | |
28 // Finds the active field trial group name and parses out the configuration | |
29 // flags. On success, |flags| will be filled with the field trial flags. |flags| | |
30 // must not be NULL. Returns true iff the active field trial is successfully | |
31 // parsed and not disabled. | |
32 // Note that |flags| may be successfully populated in some cases when false is | |
33 // returned - in these cases it should not be used. | |
34 // Exposed for testing only. | |
35 bool GetFieldTrialInfo(FieldTrialFlags* flags); | |
36 | |
37 // Given a FieldTrialFlags object, returns the string value of the provided | |
38 // flag. | |
39 // Exposed for testing only. | |
40 std::string GetStringValueForFlagWithDefault(const std::string& flag, | |
41 const std::string& default_value, | |
42 const FieldTrialFlags& flags); | |
43 | |
44 // Given a FieldTrialFlags object, returns the uint64 value of the provided | |
45 // flag. | |
46 // Exposed for testing only. | |
47 uint64 GetUInt64ValueForFlagWithDefault(const std::string& flag, | |
48 uint64 default_value, | |
49 const FieldTrialFlags& flags); | |
50 | |
51 // Given a FieldTrialFlags object, returns the bool value of the provided flag. | |
52 // Exposed for testing only. | |
53 bool GetBoolValueForFlagWithDefault(const std::string& flag, | |
54 bool default_value, | |
55 const FieldTrialFlags& flags); | |
56 | |
57 } // namespace chrome | |
58 | |
59 #endif // COMPONENTS_SEARCH_SEARCH_H_ | |
OLD | NEW |