Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: remoting/webapp/me2mom/remoting.js

Issue 7761009: Added hot-key for toggleDebugLog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 var remoting = remoting || {}; 5 var remoting = remoting || {};
6 6
7 (function() { 7 (function() {
8 'use strict'; 8 'use strict';
9 9
10 window.addEventListener('blur', pluginLostFocus_, false); 10 window.addEventListener('blur', pluginLostFocus_, false);
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 for (var m = 0; m < modes.length; ++m) { 189 for (var m = 0; m < modes.length; ++m) {
190 if (hasClass(element.getAttribute('data-ui-mode'), modes[m])) { 190 if (hasClass(element.getAttribute('data-ui-mode'), modes[m])) {
191 hidden = false; 191 hidden = false;
192 break; 192 break;
193 } 193 }
194 } 194 }
195 element.hidden = hidden; 195 element.hidden = hidden;
196 } 196 }
197 remoting.debug.log('App mode: ' + mode); 197 remoting.debug.log('App mode: ' + mode);
198 remoting.currentMode = mode; 198 remoting.currentMode = mode;
199 if (mode == remoting.AppMode.IN_SESSION) {
200 document.removeEventListener('keydown', remoting.checkHotkeys, false);
201 } else {
202 document.addEventListener('keydown', remoting.checkHotkeys, false);
203 }
199 } 204 }
200 205
201 /** 206 /**
202 * Get the major mode that the app is running in. 207 * Get the major mode that the app is running in.
203 * @return {remoting.Mode} The app's current major mode. 208 * @return {remoting.Mode} The app's current major mode.
204 */ 209 */
205 remoting.getMajorMode = function(mode) { 210 remoting.getMajorMode = function(mode) {
206 return remoting.currentMode.split('.')[0]; 211 return remoting.currentMode.split('.')[0];
207 } 212 }
208 213
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 case remoting.AppMode.HOST_WAITING_FOR_CONNECTION: 646 case remoting.AppMode.HOST_WAITING_FOR_CONNECTION:
642 case remoting.AppMode.HOST_SHARED: 647 case remoting.AppMode.HOST_SHARED:
643 case remoting.AppMode.IN_SESSION: 648 case remoting.AppMode.IN_SESSION:
644 var result = chrome.i18n.getMessage(/*i18n-content*/'CLOSE_PROMPT'); 649 var result = chrome.i18n.getMessage(/*i18n-content*/'CLOSE_PROMPT');
645 return result; 650 return result;
646 default: 651 default:
647 return NULL; 652 return NULL;
648 } 653 }
649 } 654 }
650 655
656 remoting.checkHotkeys = function(event) {
657 if (String.fromCharCode(event.which) == 'D') {
658 remoting.toggleDebugLog();
659 }
660 }
661
651 }()); 662 }());
652
653 // Shortcut to save typing now that this is the only way to show the debug log.
654 var tdl = remoting.toggleDebugLog;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698