OLD | NEW |
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 Out of the box experience flow (OOBE). | 6 * @fileoverview Out of the box experience flow (OOBE). |
7 * This is the main code for the OOBE WebUI implementation. | 7 * This is the main code for the OOBE WebUI implementation. |
8 */ | 8 */ |
9 | 9 |
10 var localStrings = new LocalStrings(); | 10 var localStrings = new LocalStrings(); |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 Oobe.setTermsOfServiceLoadError = function() { | 505 Oobe.setTermsOfServiceLoadError = function() { |
506 $('terms-of-service').classList.remove('tos-loading'); | 506 $('terms-of-service').classList.remove('tos-loading'); |
507 $('terms-of-service').classList.add('error'); | 507 $('terms-of-service').classList.add('error'); |
508 }; | 508 }; |
509 | 509 |
510 /** | 510 /** |
511 * Displays the given |termsOfService| on the Terms of Service screen. | 511 * Displays the given |termsOfService| on the Terms of Service screen. |
512 * @param {string} termsOfService The terms of service, as plain text. | 512 * @param {string} termsOfService The terms of service, as plain text. |
513 */ | 513 */ |
514 Oobe.setTermsOfService = function(termsOfService) { | 514 Oobe.setTermsOfService = function(termsOfService) { |
515 $('terms-of-service').classList.remove('tos-loading'); | 515 oobe.TermsOfServiceScreen.setTermsOfService(termsOfService); |
516 $('tos-content-main').textContent = termsOfService; | |
517 $('tos-accept-button').disabled = false; | |
518 }; | 516 }; |
519 | 517 |
520 // Export | 518 // Export |
521 return { | 519 return { |
522 Oobe: Oobe | 520 Oobe: Oobe |
523 }; | 521 }; |
524 }); | 522 }); |
525 | 523 |
526 var Oobe = cr.ui.Oobe; | 524 var Oobe = cr.ui.Oobe; |
527 | 525 |
528 // Allow selection events on components with editable text (password field) | 526 // Allow selection events on components with editable text (password field) |
529 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) | 527 // bug (http://code.google.com/p/chromium/issues/detail?id=125863) |
530 disableTextSelectAndDrag(function(e) { | 528 disableTextSelectAndDrag(function(e) { |
531 var src = e.target; | 529 var src = e.target; |
532 return src instanceof HTMLTextAreaElement || | 530 return src instanceof HTMLTextAreaElement || |
533 src instanceof HTMLInputElement && | 531 src instanceof HTMLInputElement && |
534 /text|password|search/.test(src.type); | 532 /text|password|search/.test(src.type); |
535 }); | 533 }); |
536 | 534 |
537 document.addEventListener('DOMContentLoaded', cr.ui.Oobe.initialize); | 535 document.addEventListener('DOMContentLoaded', cr.ui.Oobe.initialize); |
OLD | NEW |