| 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 * 'none' hides all views. | 480 * 'none' hides all views. |
| 481 * @param {string} pageDivId id of divider of the page to show. | 481 * @param {string} pageDivId id of divider of the page to show. |
| 482 */ | 482 */ |
| 483 function showPage(pageDivId) { | 483 function showPage(pageDivId) { |
| 484 if (!appWindow) { | 484 if (!appWindow) { |
| 485 return; | 485 return; |
| 486 } | 486 } |
| 487 | 487 |
| 488 hideOverlay(); | 488 hideOverlay(); |
| 489 var doc = appWindow.contentWindow.document; | 489 var doc = appWindow.contentWindow.document; |
| 490 var pages = doc.getElementsByClassName('section'); | 490 // If the request is lso-loading and arc-loading page is currently shown, |
| 491 for (var i = 0; i < pages.length; i++) { | 491 // then we do not switch the view. This is because both pages are saying |
| 492 pages[i].hidden = pages[i].id != pageDivId; | 492 // "operation in progress", and switching the page looks unwanted message |
| 493 // change from users' point of view. |
| 494 if (pageDivId != 'lso-loading' || doc.getElementById('arc-loading').hidden) { |
| 495 var pages = doc.getElementsByClassName('section'); |
| 496 for (var i = 0; i < pages.length; i++) { |
| 497 pages[i].hidden = pages[i].id != pageDivId; |
| 498 } |
| 493 } | 499 } |
| 494 | 500 |
| 495 if (pageDivId == 'lso-loading') { | 501 if (pageDivId == 'lso-loading') { |
| 496 lsoView.src = 'https://accounts.google.com/o/oauth2/v2/auth?client_id=' + | 502 lsoView.src = 'https://accounts.google.com/o/oauth2/v2/auth?client_id=' + |
| 497 '1070009224336-sdh77n7uot3oc99ais00jmuft6sk2fg9.apps.' + | 503 '1070009224336-sdh77n7uot3oc99ais00jmuft6sk2fg9.apps.' + |
| 498 'googleusercontent.com&response_type=code&redirect_uri=oob&' + | 504 'googleusercontent.com&response_type=code&redirect_uri=oob&' + |
| 499 'scope=https://www.google.com/accounts/OAuthLogin&' + | 505 'scope=https://www.google.com/accounts/OAuthLogin&' + |
| 500 'device_type=arc_plus_plus&device_id=' + currentDeviceId + | 506 'device_type=arc_plus_plus&device_id=' + currentDeviceId + |
| 501 '&hl=' + navigator.language; | 507 '&hl=' + navigator.language; |
| 502 } | 508 } |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 type: 'chrome', | 745 type: 'chrome', |
| 740 color: '#ffffff' | 746 color: '#ffffff' |
| 741 }, | 747 }, |
| 742 'innerBounds': { | 748 'innerBounds': { |
| 743 'width': INNER_WIDTH, | 749 'width': INNER_WIDTH, |
| 744 'height': INNER_HEIGHT | 750 'height': INNER_HEIGHT |
| 745 } | 751 } |
| 746 }; | 752 }; |
| 747 chrome.app.window.create('main.html', options, onWindowCreated); | 753 chrome.app.window.create('main.html', options, onWindowCreated); |
| 748 }); | 754 }); |
| OLD | NEW |