| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * Chrome window that hosts UI. Only one window is allowed. | 6 * Chrome window that hosts UI. Only one window is allowed. |
| 7 * @type {chrome.app.window.AppWindow} | 7 * @type {chrome.app.window.AppWindow} |
| 8 */ | 8 */ |
| 9 var appWindow = null; | 9 var appWindow = null; |
| 10 | 10 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 | 128 |
| 129 /** | 129 /** |
| 130 * Called when the "Learn More" link is clicked. | 130 * Called when the "Learn More" link is clicked. |
| 131 */ | 131 */ |
| 132 onLearnMoreLinkClicked() { | 132 onLearnMoreLinkClicked() { |
| 133 showTextOverlay(this.learnMoreContent_); | 133 showTextOverlay(this.learnMoreContent_); |
| 134 } | 134 } |
| 135 }; | 135 } |
| 136 | 136 |
| 137 /** | 137 /** |
| 138 * Handles the checkbox action of metrics preference. | 138 * Handles the checkbox action of metrics preference. |
| 139 * This has special customization e.g. show/hide the checkbox based on | 139 * This has special customization e.g. show/hide the checkbox based on |
| 140 * the native preference. | 140 * the native preference. |
| 141 */ | 141 */ |
| 142 class MetricsPreferenceCheckbox extends PreferenceCheckbox { | 142 class MetricsPreferenceCheckbox extends PreferenceCheckbox { |
| 143 constructor( | 143 constructor( |
| 144 container, learnMoreContent, learnMoreLinkId, isOwner, | 144 container, learnMoreContent, learnMoreLinkId, isOwner, |
| 145 textDisabled, textEnabled, textManagedDisabled, textManagedEnabled) { | 145 textDisabled, textEnabled, textManagedDisabled, textManagedEnabled) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 var settingsLink = this.label_.querySelector('#settings-link'); | 182 var settingsLink = this.label_.querySelector('#settings-link'); |
| 183 settingsLink.addEventListener( | 183 settingsLink.addEventListener( |
| 184 'click', (event) => this.onSettingsLinkClicked(event)); | 184 'click', (event) => this.onSettingsLinkClicked(event)); |
| 185 } | 185 } |
| 186 | 186 |
| 187 /** Called when "settings" link is clicked. */ | 187 /** Called when "settings" link is clicked. */ |
| 188 onSettingsLinkClicked(event) { | 188 onSettingsLinkClicked(event) { |
| 189 chrome.browser.openTab({'url': 'chrome://settings'}, function() {}); | 189 chrome.browser.openTab({'url': 'chrome://settings'}, function() {}); |
| 190 event.preventDefault(); | 190 event.preventDefault(); |
| 191 } | 191 } |
| 192 }; | 192 } |
| 193 | 193 |
| 194 /** | 194 /** |
| 195 * Represents the page loading state. | 195 * Represents the page loading state. |
| 196 * @enum {number} | 196 * @enum {number} |
| 197 */ | 197 */ |
| 198 var LoadState = { | 198 var LoadState = { |
| 199 UNLOADED: 0, | 199 UNLOADED: 0, |
| 200 LOADING: 1, | 200 LOADING: 1, |
| 201 ABORTED: 2, | 201 ABORTED: 2, |
| 202 LOADED: 3, | 202 LOADED: 3, |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 | 390 |
| 391 /** Called when backup-restore preference is updated. */ | 391 /** Called when backup-restore preference is updated. */ |
| 392 onBackupRestorePreferenceChanged(isEnabled, isManaged) { | 392 onBackupRestorePreferenceChanged(isEnabled, isManaged) { |
| 393 this.backupRestoreCheckbox_.onPreferenceChanged(isEnabled, isManaged); | 393 this.backupRestoreCheckbox_.onPreferenceChanged(isEnabled, isManaged); |
| 394 } | 394 } |
| 395 | 395 |
| 396 /** Called when location service preference is updated. */ | 396 /** Called when location service preference is updated. */ |
| 397 onLocationServicePreferenceChanged(isEnabled, isManaged) { | 397 onLocationServicePreferenceChanged(isEnabled, isManaged) { |
| 398 this.locationServiceCheckbox_.onPreferenceChanged(isEnabled, isManaged); | 398 this.locationServiceCheckbox_.onPreferenceChanged(isEnabled, isManaged); |
| 399 } | 399 } |
| 400 }; | 400 } |
| 401 | 401 |
| 402 /** | 402 /** |
| 403 * Applies localization for html content and sets terms webview. | 403 * Applies localization for html content and sets terms webview. |
| 404 * @param {!Object} data Localized strings and relevant information. | 404 * @param {!Object} data Localized strings and relevant information. |
| 405 * @param {string} deviceId Current device id. | 405 * @param {string} deviceId Current device id. |
| 406 */ | 406 */ |
| 407 function initialize(data, deviceId) { | 407 function initialize(data, deviceId) { |
| 408 currentDeviceId = deviceId; | 408 currentDeviceId = deviceId; |
| 409 var doc = appWindow.contentWindow.document; | 409 var doc = appWindow.contentWindow.document; |
| 410 var loadTimeData = appWindow.contentWindow.loadTimeData; | 410 var loadTimeData = appWindow.contentWindow.loadTimeData; |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 type: 'chrome', | 766 type: 'chrome', |
| 767 color: '#ffffff' | 767 color: '#ffffff' |
| 768 }, | 768 }, |
| 769 'innerBounds': { | 769 'innerBounds': { |
| 770 'width': INNER_WIDTH, | 770 'width': INNER_WIDTH, |
| 771 'height': INNER_HEIGHT | 771 'height': INNER_HEIGHT |
| 772 } | 772 } |
| 773 }; | 773 }; |
| 774 chrome.app.window.create('main.html', options, onWindowCreated); | 774 chrome.app.window.create('main.html', options, onWindowCreated); |
| 775 }); | 775 }); |
| OLD | NEW |