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

Unified Diff: content/browser/renderer_host/render_view_host.cc

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, 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_view_host.cc
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc
index e051c0faff97076db274771308ff692bdf2e8884..431d87bab21384535676052a5b8914de2f494868 100644
--- a/content/browser/renderer_host/render_view_host.cc
+++ b/content/browser/renderer_host/render_view_host.cc
@@ -1131,6 +1131,11 @@ void RenderViewHost::NotifyRendererResponsive() {
delegate_->RendererResponsive(this);
}
+bool RenderViewHost::CanLockMouse() const {
+ // Only allow to lock the mouse when the current tab is in fullscreen mode.
+ return delegate_->IsFullscreenForCurrentTab();
+}
+
void RenderViewHost::OnMsgFocus() {
delegate_->Activate();
}
@@ -1223,6 +1228,8 @@ void RenderViewHost::SetAltErrorPageURL(const GURL& url) {
}
void RenderViewHost::ExitFullscreen() {
+ UnlockMouseIfNecessary();
+
Send(new ViewMsg_ExitFullscreen(routing_id()));
}
« no previous file with comments | « content/browser/renderer_host/render_view_host.h ('k') | content/browser/renderer_host/render_view_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698