Chromium Code Reviews| 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 188545b8174a75fc37d7b0e80dece2b35936eb11..499c8afb181d4c85bbd44184d0a45a66057c8240 100644 |
| --- a/chrome/browser/resources/google_now/background.js |
| +++ b/chrome/browser/resources/google_now/background.js |
| @@ -121,6 +121,7 @@ var tasks = buildTaskManager(areTasksConflicting); |
| // Add error processing to API calls. |
| tasks.instrumentApiFunction(chrome.location.onLocationUpdate, 'addListener', 0); |
| +tasks.instrumentApiFunction(chrome.metricsPrivate, 'getVariationParams', 1); |
|
robliao
2013/08/09 22:01:54
Sync to the latest for updating to instrumentChrom
vadimt
2013/08/09 22:08:59
Will do before submittinng to CQ.
|
| tasks.instrumentApiFunction(chrome.notifications, 'create', 2); |
| tasks.instrumentApiFunction(chrome.notifications, 'update', 2); |
| tasks.instrumentApiFunction(chrome.notifications, 'getAll', 0); |
| @@ -401,11 +402,19 @@ function requestNotificationCards(position, callback) { |
| function requestLocation() { |
| console.log('requestLocation'); |
| recordEvent(GoogleNowEvent.LOCATION_REQUEST); |
| - // TODO(vadimt): Figure out location request options. Use experiments |
| - // framework to enable setting these parameters remotely. |
| - chrome.location.watchLocation(LOCATION_WATCH_NAME, { |
| - minDistanceInMeters: 100, |
| - minTimeInMilliseconds: 180000 // 3 minutes. |
| + // TODO(vadimt): Figure out location request options. |
| + chrome.metricsPrivate.getVariationParams('GoogleNow', function(params) { |
| + var minDistanceInMeters = |
| + parseInt(params && params.minDistanceInMeters) || |
|
arv (Not doing code reviews)
2013/08/09 23:13:16
don't use parseInt without radix
vadimt
2013/08/10 01:16:07
Done.
|
| + 100; |
| + var minTimeInMilliseconds = |
| + parseInt(params && params.minTimeInMilliseconds) || |
| + 180000; // 3 minutes. |
| + |
| + chrome.location.watchLocation(LOCATION_WATCH_NAME, { |
| + minDistanceInMeters: minDistanceInMeters, |
| + minTimeInMilliseconds: minTimeInMilliseconds |
| + }); |
| }); |
| } |