| 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 84a1d4de92ac44548f34cc42a93d8abf6145d910..f668037969f2da7f27ca2b052b2f6926f2690868 100644
|
| --- a/chrome/browser/resources/chromeos/arc_support/background.js
|
| +++ b/chrome/browser/resources/chromeos/arc_support/background.js
|
| @@ -59,19 +59,6 @@
|
| var currentDeviceId = null;
|
|
|
| /**
|
| - * Indicates that OptIn flow is started in silent mode and no user interaction
|
| - * is expected.
|
| - * @type {boolean}
|
| - */
|
| -var silentMode = false;
|
| -
|
| -/**
|
| - * Timeout to retry LSO in silent mode.
|
| - * @type {object}
|
| - */
|
| -var retryTimeout = null;
|
| -
|
| -/**
|
| * Closes current window in response to request from native code. This does not
|
| * issue 'cancelAuthCode' message to native code.
|
| */
|
| @@ -79,7 +66,6 @@
|
| windowClosedInternally = true;
|
| appWindow.close();
|
| appWindow = null;
|
| - cancelRetry();
|
| }
|
|
|
| /**
|
| @@ -96,11 +82,9 @@
|
| * Applies localization for html content and sets terms webview.
|
| * @param {!Object} data Localized strings and relevant information.
|
| * @param {string} deviceId Current device id.
|
| - * @param {boolean} silentMode Indicates if OptIn started in silent mode.
|
| - */
|
| -function initialize(data, deviceId, silentMode) {
|
| + */
|
| +function initialize(data, deviceId) {
|
| currentDeviceId = deviceId;
|
| - window.silentMode = silentMode;
|
| var doc = appWindow.contentWindow.document;
|
| var loadTimeData = appWindow.contentWindow.loadTimeData;
|
| loadTimeData.data = data;
|
| @@ -187,7 +171,7 @@
|
| }
|
|
|
| if (message.action == 'initialize') {
|
| - initialize(message.data, message.deviceId, message.silentMode);
|
| + initialize(message.data, message.deviceId);
|
| } else if (message.action == 'setMetricsMode') {
|
| setMetricsMode(message.text, message.canEnable, message.on);
|
| } else if (message.action == 'closeUI') {
|
| @@ -204,30 +188,6 @@
|
| var hostName = 'com.google.arc_support';
|
| port = chrome.runtime.connectNative(hostName);
|
| port.onMessage.addListener(onNativeMessage);
|
| -}
|
| -
|
| -/**
|
| - * Cancels current request to get authority code from LSO if it was previously
|
| - * scheduled.
|
| - */
|
| -function cancelRetry() {
|
| - if (!retryTimeout) {
|
| - return;
|
| - }
|
| - clearTimeout(retryTimeout);
|
| - retryTimeout = null;
|
| -}
|
| -
|
| -/**
|
| - * Schedules next retry to get authority code from LSO. Previous request is
|
| - * automatically canceled.
|
| - */
|
| -function scheduleRetry() {
|
| - cancelRetry();
|
| - var retry = function() {
|
| - showPage('lso-loading');
|
| - };
|
| - retryTimeout = setTimeout(retry, 60000);
|
| }
|
|
|
| /**
|
| @@ -267,16 +227,7 @@
|
| 'device_type=arc_plus_plus&device_id=' + currentDeviceId +
|
| '&hl=' + navigator.language;
|
| }
|
| -
|
| - if (!silentMode) {
|
| - appWindow.show();
|
| - } else {
|
| - if (pageDivId == 'arc-loading') {
|
| - cancelRetry();
|
| - } else {
|
| - scheduleRetry();
|
| - }
|
| - }
|
| + appWindow.show();
|
| }
|
|
|
| /**
|
| @@ -346,12 +297,6 @@
|
| if (!isApprovalResponse(lsoView.src)) {
|
| // Show LSO page when its content is ready.
|
| showPage('lso');
|
| - if (silentMode) {
|
| - var submitApproveCode =
|
| - 'document.getElementById("connect_approve").submit();';
|
| - lsoView.executeScript({code: submitApproveCode}, function(results) {
|
| - });
|
| - }
|
| return;
|
| }
|
|
|
| @@ -361,7 +306,6 @@
|
| authCodePrefix) {
|
| var authCode = results[0].substring(authCodePrefix.length);
|
| sendNativeMessage('setAuthCode', {code: authCode});
|
| - cancelRetry();
|
| } else {
|
| setErrorMessage(appWindow.contentWindow.loadTimeData.getString(
|
| 'authorizationFailed'));
|
| @@ -454,7 +398,6 @@
|
| clearTimeout(termsReloadTimeout);
|
| termsReloadTimeout = null;
|
| }
|
| - cancelRetry();
|
|
|
| if (windowClosedInternally) {
|
| return;
|
|
|