Chromium Code Reviews| Index: ui/app_list/app_list_switches.cc |
| diff --git a/ui/app_list/app_list_switches.cc b/ui/app_list/app_list_switches.cc |
| index c583832888b98b9b0fdb8fb5893c7dc800f2dd4e..ee18cd65e46e58432219560c3ffdc91cd2fb2fe3 100644 |
| --- a/ui/app_list/app_list_switches.cc |
| +++ b/ui/app_list/app_list_switches.cc |
| @@ -5,6 +5,7 @@ |
| #include "ui/app_list/app_list_switches.h" |
| #include "base/command_line.h" |
| +#include "base/metrics/field_trial_params.h" |
| #include "build/build_config.h" |
| namespace app_list { |
| @@ -79,12 +80,19 @@ bool IsDriveSearchInChromeLauncherEnabled() { |
| } |
| std::string AnswerServerUrl() { |
| - return base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( |
| - kAnswerServerUrl); |
| + // If the answer server URL is passed in the command line, use it, otherwise |
| + // get it from the variations server. |
| + std::string variations_url = base::GetFieldTrialParamValue( |
|
xiyuan
2017/04/26 23:18:00
nit: get rid of |variations_url| and inline GetFie
vadimt
2017/04/26 23:29:42
See the links I'll send. Quote:
// Note: It's i
|
| + "SearchAnswerCard", switches::kAnswerServerUrl); |
| + std::string url = |
|
xiyuan
2017/04/26 23:18:00
nit: const
vadimt
2017/04/26 23:29:42
Done.
I like consts, but I'm not using them in Chr
|
| + base::CommandLine::ForCurrentProcess()->GetSwitchValueNative( |
| + kAnswerServerUrl); |
| + return !url.empty() ? url : variations_url; |
| } |
| bool IsAnswerCardEnabled() { |
| - return !AnswerServerUrl().empty(); |
| + static const bool enabled = !AnswerServerUrl().empty(); |
| + return enabled; |
| } |
| } // namespace switches |