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/omnibox/browser/omnibox_field_trial.cc

Issue 2717893002: Omnibox - Warm Up PSuggest on Focus (Closed)
Patch Set: rebase Created 3 years, 9 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 19 matching lines...) Expand all
30 namespace omnibox { 30 namespace omnibox {
31 31
32 // Feature used to enable the new set of answers in suggest types (currency, 32 // Feature used to enable the new set of answers in suggest types (currency,
33 // dictionary, sports, translation, when is). Note that the state of this 33 // dictionary, sports, translation, when is). Note that the state of this
34 // Feature is not consulted anywhere in the code. It is only used to force a 34 // Feature is not consulted anywhere in the code. It is only used to force a
35 // Finch experiment arm which sends an experiment ID to GWS which triggers 35 // Finch experiment arm which sends an experiment ID to GWS which triggers
36 // serving the new types. 36 // serving the new types.
37 const base::Feature kNewOmniboxAnswerTypes{"NewOmniboxAnswerTypes", 37 const base::Feature kNewOmniboxAnswerTypes{"NewOmniboxAnswerTypes",
38 base::FEATURE_DISABLED_BY_DEFAULT}; 38 base::FEATURE_DISABLED_BY_DEFAULT};
39 39
40 // Feature to enable the search provider to send a request to the suggest
41 // server on focus. This allows the suggest server to warm up, by, for
42 // example, loading per-user models into memory. Having a per-user model
43 // in memory allows the suggest server to respond more question with
Peter Kasting 2017/03/01 03:00:34 Nit: more question -> to more questions
Mark P 2017/03/01 20:02:32 Actually, I intended "quickly". Done.
44 // personalized suggestions as the user types.
45 const base::Feature kSearchProviderWarmUpOnFocus{
46 "OmniboxWarmUpSearchProviderOnFocus", base::FEATURE_DISABLED_BY_DEFAULT};
47
40 } // namespace omnibox 48 } // namespace omnibox
41 49
42 namespace { 50 namespace {
43 51
44 typedef std::map<std::string, std::string> VariationParams; 52 typedef std::map<std::string, std::string> VariationParams;
45 typedef HUPScoringParams::ScoreBuckets ScoreBuckets; 53 typedef HUPScoringParams::ScoreBuckets ScoreBuckets;
46 54
47 // Field trial names. 55 // Field trial names.
48 const char kStopTimerFieldTrialName[] = "OmniboxStopTimer"; 56 const char kStopTimerFieldTrialName[] = "OmniboxStopTimer";
49 57
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 if (it != params.end()) 754 if (it != params.end())
747 return it->second; 755 return it->second;
748 // Fall back to the global instant extended context. 756 // Fall back to the global instant extended context.
749 it = params.find(rule + ":" + page_classification_str + ":*"); 757 it = params.find(rule + ":" + page_classification_str + ":*");
750 if (it != params.end()) 758 if (it != params.end())
751 return it->second; 759 return it->second;
752 // Look up rule in the global context. 760 // Look up rule in the global context.
753 it = params.find(rule + ":*:*"); 761 it = params.find(rule + ":*:*");
754 return (it != params.end()) ? it->second : std::string(); 762 return (it != params.end()) ? it->second : std::string();
755 } 763 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698