| 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 * UI Pages. Note the order must be in sync with the ArcAuthService::UIPage | 6 * UI Pages. Note the order must be in sync with the ArcAuthService::UIPage |
| 7 * enum. | 7 * enum. |
| 8 * @type {Array<string>} | 8 * @type {Array<string>} |
| 9 */ | 9 */ |
| 10 var UI_PAGES = ['none', | 10 var UI_PAGES = ['none', |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 this.termsView_.style.height = style.getPropertyValue('height'); | 329 this.termsView_.style.height = style.getPropertyValue('height'); |
| 330 }.bind(this), 0); | 330 }.bind(this), 0); |
| 331 } | 331 } |
| 332 | 332 |
| 333 /** Starts to load the terms of service webview content. */ | 333 /** Starts to load the terms of service webview content. */ |
| 334 startTermsViewLoading_() { | 334 startTermsViewLoading_() { |
| 335 if (this.state_ == LoadState.LOADING) { | 335 if (this.state_ == LoadState.LOADING) { |
| 336 // If there already is inflight loading task, do nothing. | 336 // If there already is inflight loading task, do nothing. |
| 337 return; | 337 return; |
| 338 } | 338 } |
| 339 this.termsView_.src = 'https://play.google.com/about/play-terms.html'; | 339 |
| 340 if (this.termsView_.src) { |
| 341 // This is reloading the page, typically clicked RETRY on error page. |
| 342 this.termsView_.reload(); |
| 343 } else { |
| 344 // This is first loading case so set the URL explicitly. |
| 345 this.termsView_.src = 'https://play.google.com/about/play-terms.html'; |
| 346 } |
| 340 } | 347 } |
| 341 | 348 |
| 342 /** Called when the terms-view starts to be loaded. */ | 349 /** Called when the terms-view starts to be loaded. */ |
| 343 onTermsViewLoadStarted_() { | 350 onTermsViewLoadStarted_() { |
| 344 // Note: Reloading can be triggered by user action. E.g., user may select | 351 // Note: Reloading can be triggered by user action. E.g., user may select |
| 345 // their language by selection at the bottom of the Terms Of Service | 352 // their language by selection at the bottom of the Terms Of Service |
| 346 // content. | 353 // content. |
| 347 this.state_ = LoadState.LOADING; | 354 this.state_ = LoadState.LOADING; |
| 348 // Show loading page. | 355 // Show loading page. |
| 349 this.loadingContainer_.hidden = false; | 356 this.loadingContainer_.hidden = false; |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 type: 'chrome', | 795 type: 'chrome', |
| 789 color: '#ffffff' | 796 color: '#ffffff' |
| 790 }, | 797 }, |
| 791 'innerBounds': { | 798 'innerBounds': { |
| 792 'width': INNER_WIDTH, | 799 'width': INNER_WIDTH, |
| 793 'height': INNER_HEIGHT | 800 'height': INNER_HEIGHT |
| 794 } | 801 } |
| 795 }; | 802 }; |
| 796 chrome.app.window.create('main.html', options, onWindowCreated); | 803 chrome.app.window.create('main.html', options, onWindowCreated); |
| 797 }); | 804 }); |
| OLD | NEW |