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

Unified Diff: chrome/browser/ui/fullscreen_controller.cc

Issue 10567002: Mouse lock and fullscreen exit upon reload. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fullscreen added to test 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/fullscreen_controller.cc
diff --git a/chrome/browser/ui/fullscreen_controller.cc b/chrome/browser/ui/fullscreen_controller.cc
index d75f4e615cc82cdd8eab7d75eb13b23b5ce9c3d1..8fd44afc8773cb72459f42c907479cd7d7b8a96b 100644
--- a/chrome/browser/ui/fullscreen_controller.cc
+++ b/chrome/browser/ui/fullscreen_controller.cc
@@ -77,6 +77,7 @@ void FullscreenController::RequestToLockMouse(WebContents* web_contents,
bool user_gesture,
bool last_unlocked_by_target) {
DCHECK(!IsMouseLocked());
+ NotifyMouseLockChange();
// Check for command line switch disabling mouse lock when not tab fullscreen.
if (CommandLine::ForCurrentProcess()->HasSwitch(
@@ -86,8 +87,6 @@ void FullscreenController::RequestToLockMouse(WebContents* web_contents,
return;
}
- NotifyMouseLockChange();
-
// Must have a user gesture to prevent misbehaving sites from constantly
// re-locking the mouse. Exceptions are when the page has unlocked
// (i.e. not the user), or if we're in tab fullscreen (user gesture required
@@ -338,6 +337,15 @@ bool FullscreenController::HandleUserPressedEscape() {
return false;
}
+bool FullscreenController::HandleUserPressedReload() {
+ if (IsFullscreenForTabOrPending() ||
+ IsMouseLocked() || IsMouseLockRequested()) {
+ ExitTabFullscreenOrMouseLockIfNecessary();
+ }
+
+ return false;
+}
+
FullscreenController::~FullscreenController() {}
void FullscreenController::NotifyTabOfExitIfNecessary() {
@@ -355,6 +363,7 @@ void FullscreenController::NotifyTabOfExitIfNecessary() {
WebContents* web_contents = mouse_lock_tab_->web_contents();
if (IsMouseLockRequested()) {
web_contents->GotResponseToLockMouseRequest(false);
+ NotifyMouseLockChange();
} else if (web_contents->GetRenderViewHost() &&
web_contents->GetRenderViewHost()->GetView()) {
web_contents->GetRenderViewHost()->GetView()->UnlockMouse();

Powered by Google App Engine
This is Rietveld 408576698