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

Side by Side Diff: chrome/browser/resources/chromeos/arc_support/background.js

Issue 2274543002: Reland: arc: avoid checkbox AutomationNode issue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/arc_support/main.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * UI Pages. Note the order must be in sync with the ArcAuthService::UIPage 6 * UI Pages. Note the order must be in sync with the ArcAuthService::UIPage
7 * enum. 7 * enum.
8 * @type {Array<string>} 8 * @type {Array<string>}
9 */ 9 */
10 var UI_PAGES = ['none', 10 var UI_PAGES = ['none',
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 /** 189 /**
190 * Sets current metrics mode. 190 * Sets current metrics mode.
191 * @param {string} text Describes current metrics state. 191 * @param {string} text Describes current metrics state.
192 * @param {boolean} canEnable Defines if user is allowed to change this metrics 192 * @param {boolean} canEnable Defines if user is allowed to change this metrics
193 * option. 193 * option.
194 * @param {boolean} on Defines if metrics are active currently. 194 * @param {boolean} on Defines if metrics are active currently.
195 */ 195 */
196 function setMetricsMode(text, canEnable, on) { 196 function setMetricsMode(text, canEnable, on) {
197 var doc = appWindow.contentWindow.document; 197 var doc = appWindow.contentWindow.document;
198 var enableMetrics = doc.getElementById('enable-metrics'); 198 var enableMetrics = doc.getElementById('enable-metrics');
199 var enableMetricsContainer = doc.getElementById('enable-metrics-container'); 199 enableMetrics.hidden = !canEnable;
200 enableMetricsContainer.hidden = !canEnable;
201 enableMetrics.checked = on; 200 enableMetrics.checked = on;
202 201
203 var onSettings = function(event) { 202 var onSettings = function(event) {
204 chrome.browser.openTab({'url': 'chrome://settings'}, function() {}); 203 chrome.browser.openTab({'url': 'chrome://settings'}, function() {});
205 event.preventDefault(); 204 event.preventDefault();
206 }; 205 };
207 206
208 doc.getElementById('text-metrics').innerHTML = text; 207 doc.getElementById('text-metrics').innerHTML = text;
209 doc.getElementById('settings-link').addEventListener('click', onSettings); 208 doc.getElementById('settings-link').addEventListener('click', onSettings);
210 doc.getElementById('learn-more-link-metrics').addEventListener('click', 209 doc.getElementById('learn-more-link-metrics').addEventListener('click',
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 // and open links in context of main page. 549 // and open links in context of main page.
551 termsView.addEventListener('newwindow', function(event) { 550 termsView.addEventListener('newwindow', function(event) {
552 event.preventDefault(); 551 event.preventDefault();
553 chrome.browser.openTab({'url': event.targetUrl}, function() {}); 552 chrome.browser.openTab({'url': event.targetUrl}, function() {});
554 }); 553 });
555 554
556 var onAgree = function() { 555 var onAgree = function() {
557 termsAccepted = true; 556 termsAccepted = true;
558 557
559 var enableMetrics = doc.getElementById('enable-metrics'); 558 var enableMetrics = doc.getElementById('enable-metrics');
560 var enableMetricsContainer = 559 if (!enableMetrics.hidden) {
561 doc.getElementById('enable-metrics-container');
562 if (!enableMetricsContainer.hidden) {
563 sendNativeMessage('enableMetrics', { 560 sendNativeMessage('enableMetrics', {
564 'enabled': enableMetrics.checked 561 'enabled': enableMetrics.checked
565 }); 562 });
566 } 563 }
567 564
568 var enableBackupRestore = doc.getElementById('enable-backup-restore'); 565 var enableBackupRestore = doc.getElementById('enable-backup-restore');
569 sendNativeMessage('setBackupRestore', { 566 sendNativeMessage('setBackupRestore', {
570 'enabled': enableBackupRestore.checked 567 'enabled': enableBackupRestore.checked
571 }); 568 });
572 569
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 type: 'chrome', 634 type: 'chrome',
638 color: '#ffffff' 635 color: '#ffffff'
639 }, 636 },
640 'innerBounds': { 637 'innerBounds': {
641 'width': INNER_WIDTH, 638 'width': INNER_WIDTH,
642 'height': INNER_HEIGHT 639 'height': INNER_HEIGHT
643 } 640 }
644 }; 641 };
645 chrome.app.window.create('main.html', options, onWindowCreated); 642 chrome.app.window.create('main.html', options, onWindowCreated);
646 }); 643 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/arc_support/main.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698