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

Side by Side Diff: chrome/browser/resources/chromeos/login/oobe_screen_eula.js

Issue 13820014: Show online policy on CrOS EULA page (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Modify chrome://terms to show online content Created 7 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 * @fileoverview Oobe eula screen implementation. 6 * @fileoverview Oobe eula screen implementation.
7 */ 7 */
8 8
9 cr.define('oobe', function() { 9 cr.define('oobe', function() {
10 /** 10 /**
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // WebKit does not allow immediate focus return. 46 // WebKit does not allow immediate focus return.
47 window.setTimeout(function() { 47 window.setTimeout(function() {
48 // TODO(ivankr): focus cycling. 48 // TODO(ivankr): focus cycling.
49 $('installation-settings-ok-button').focus(); 49 $('installation-settings-ok-button').focus();
50 }, 0); 50 }, 0);
51 event.preventDefault(); 51 event.preventDefault();
52 }); 52 });
53 }, 53 },
54 54
55 /** 55 /**
56 * Event handler that is invoked just before the screen is shown.
57 * @param {object} data Screen init payload.
58 */
59 onBeforeShow: function() {
60 $('cros-eula-frame').onload = function() {
61 $('accept-button').disabled = false;
62 }
63 $('cros-eula-frame').src = 'chrome://terms';
64 },
65
66 /**
56 * Header text of the screen. 67 * Header text of the screen.
57 * @type {string} 68 * @type {string}
58 */ 69 */
59 get header() { 70 get header() {
60 return loadTimeData.getString('eulaScreenTitle'); 71 return loadTimeData.getString('eulaScreenTitle');
61 }, 72 },
62 73
63 /** 74 /**
64 * Buttons in oobe wizard's button strip. 75 * Buttons in oobe wizard's button strip.
65 * @type {array} Array of Buttons. 76 * @type {array} Array of Buttons.
66 */ 77 */
67 get buttons() { 78 get buttons() {
Evan Stade 2013/04/15 19:35:08 this function should not use the getter style beca
Nikita (slow) 2013/04/16 04:36:35 Evan, thanks for the comment. I agree that this sh
68 var buttons = []; 79 var buttons = [];
69 80
70 var backButton = this.ownerDocument.createElement('button'); 81 var backButton = this.ownerDocument.createElement('button');
71 backButton.id = 'back-button'; 82 backButton.id = 'back-button';
72 backButton.textContent = loadTimeData.getString('back'); 83 backButton.textContent = loadTimeData.getString('back');
73 backButton.addEventListener('click', function(e) { 84 backButton.addEventListener('click', function(e) {
74 chrome.send('eulaOnExit', [false, $('usage-stats').checked]); 85 chrome.send('eulaOnExit', [false, $('usage-stats').checked]);
75 e.stopPropagation(); 86 e.stopPropagation();
76 }); 87 });
77 buttons.push(backButton); 88 buttons.push(backButton);
78 89
79 var acceptButton = this.ownerDocument.createElement('button'); 90 var acceptButton = this.ownerDocument.createElement('button');
80 acceptButton.id = 'accept-button'; 91 acceptButton.id = 'accept-button';
92 acceptButton.disabled = true;
93 acceptButton.classList.add('preserve-disabled-state');
81 acceptButton.textContent = loadTimeData.getString('acceptAgreement'); 94 acceptButton.textContent = loadTimeData.getString('acceptAgreement');
82 acceptButton.addEventListener('click', function(e) { 95 acceptButton.addEventListener('click', function(e) {
83 $('eula').classList.add('loading'); // Mark EULA screen busy. 96 $('eula').classList.add('loading'); // Mark EULA screen busy.
84 chrome.send('eulaOnExit', [true, $('usage-stats').checked]); 97 chrome.send('eulaOnExit', [true, $('usage-stats').checked]);
85 e.stopPropagation(); 98 e.stopPropagation();
86 }); 99 });
87 buttons.push(acceptButton); 100 buttons.push(acceptButton);
88 101
89 return buttons; 102 return buttons;
90 }, 103 },
(...skipping 13 matching lines...) Expand all
104 $('cros-eula-frame').src = $('cros-eula-frame').src; 117 $('cros-eula-frame').src = $('cros-eula-frame').src;
105 if ($('oem-eula-frame').src != '') 118 if ($('oem-eula-frame').src != '')
106 $('oem-eula-frame').src = $('oem-eula-frame').src; 119 $('oem-eula-frame').src = $('oem-eula-frame').src;
107 } 120 }
108 }; 121 };
109 122
110 return { 123 return {
111 EulaScreen: EulaScreen 124 EulaScreen: EulaScreen
112 }; 125 };
113 }); 126 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698