| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 * Functions related to controlling the modal ui state of the app. | 7 * Functions related to controlling the modal ui state of the app. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 element.hidden = hidden; | 63 element.hidden = hidden; |
| 64 } | 64 } |
| 65 remoting.debug.log('App mode: ' + mode); | 65 remoting.debug.log('App mode: ' + mode); |
| 66 remoting.currentMode = mode; | 66 remoting.currentMode = mode; |
| 67 if (mode == remoting.AppMode.IN_SESSION) { | 67 if (mode == remoting.AppMode.IN_SESSION) { |
| 68 document.removeEventListener('keydown', remoting.DebugLog.onKeydown, false); | 68 document.removeEventListener('keydown', remoting.DebugLog.onKeydown, false); |
| 69 } else { | 69 } else { |
| 70 document.addEventListener('keydown', remoting.DebugLog.onKeydown, false); | 70 document.addEventListener('keydown', remoting.DebugLog.onKeydown, false); |
| 71 } | 71 } |
| 72 if (mode == remoting.AppMode.HOME) { | 72 if (mode == remoting.AppMode.HOME) { |
| 73 remoting.hostList.refresh(); | 73 var display = function() { remoting.hostList.display(); }; |
| 74 remoting.hostList.refresh(display); |
| 74 } | 75 } |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 /** | 78 /** |
| 78 * Get the major mode that the app is running in. | 79 * Get the major mode that the app is running in. |
| 79 * @return {string} The app's current major mode. | 80 * @return {string} The app's current major mode. |
| 80 */ | 81 */ |
| 81 remoting.getMajorMode = function() { | 82 remoting.getMajorMode = function() { |
| 82 return remoting.currentMode.split('.')[0]; | 83 return remoting.currentMode.split('.')[0]; |
| 83 }; | 84 }; |
| OLD | NEW |