| Index: chrome/browser/ui/fullscreen_controller.cc
|
| diff --git a/chrome/browser/ui/fullscreen_controller.cc b/chrome/browser/ui/fullscreen_controller.cc
|
| index 4908a345f6eb34cdea0bbf563e6073a2066cd75e..dd25b65ff1bfb224ea91a079b3a22baa50bc3906 100644
|
| --- a/chrome/browser/ui/fullscreen_controller.cc
|
| +++ b/chrome/browser/ui/fullscreen_controller.cc
|
| @@ -38,16 +38,12 @@ FullscreenController::FullscreenController(BrowserWindow* window,
|
|
|
| FullscreenController::~FullscreenController() {}
|
|
|
| -bool FullscreenController::IsFullscreenForTab() const {
|
| - return fullscreened_tab_ != NULL;
|
| +bool FullscreenController::IsFullscreenForBrowser() const {
|
| + return window_->IsFullscreen() && !tab_caused_fullscreen_;
|
| }
|
|
|
| -bool FullscreenController::IsFullscreenForTab(const WebContents* tab) const {
|
| - if (IsFullscreenForTabOrPending(tab)) {
|
| - DCHECK(window_->IsFullscreen());
|
| - return true;
|
| - }
|
| - return false;
|
| +bool FullscreenController::IsFullscreenForTabOrPending() const {
|
| + return fullscreened_tab_ != NULL;
|
| }
|
|
|
| bool FullscreenController::IsFullscreenForTabOrPending(
|
| @@ -60,6 +56,10 @@ bool FullscreenController::IsFullscreenForTabOrPending(
|
| return true;
|
| }
|
|
|
| +bool FullscreenController::IsMouseLockedOrPending() const {
|
| + return mouse_lock_state_ != MOUSELOCK_NOT_REQUESTED;
|
| +}
|
| +
|
| void FullscreenController::RequestToLockMouse(WebContents* tab) {
|
| // Mouse Lock is only permitted when browser is in tab fullscreen.
|
| if (!IsFullscreenForTabOrPending(tab)) {
|
| @@ -170,7 +170,7 @@ void FullscreenController::LostMouseLock() {
|
| }
|
|
|
| void FullscreenController::OnTabClosing(WebContents* web_contents) {
|
| - if (IsFullscreenForTab(web_contents)) {
|
| + if (IsFullscreenForTabOrPending(web_contents)) {
|
| ExitTabbedFullscreenModeIfNecessary();
|
| // 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
|
| @@ -264,7 +264,7 @@ void FullscreenController::WindowFullscreenStateChanged() {
|
| }
|
|
|
| bool FullscreenController::HandleUserPressedEscape() {
|
| - if (!IsFullscreenForTab())
|
| + if (!IsFullscreenForTabOrPending())
|
| return false;
|
| ExitTabbedFullscreenModeIfNecessary();
|
| return true;
|
|
|