| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 user image screen implementation. | 6 * @fileoverview Oobe user image screen implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 cr.define('oobe', function() { | 9 cr.define('oobe', function() { |
| 10 | 10 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 114 } |
| 115 }, | 115 }, |
| 116 | 116 |
| 117 /** | 117 /** |
| 118 * Event handler that is invoked just before the screen is shown. | 118 * Event handler that is invoked just before the screen is shown. |
| 119 * @param {object} data Screen init payload. | 119 * @param {object} data Screen init payload. |
| 120 */ | 120 */ |
| 121 onBeforeShow: function(data) { | 121 onBeforeShow: function(data) { |
| 122 Oobe.getInstance().headerHidden = true; | 122 Oobe.getInstance().headerHidden = true; |
| 123 $('user-image-grid').updateAndFocus(); | 123 $('user-image-grid').updateAndFocus(); |
| 124 |
| 125 // Announce the name of the screen, if accessibility is on. |
| 126 $('user-image-aria-label').setAttribute( |
| 127 'aria-label', localStrings.getString('userImageScreenTitle')); |
| 124 }, | 128 }, |
| 125 }; | 129 }; |
| 126 | 130 |
| 127 /** | 131 /** |
| 128 * Adds or updates image with user photo and sets it as preview. | 132 * Adds or updates image with user photo and sets it as preview. |
| 129 * @param {string} photoUrl Image encoded as data URL. | 133 * @param {string} photoUrl Image encoded as data URL. |
| 130 */ | 134 */ |
| 131 UserImageScreen.setUserPhoto = function(photoUrl) { | 135 UserImageScreen.setUserPhoto = function(photoUrl) { |
| 132 var imageGrid = $('user-image-grid'); | 136 var imageGrid = $('user-image-grid'); |
| 133 if (this.photoImage_) | 137 if (this.photoImage_) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 154 UserImageScreen.setSelectedImage = function(url) { | 158 UserImageScreen.setSelectedImage = function(url) { |
| 155 var imageGrid = $('user-image-grid'); | 159 var imageGrid = $('user-image-grid'); |
| 156 imageGrid.selectedItemUrl = url; | 160 imageGrid.selectedItemUrl = url; |
| 157 imageGrid.focus(); | 161 imageGrid.focus(); |
| 158 }; | 162 }; |
| 159 | 163 |
| 160 return { | 164 return { |
| 161 UserImageScreen: UserImageScreen | 165 UserImageScreen: UserImageScreen |
| 162 }; | 166 }; |
| 163 }); | 167 }); |
| OLD | NEW |