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

Side by Side Diff: content/browser/renderer_host/render_widget_host.h

Issue 8072011: Only allow to lock the mouse when the tab is in fullscreen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make changes in response to review comments & sync. Created 9 years, 2 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
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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <string> 10 #include <string>
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 // RenderViewHostDelegate). The gestures that count are 1) any mouse down 461 // RenderViewHostDelegate). The gestures that count are 1) any mouse down
462 // event and 2) enter or space key presses. 462 // event and 2) enter or space key presses.
463 virtual void OnUserGesture() {} 463 virtual void OnUserGesture() {}
464 464
465 // Callbacks for notification when the renderer becomes unresponsive to user 465 // Callbacks for notification when the renderer becomes unresponsive to user
466 // input events, and subsequently responsive again. RenderViewHost overrides 466 // input events, and subsequently responsive again. RenderViewHost overrides
467 // these to tell its delegate to show the user a warning. 467 // these to tell its delegate to show the user a warning.
468 virtual void NotifyRendererUnresponsive() {} 468 virtual void NotifyRendererUnresponsive() {}
469 virtual void NotifyRendererResponsive() {} 469 virtual void NotifyRendererResponsive() {}
470 470
471 // RenderViewHost overrides this method to impose further restrictions on when
472 // to allow mouse lock. For now, it only allows to lock the mouse when the
473 // current tab is in fullscreen mode.
474 virtual bool CanLockMouse() const;
475
476 void UnlockMouseIfNecessary();
471 bool IsMouseLocked() const; 477 bool IsMouseLocked() const;
472 478
473 protected: 479 protected:
474 // true if a renderer has once been valid. We use this flag to display a sad 480 // true if a renderer has once been valid. We use this flag to display a sad
475 // tab only when we lose our renderer and not if a paint occurs during 481 // tab only when we lose our renderer and not if a paint occurs during
476 // initialization. 482 // initialization.
477 bool renderer_initialized_; 483 bool renderer_initialized_;
478 484
479 private: 485 private:
480 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, Resize); 486 FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, Resize);
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 733
728 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_; 734 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_;
729 735
730 // The last scroll offset of the render widget. 736 // The last scroll offset of the render widget.
731 gfx::Point last_scroll_offset_; 737 gfx::Point last_scroll_offset_;
732 738
733 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); 739 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost);
734 }; 740 };
735 741
736 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 742 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_delegate.cc ('k') | content/browser/renderer_host/render_widget_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698