Commit 82836763 authored by vadimt's avatar vadimt Committed by Commit bot

Getting answer server URL from the variations server.

Passing via command line is still supported, and has priority over the variations server parameter.

Bug=712331

Review-Url: https://codereview.chromium.org/2842363002
Cr-Commit-Position: refs/heads/master@{#467536}
parent 30474f06
......@@ -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 {
......@@ -82,12 +83,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.
const std::string variations_url = base::GetFieldTrialParamValue(
"SearchAnswerCard", switches::kAnswerServerUrl);
const std::string url =
base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(
kAnswerServerUrl);
return !url.empty() ? url : variations_url;
}
bool IsAnswerCardEnabled() {
return !AnswerServerUrl().empty();
static const bool enabled = !AnswerServerUrl().empty();
return enabled;
}
bool IsFullscreenAppListEnabled() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment