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

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

Issue 2434823002: arc: Add Goolge Privacy Policy link to OptIn UI. (Closed)
Patch Set: comments updated, make presubmit passed Created 4 years, 2 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 8dbfcc87ead94c3336a7884200118e2b9a9ccfde..66500aff6973db38679efc0f4b5da9718a899c34 100644
--- a/chrome/browser/resources/chromeos/arc_support/background.js
+++ b/chrome/browser/resources/chromeos/arc_support/background.js
@@ -444,6 +444,20 @@ function showURLOverlay(url) {
}
/**
+ * Shows Google Privacy Policy in overlay dialog. Policy link is detected from
+ * the content of terms view.
+ */
+function showPrivacyPolicyOverlay() {
+ termsView.executeScript({code: 'getPrivacyPolicyLink();'}, function(results) {
+ if (results && results.length == 1 && typeof results[0] == 'string') {
+ showURLOverlay(results[0]);
+ } else {
+ showURLOverlay('https://www.google.com/policies/privacy/');
+ }
+ });
+}
+
+/**
* Hides overlay dialog.
*/
function hideOverlay() {
@@ -665,6 +679,8 @@ chrome.app.runtime.onLaunched.addListener(function() {
doc.getElementById('button-send-feedback')
.addEventListener('click', onSendFeedback);
doc.getElementById('overlay-close').addEventListener('click', hideOverlay);
+ doc.getElementById('privacy-policy-link').addEventListener(
+ 'click', showPrivacyPolicyOverlay);
var overlay = doc.getElementById('overlay-container');
appWindow.contentWindow.cr.ui.overlay.setupOverlay(overlay);
« no previous file with comments | « chrome/browser/chromeos/arc/arc_support_host.cc ('k') | chrome/browser/resources/chromeos/arc_support/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698