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

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

Issue 10537113: Fix bump-scroll on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simpler solution. Created 8 years, 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 * Class handling creation and teardown of a remoting client session. 7 * Class handling creation and teardown of a remoting client session.
8 * 8 *
9 * The ClientSession class controls lifetime of the client plugin 9 * The ClientSession class controls lifetime of the client plugin
10 * object and provides the plugin with the functionality it needs to 10 * object and provides the plugin with the functionality it needs to
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 * Toggles between full-screen and windowed mode. 632 * Toggles between full-screen and windowed mode.
633 * @return {void} Nothing. 633 * @return {void} Nothing.
634 * @private 634 * @private
635 */ 635 */
636 remoting.ClientSession.prototype.toggleFullScreen_ = function() { 636 remoting.ClientSession.prototype.toggleFullScreen_ = function() {
637 if (document.webkitIsFullScreen) { 637 if (document.webkitIsFullScreen) {
638 document.webkitCancelFullScreen(); 638 document.webkitCancelFullScreen();
639 this.enableBumpScroll_(false); 639 this.enableBumpScroll_(false);
640 } else { 640 } else {
641 document.body.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); 641 document.body.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
642 this.enableBumpScroll_(true); 642 // Don't enable bump scrolling immediately because it can result in
643 // onMouseMove firing before the webkitIsFullScreen property can be
644 // read safely (crbug.com/132180).
645 window.setTimeout(this.enableBumpScroll_.bind(this, true), 0);
643 } 646 }
644 }; 647 };
645 648
646 /** 649 /**
647 * Updates the options menu to reflect the current scale-to-fit and full-screen 650 * Updates the options menu to reflect the current scale-to-fit and full-screen
648 * settings. 651 * settings.
649 * @return {void} Nothing. 652 * @return {void} Nothing.
650 * @private 653 * @private
651 */ 654 */
652 remoting.ClientSession.prototype.onShowOptionsMenu_ = function() { 655 remoting.ClientSession.prototype.onShowOptionsMenu_ = function() {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 var lateAdjustment = 1 + (now - expected) / timeout; 770 var lateAdjustment = 1 + (now - expected) / timeout;
768 if (!that.scroll_(lateAdjustment * dx, lateAdjustment * dy)) { 771 if (!that.scroll_(lateAdjustment * dx, lateAdjustment * dy)) {
769 that.bumpScrollTimer_ = window.setTimeout( 772 that.bumpScrollTimer_ = window.setTimeout(
770 function() { repeatScroll(now + timeout); }, 773 function() { repeatScroll(now + timeout); },
771 timeout); 774 timeout);
772 } 775 }
773 }; 776 };
774 repeatScroll(new Date().getTime()); 777 repeatScroll(new Date().getTime());
775 } 778 }
776 }; 779 };
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