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

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

Issue 10642008: Exit mouse lock permision prompt on tab switch or close. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reworked Completely. Using FullscreenController::OnTabClosing ::OnTabDeactivated 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 7702c654fa78ee65cfa98afc32b78e0ac1163156..e7212bc41617f9698666412fa8fc3a53a88dce32 100644
--- a/chrome/browser/ui/fullscreen_controller.cc
+++ b/chrome/browser/ui/fullscreen_controller.cc
@@ -246,7 +246,9 @@ void FullscreenController::LostMouseLock() {
}
void FullscreenController::OnTabClosing(WebContents* web_contents) {
- if (IsFullscreenForTabOrPending(web_contents)) {
+ const TabContents* contents = TabContents::FromWebContents(web_contents);
+ if (contents &&
+ (contents == fullscreened_tab_ || contents == mouse_lock_tab_)) {
ExitTabFullscreenOrMouseLockIfNecessary();
// The call to exit fullscreen may result in asynchronous notification of
// fullscreen state change (e.g., on Linux). We don't want to rely on it
@@ -258,7 +260,8 @@ void FullscreenController::OnTabClosing(WebContents* web_contents) {
}
void FullscreenController::OnTabDeactivated(TabContents* contents) {
- if (contents == fullscreened_tab_)
+ if (contents == fullscreened_tab_ ||
yzshen1 2012/06/22 22:18:04 Do we need to check NULL here?
scheib 2012/06/22 22:27:16 Done.
+ contents == mouse_lock_tab_)
ExitTabFullscreenOrMouseLockIfNecessary();
}

Powered by Google App Engine
This is Rietveld 408576698