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

Unified Diff: chrome/browser/resources/google_now/background.js

Issue 23127002: Switch Google Now Background Toggle to use Experiment Variations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Finch
Patch Set: Changed Condition to Enabled Background Created 7 years, 4 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 | chrome/browser/resources/google_now/background_unittest.gtestjs » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/google_now/background.js
diff --git a/chrome/browser/resources/google_now/background.js b/chrome/browser/resources/google_now/background.js
index fdeee8ca3b63bc48b0330017360cd6cc5836da9c..d23328863921d1b9c3a8d9f7e6688981ca23385c 100644
--- a/chrome/browser/resources/google_now/background.js
+++ b/chrome/browser/resources/google_now/background.js
@@ -118,7 +118,6 @@ var tasks = buildTaskManager(areTasksConflicting);
// Add error processing to API calls.
tasks.instrumentChromeApiFunction('location.onLocationUpdate.addListener', 0);
-tasks.instrumentChromeApiFunction('metricsPrivate.getFieldTrial', 1);
tasks.instrumentChromeApiFunction('metricsPrivate.getVariationParams', 1);
tasks.instrumentChromeApiFunction('notifications.create', 2);
tasks.instrumentChromeApiFunction('notifications.update', 2);
@@ -868,11 +867,11 @@ function onStateChange() {
tasks.debugSetStepName('onStateChange-isSignedIn');
authenticationManager.isSignedIn(function(token) {
var signedIn = !!token && !!NOTIFICATION_CARDS_URL;
- instrumented.metricsPrivate.getFieldTrial(
+ instrumented.metricsPrivate.getVariationParams(
'GoogleNow',
function(response) {
- console.log('Experiment Status: ' + response);
- var enableBackground = (response != 'EnableWithoutBackground');
+ var enableBackground =
+ (!response || (response.enableBackground != 'false'));
tasks.debugSetStepName(
'onStateChange-get-googleGeolocationAccessEnabledPref');
instrumented.
« no previous file with comments | « no previous file | chrome/browser/resources/google_now/background_unittest.gtestjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698