| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 * Javascript for local_discovery.html, served from chrome://devices/ | 6 * Javascript for local_discovery.html, served from chrome://devices/ |
| 7 * This is used to show discoverable devices near the user. | 7 * This is used to show discoverable devices near the user. |
| 8 * | 8 * |
| 9 * The simple object defined in this javascript file listens for | 9 * The simple object defined in this javascript file listens for |
| 10 * callbacks from the C++ code saying that a new device is available. | 10 * callbacks from the C++ code saying that a new device is available. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 uber.invokeMethodOnParent('beginInterceptingEvents'); | 137 uber.invokeMethodOnParent('beginInterceptingEvents'); |
| 138 } | 138 } |
| 139 | 139 |
| 140 /** | 140 /** |
| 141 * Show the register overlay. | 141 * Show the register overlay. |
| 142 */ | 142 */ |
| 143 function hideRegisterOverlay() { | 143 function hideRegisterOverlay() { |
| 144 $('register-overlay').classList.remove('showing'); | 144 $('register-overlay').classList.remove('showing'); |
| 145 $('overlay').hidden = true; | 145 $('overlay').hidden = true; |
| 146 uber.invokeMethodOnParent('stopInterceptingEvents'); | 146 uber.invokeMethodOnParent('stopInterceptingEvents'); |
| 147 chrome.send('cancelRegistration'); |
| 147 } | 148 } |
| 148 | 149 |
| 149 /** | 150 /** |
| 150 * Clear a DOM element of all children. | 151 * Clear a DOM element of all children. |
| 151 * @param {HTMLElement} element DOM element to clear. | 152 * @param {HTMLElement} element DOM element to clear. |
| 152 */ | 153 */ |
| 153 function clearElement(element) { | 154 function clearElement(element) { |
| 154 while (element.firstChild) { | 155 while (element.firstChild) { |
| 155 element.removeChild(element.firstChild); | 156 element.removeChild(element.firstChild); |
| 156 } | 157 } |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 }); | 272 }); |
| 272 | 273 |
| 273 return { | 274 return { |
| 274 registrationSuccess: registrationSuccess, | 275 registrationSuccess: registrationSuccess, |
| 275 registrationFailed: registrationFailed, | 276 registrationFailed: registrationFailed, |
| 276 onDeviceUpdate: onDeviceUpdate, | 277 onDeviceUpdate: onDeviceUpdate, |
| 277 requestUser: requestUser, | 278 requestUser: requestUser, |
| 278 registrationConfirmedOnPrinter: registrationConfirmedOnPrinter | 279 registrationConfirmedOnPrinter: registrationConfirmedOnPrinter |
| 279 }; | 280 }; |
| 280 }); | 281 }); |
| OLD | NEW |