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

Unified Diff: chrome/browser/resources/chromeos/arc_support/background.js

Issue 2179803002: arc: Use location service consent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebae Created 4 years, 5 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
Index: chrome/browser/resources/chromeos/arc_support/background.js
diff --git a/chrome/browser/resources/chromeos/arc_support/background.js b/chrome/browser/resources/chromeos/arc_support/background.js
index e6acea59ccc6aab4138827b4dd8c728a5344705b..0ac8f2af51e385fdf8046e378072bb04e68b68fa 100644
--- a/chrome/browser/resources/chromeos/arc_support/background.js
+++ b/chrome/browser/resources/chromeos/arc_support/background.js
@@ -111,6 +111,7 @@ function initialize(data, deviceId) {
appWindow.contentWindow.i18nTemplate.process(doc, loadTimeData);
var countryCode = data.countryCode.toLowerCase();
setBackupRestoreMode(data.textBackupRestore, data.backupRestoreEnabled);
+ setLocationServiceMode(data.textLocationService, data.locationServiceEnabled);
var scriptSetCountryCode = 'document.countryCode = \'' + countryCode + '\';';
termsView.addContentScripts([
@@ -166,7 +167,7 @@ function setMetricsMode(text, canEnable, on) {
}
/**
- * Sets current metrics mode.
+ * Sets current backup and restore mode.
* @param {string} text String used to display next to checkbox.
* @param {boolean} defaultCheckValue Defines the default value for backup and
* restore checkbox.
@@ -181,6 +182,21 @@ function setBackupRestoreMode(text, defaultCheckValue) {
}
/**
+ * Sets current usage of location service opt in mode.
+ * @param {string} text String used to display next to checkbox.
+ * @param {boolean} defaultCheckValue Defines the default value for location
+ * service opt in.
+ */
+function setLocationServiceMode(text, defaultCheckValue) {
+ var doc = appWindow.contentWindow.document;
+ doc.getElementById('enable-location-service').checked = defaultCheckValue;
+
+ doc.getElementById('text-location-service').innerHTML = text;
+ doc.getElementById('learn-more-link-location-service').
+ addEventListener('click', onLearnMore);
+}
+
+/**
* Updates terms view height manually because webview is not automatically
* resized in case parent div element gets resized.
*/
@@ -476,6 +492,11 @@ chrome.app.runtime.onLaunched.addListener(function() {
'enabled': enableBackupRestore.checked
});
+ var enableLocationService = doc.getElementById('enable-location-service');
+ sendNativeMessage('setLocationService', {
xiyuan 2016/07/25 18:03:40 nit: wrong indent
khmel 2016/07/25 22:48:48 Done.
+ 'enabled': enableLocationService.checked
+ });
+
sendNativeMessage('startLso');
};

Powered by Google App Engine
This is Rietveld 408576698