OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 | 6 * @fileoverview |
7 * Loading dialog for AppRemoting apps. | 7 * Loading dialog for AppRemoting apps. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 25 matching lines...) Expand all Loading... |
36 remoting.LoadingWindow.show = function() { | 36 remoting.LoadingWindow.show = function() { |
37 if (remoting.loadingWindow_) { | 37 if (remoting.loadingWindow_) { |
38 return; | 38 return; |
39 } | 39 } |
40 | 40 |
41 // TODO(garykac): Choose better default timeout. | 41 // TODO(garykac): Choose better default timeout. |
42 // Timeout is currently 15min to handle when we need to spin up a new VM. | 42 // Timeout is currently 15min to handle when we need to spin up a new VM. |
43 var kConnectionTimeout = 15 * 60 * 1000; | 43 var kConnectionTimeout = 15 * 60 * 1000; |
44 | 44 |
45 var transparencyWarning = ''; | 45 var transparencyWarning = ''; |
46 if (navigator.platform.indexOf('Mac') != -1) { | 46 if (remoting.platformIsMac()) { |
47 transparencyWarning = | 47 transparencyWarning = |
48 chrome.i18n.getMessage(/*i18n-content*/'NO_TRANSPARENCY_WARNING'); | 48 chrome.i18n.getMessage(/*i18n-content*/'NO_TRANSPARENCY_WARNING'); |
49 } | 49 } |
50 remoting.loadingWindow_ = remoting.MessageWindow.showTimedMessageWindow( | 50 remoting.loadingWindow_ = remoting.MessageWindow.showTimedMessageWindow( |
51 chrome.i18n.getMessage(/*i18n-content*/'PRODUCT_NAME_APP_STREAMING'), | 51 chrome.i18n.getMessage(/*i18n-content*/'PRODUCT_NAME_APP_STREAMING'), |
52 chrome.i18n.getMessage(/*i18n-content*/'FOOTER_CONNECTING'), | 52 chrome.i18n.getMessage(/*i18n-content*/'FOOTER_CONNECTING'), |
53 transparencyWarning, | 53 transparencyWarning, |
54 chrome.i18n.getMessage(/*i18n-content*/'CANCEL'), | 54 chrome.i18n.getMessage(/*i18n-content*/'CANCEL'), |
55 remoting.MessageWindow.quitApp, | 55 remoting.MessageWindow.quitApp, |
56 kConnectionTimeout, | 56 kConnectionTimeout, |
57 remoting.LoadingWindow.onTimeout_); | 57 remoting.LoadingWindow.onTimeout_); |
58 }; | 58 }; |
59 | 59 |
60 /** | 60 /** |
61 * Close the loading window. | 61 * Close the loading window. |
62 */ | 62 */ |
63 remoting.LoadingWindow.close = function() { | 63 remoting.LoadingWindow.close = function() { |
64 if (remoting.loadingWindow_) { | 64 if (remoting.loadingWindow_) { |
65 remoting.loadingWindow_.close(); | 65 remoting.loadingWindow_.close(); |
66 } | 66 } |
67 remoting.loadingWindow_ = null; | 67 remoting.loadingWindow_ = null; |
68 }; | 68 }; |
69 | 69 |
70 /** @type {remoting.MessageWindow} */ | 70 /** @type {remoting.MessageWindow} */ |
71 remoting.loadingWindow_ = null; | 71 remoting.loadingWindow_ = null; |
OLD | NEW |