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

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: Feedback addressed. 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
« no previous file with comments | « no previous file | chrome/browser/ui/fullscreen_controller_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9136131d8f1a74073ed1d51ffeaa21c01c4b7608 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 &&
+ (contents == fullscreened_tab_ || contents == mouse_lock_tab_))
ExitTabFullscreenOrMouseLockIfNecessary();
}
« no previous file with comments | « no previous file | chrome/browser/ui/fullscreen_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698