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

Side by Side Diff: components/omnibox/browser/omnibox_field_trial.cc

Issue 2738003002: Add title to current page in zero suggest. (Closed)
Patch Set: Sync to head Created 3 years, 7 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/omnibox/browser/omnibox_field_trial.h" 5 #include "components/omnibox/browser/omnibox_field_trial.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 // Feature used for the Zero Suggest Redirect to Chrome Field Trial. 70 // Feature used for the Zero Suggest Redirect to Chrome Field Trial.
71 const base::Feature kZeroSuggestRedirectToChrome{ 71 const base::Feature kZeroSuggestRedirectToChrome{
72 "ZeroSuggestRedirectToChrome", base::FEATURE_DISABLED_BY_DEFAULT}; 72 "ZeroSuggestRedirectToChrome", base::FEATURE_DISABLED_BY_DEFAULT};
73 73
74 // Feature used to swap the title and URL when providing zero suggest 74 // Feature used to swap the title and URL when providing zero suggest
75 // suggestions. 75 // suggestions.
76 const base::Feature kZeroSuggestSwapTitleAndUrl{ 76 const base::Feature kZeroSuggestSwapTitleAndUrl{
77 "ZeroSuggestSwapTitleAndUrl", base::FEATURE_DISABLED_BY_DEFAULT}; 77 "ZeroSuggestSwapTitleAndUrl", base::FEATURE_DISABLED_BY_DEFAULT};
78 78
79 // Feature used to display the title of the current URL match.
80 const base::Feature kDisplayTitleForCurrentUrl{
81 "OmniboxDisplayTitleForCurrentUrl", base::FEATURE_DISABLED_BY_DEFAULT};
82
79 } // namespace omnibox 83 } // namespace omnibox
80 84
81 namespace { 85 namespace {
82 86
83 typedef std::map<std::string, std::string> VariationParams; 87 typedef std::map<std::string, std::string> VariationParams;
84 typedef HUPScoringParams::ScoreBuckets ScoreBuckets; 88 typedef HUPScoringParams::ScoreBuckets ScoreBuckets;
85 89
86 // Field trial names. 90 // Field trial names.
87 const char kStopTimerFieldTrialName[] = "OmniboxStopTimer"; 91 const char kStopTimerFieldTrialName[] = "OmniboxStopTimer";
88 92
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 metrics::HashName(kBundledExperimentFieldTrialName)); 189 metrics::HashName(kBundledExperimentFieldTrialName));
186 } 190 }
187 } 191 }
188 192
189 base::TimeDelta OmniboxFieldTrial::StopTimerFieldTrialDuration() { 193 base::TimeDelta OmniboxFieldTrial::StopTimerFieldTrialDuration() {
190 int stop_timer_ms; 194 int stop_timer_ms;
191 if (base::StringToInt( 195 if (base::StringToInt(
192 base::FieldTrialList::FindFullName(kStopTimerFieldTrialName), 196 base::FieldTrialList::FindFullName(kStopTimerFieldTrialName),
193 &stop_timer_ms)) 197 &stop_timer_ms))
194 return base::TimeDelta::FromMilliseconds(stop_timer_ms); 198 return base::TimeDelta::FromMilliseconds(stop_timer_ms);
195 return base::TimeDelta::FromMilliseconds(1500); 199 return base::TimeDelta::FromMilliseconds(5500);
Mark P 2017/04/27 05:44:08 Did you intend to change this value? Please talk
gcomanici 2017/04/27 17:29:30 Fixed back. I changed it for debugging. Forgot to
196 } 200 }
197 201
198 bool OmniboxFieldTrial::InZeroSuggestFieldTrial() { 202 bool OmniboxFieldTrial::InZeroSuggestFieldTrial() {
199 if (variations::GetVariationParamValue( 203 if (variations::GetVariationParamValue(
200 kBundledExperimentFieldTrialName, kZeroSuggestRule) == "true") 204 kBundledExperimentFieldTrialName, kZeroSuggestRule) == "true")
201 return true; 205 return true;
202 if (variations::GetVariationParamValue( 206 if (variations::GetVariationParamValue(
203 kBundledExperimentFieldTrialName, kZeroSuggestRule) == "false") 207 kBundledExperimentFieldTrialName, kZeroSuggestRule) == "false")
204 return false; 208 return false;
205 #if defined(OS_IOS) 209 #if defined(OS_IOS)
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 if (it != params.end()) 794 if (it != params.end())
791 return it->second; 795 return it->second;
792 // Fall back to the global instant extended context. 796 // Fall back to the global instant extended context.
793 it = params.find(rule + ":" + page_classification_str + ":*"); 797 it = params.find(rule + ":" + page_classification_str + ":*");
794 if (it != params.end()) 798 if (it != params.end())
795 return it->second; 799 return it->second;
796 // Look up rule in the global context. 800 // Look up rule in the global context.
797 it = params.find(rule + ":*:*"); 801 it = params.find(rule + ":*:*");
798 return (it != params.end()) ? it->second : std::string(); 802 return (it != params.end()) ? it->second : std::string();
799 } 803 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698