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(); |
} |