| OLD | NEW |
| 1 /* Copyright 2015 The Chromium Authors. All rights reserved. | 1 /* Copyright 2015 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 cr.define('sync.confirmation', function() { | 5 cr.define('sync.confirmation', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 function onConfirm(e) { | 8 function onConfirm(e) { |
| 9 chrome.send('confirm', [$('configure-before-signing-in').checked]); | 9 chrome.send('confirm', [$('configure-before-signing-in').checked]); |
| 10 } | 10 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 // Prefer using |document.body.offsetHeight| instead of | 27 // Prefer using |document.body.offsetHeight| instead of |
| 28 // |document.body.scrollHeight| as it returns the correct height of the | 28 // |document.body.scrollHeight| as it returns the correct height of the |
| 29 // even when the page zoom in Chrome is different than 100%. | 29 // even when the page zoom in Chrome is different than 100%. |
| 30 chrome.send('initializedWithSize', [document.body.offsetHeight]); | 30 chrome.send('initializedWithSize', [document.body.offsetHeight]); |
| 31 } | 31 } |
| 32 | 32 |
| 33 function clearFocus() { | 33 function clearFocus() { |
| 34 document.activeElement.blur(); | 34 document.activeElement.blur(); |
| 35 document.documentElement.classList.add('focus-allowed'); |
| 35 } | 36 } |
| 36 | 37 |
| 37 function setUserImageURL(url) { | 38 function setUserImageURL(url) { |
| 38 if (loadTimeData.getBoolean('isSyncAllowed')) { | 39 if (loadTimeData.getBoolean('isSyncAllowed')) { |
| 39 $('profile-picture').src = url; | 40 $('profile-picture').src = url; |
| 40 } | 41 } |
| 41 } | 42 } |
| 42 | 43 |
| 43 function onPictureLoaded(e) { | 44 function onPictureLoaded(e) { |
| 44 if (loadTimeData.getBoolean('isSyncAllowed')) { | 45 if (loadTimeData.getBoolean('isSyncAllowed')) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 58 } | 59 } |
| 59 | 60 |
| 60 return { | 61 return { |
| 61 clearFocus: clearFocus, | 62 clearFocus: clearFocus, |
| 62 initialize: initialize, | 63 initialize: initialize, |
| 63 setUserImageURL: setUserImageURL | 64 setUserImageURL: setUserImageURL |
| 64 }; | 65 }; |
| 65 }); | 66 }); |
| 66 | 67 |
| 67 document.addEventListener('DOMContentLoaded', sync.confirmation.initialize); | 68 document.addEventListener('DOMContentLoaded', sync.confirmation.initialize); |
| OLD | NEW |