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

Unified Diff: ui/app_list/app_list_switches.cc

Issue 2842363002: Getting answer server URL from the variations server. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698