Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: components/search/search.cc

Issue 1154063003: removing ShouldHideTopMatch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review changes Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/search/search.h" 5 #include "components/search/search.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 17 matching lines...) Expand all
28 #if defined(OS_IOS) 28 #if defined(OS_IOS)
29 const uint64 kEmbeddedPageVersionDefault = 1; 29 const uint64 kEmbeddedPageVersionDefault = 1;
30 #elif defined(OS_ANDROID) 30 #elif defined(OS_ANDROID)
31 const uint64 kEmbeddedPageVersionDefault = 1; 31 const uint64 kEmbeddedPageVersionDefault = 1;
32 // Use this variant to enable EmbeddedSearch SearchBox API in the results page. 32 // Use this variant to enable EmbeddedSearch SearchBox API in the results page.
33 const uint64 kEmbeddedSearchEnabledVersion = 2; 33 const uint64 kEmbeddedSearchEnabledVersion = 2;
34 #else 34 #else
35 const uint64 kEmbeddedPageVersionDefault = 2; 35 const uint64 kEmbeddedPageVersionDefault = 2;
36 #endif 36 #endif
37 37
38 const char kHideVerbatimFlagName[] = "hide_verbatim";
39
40 // Constants for the field trial name and group prefix. 38 // Constants for the field trial name and group prefix.
41 // Note in M30 and below this field trial was named "InstantExtended" and in 39 // Note in M30 and below this field trial was named "InstantExtended" and in
42 // M31 was renamed to EmbeddedSearch for clarity and cleanliness. Since we 40 // M31 was renamed to EmbeddedSearch for clarity and cleanliness. Since we
43 // can't easilly sync up Finch configs with the pushing of this change to 41 // can't easilly sync up Finch configs with the pushing of this change to
44 // Dev & Canary, for now the code accepts both names. 42 // Dev & Canary, for now the code accepts both names.
45 // TODO(dcblack): Remove the InstantExtended name once M31 hits the Beta 43 // TODO(dcblack): Remove the InstantExtended name once M31 hits the Beta
46 // channel. 44 // channel.
47 const char kInstantExtendedFieldTrialName[] = "InstantExtended"; 45 const char kInstantExtendedFieldTrialName[] = "InstantExtended";
48 const char kEmbeddedSearchFieldTrialName[] = "EmbeddedSearch"; 46 const char kEmbeddedSearchFieldTrialName[] = "EmbeddedSearch";
49 47
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 136 }
139 137
140 // Given a FieldTrialFlags object, returns the boolean value of the provided 138 // Given a FieldTrialFlags object, returns the boolean value of the provided
141 // flag. 139 // flag.
142 bool GetBoolValueForFlagWithDefault(const std::string& flag, 140 bool GetBoolValueForFlagWithDefault(const std::string& flag,
143 bool default_value, 141 bool default_value,
144 const FieldTrialFlags& flags) { 142 const FieldTrialFlags& flags) {
145 return !!GetUInt64ValueForFlagWithDefault(flag, default_value ? 1 : 0, flags); 143 return !!GetUInt64ValueForFlagWithDefault(flag, default_value ? 1 : 0, flags);
146 } 144 }
147 145
148 bool ShouldHideTopVerbatimMatch() {
149 FieldTrialFlags flags;
150 return GetFieldTrialInfo(&flags) && GetBoolValueForFlagWithDefault(
151 kHideVerbatimFlagName, false, flags);
152 }
153
154 } // namespace chrome 146 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698