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

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

Issue 1224083010: Enable Answers in Suggest always. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android compile issue Created 5 years, 5 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 kBundledExperimentFieldTrialName, 294 kBundledExperimentFieldTrialName,
295 kHQPAllowMatchInTLDRule) == "true"; 295 kHQPAllowMatchInTLDRule) == "true";
296 } 296 }
297 297
298 bool OmniboxFieldTrial::HQPAllowMatchInSchemeValue() { 298 bool OmniboxFieldTrial::HQPAllowMatchInSchemeValue() {
299 return variations::GetVariationParamValue( 299 return variations::GetVariationParamValue(
300 kBundledExperimentFieldTrialName, 300 kBundledExperimentFieldTrialName,
301 kHQPAllowMatchInSchemeRule) == "true"; 301 kHQPAllowMatchInSchemeRule) == "true";
302 } 302 }
303 303
304 bool OmniboxFieldTrial::EnableAnswersInSuggest() {
305 const base::CommandLine* cl = base::CommandLine::ForCurrentProcess();
306 if (cl->HasSwitch(switches::kDisableAnswersInSuggest))
307 return false;
308 if (cl->HasSwitch(switches::kEnableAnswersInSuggest))
309 return true;
310
311 return variations::GetVariationParamValue(
312 kBundledExperimentFieldTrialName,
313 kAnswersInSuggestRule) == "true";
314 }
315
316 bool OmniboxFieldTrial::DisableResultsCaching() { 304 bool OmniboxFieldTrial::DisableResultsCaching() {
317 return variations::GetVariationParamValue( 305 return variations::GetVariationParamValue(
318 kBundledExperimentFieldTrialName, 306 kBundledExperimentFieldTrialName,
319 kDisableResultsCachingRule) == "true"; 307 kDisableResultsCachingRule) == "true";
320 } 308 }
321 309
322 void OmniboxFieldTrial::GetSuggestPollingStrategy(bool* from_last_keystroke, 310 void OmniboxFieldTrial::GetSuggestPollingStrategy(bool* from_last_keystroke,
323 int* polling_delay_ms) { 311 int* polling_delay_ms) {
324 *from_last_keystroke = variations::GetVariationParamValue( 312 *from_last_keystroke = variations::GetVariationParamValue(
325 kBundledExperimentFieldTrialName, 313 kBundledExperimentFieldTrialName,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 "ShortcutsScoringMaxRelevance"; 391 "ShortcutsScoringMaxRelevance";
404 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory"; 392 const char OmniboxFieldTrial::kSearchHistoryRule[] = "SearchHistory";
405 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType"; 393 const char OmniboxFieldTrial::kDemoteByTypeRule[] = "DemoteByType";
406 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] = 394 const char OmniboxFieldTrial::kHQPBookmarkValueRule[] =
407 "HQPBookmarkValue"; 395 "HQPBookmarkValue";
408 const char OmniboxFieldTrial::kHQPAllowMatchInTLDRule[] = "HQPAllowMatchInTLD"; 396 const char OmniboxFieldTrial::kHQPAllowMatchInTLDRule[] = "HQPAllowMatchInTLD";
409 const char OmniboxFieldTrial::kHQPAllowMatchInSchemeRule[] = 397 const char OmniboxFieldTrial::kHQPAllowMatchInSchemeRule[] =
410 "HQPAllowMatchInScheme"; 398 "HQPAllowMatchInScheme";
411 const char OmniboxFieldTrial::kZeroSuggestRule[] = "ZeroSuggest"; 399 const char OmniboxFieldTrial::kZeroSuggestRule[] = "ZeroSuggest";
412 const char OmniboxFieldTrial::kZeroSuggestVariantRule[] = "ZeroSuggestVariant"; 400 const char OmniboxFieldTrial::kZeroSuggestVariantRule[] = "ZeroSuggestVariant";
413 const char OmniboxFieldTrial::kAnswersInSuggestRule[] = "AnswersInSuggest";
414 const char OmniboxFieldTrial::kDisableResultsCachingRule[] = 401 const char OmniboxFieldTrial::kDisableResultsCachingRule[] =
415 "DisableResultsCaching"; 402 "DisableResultsCaching";
416 const char 403 const char
417 OmniboxFieldTrial::kMeasureSuggestPollingDelayFromLastKeystrokeRule[] = 404 OmniboxFieldTrial::kMeasureSuggestPollingDelayFromLastKeystrokeRule[] =
418 "MeasureSuggestPollingDelayFromLastKeystroke"; 405 "MeasureSuggestPollingDelayFromLastKeystroke";
419 const char OmniboxFieldTrial::kSuggestPollingDelayMsRule[] = 406 const char OmniboxFieldTrial::kSuggestPollingDelayMsRule[] =
420 "SuggestPollingDelayMs"; 407 "SuggestPollingDelayMs";
421 const char OmniboxFieldTrial::kHQPFixFrequencyScoringBugsRule[] = 408 const char OmniboxFieldTrial::kHQPFixFrequencyScoringBugsRule[] =
422 "HQPFixFrequencyScoringBugs"; 409 "HQPFixFrequencyScoringBugs";
423 const char OmniboxFieldTrial::kHQPNumTitleWordsRule[] = "HQPNumTitleWords"; 410 const char OmniboxFieldTrial::kHQPNumTitleWordsRule[] = "HQPNumTitleWords";
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 if (it != params.end()) 494 if (it != params.end())
508 return it->second; 495 return it->second;
509 // Fall back to the global instant extended context. 496 // Fall back to the global instant extended context.
510 it = params.find(rule + ":" + page_classification_str + ":*"); 497 it = params.find(rule + ":" + page_classification_str + ":*");
511 if (it != params.end()) 498 if (it != params.end())
512 return it->second; 499 return it->second;
513 // Look up rule in the global context. 500 // Look up rule in the global context.
514 it = params.find(rule + ":*:*"); 501 it = params.find(rule + ":*:*");
515 return (it != params.end()) ? it->second : std::string(); 502 return (it != params.end()) ? it->second : std::string();
516 } 503 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698