| Index: chrome/browser/ui/fullscreen_controller.cc
 | 
| diff --git a/chrome/browser/ui/fullscreen_controller.cc b/chrome/browser/ui/fullscreen_controller.cc
 | 
| index 36ebb44258d6de755c2f26612c9c6892ca76d268..24f363a476d1efec23817b2ce2aaf4a0c5af496a 100644
 | 
| --- a/chrome/browser/ui/fullscreen_controller.cc
 | 
| +++ b/chrome/browser/ui/fullscreen_controller.cc
 | 
| @@ -39,16 +39,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(
 | 
| @@ -61,6 +57,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)) {
 | 
| @@ -171,7 +171,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
 | 
| @@ -265,7 +265,7 @@ void FullscreenController::WindowFullscreenStateChanged() {
 | 
|  }
 | 
|  
 | 
|  bool FullscreenController::HandleUserPressedEscape() {
 | 
| -  if (!IsFullscreenForTab())
 | 
| +  if (!IsFullscreenForTabOrPending())
 | 
|      return false;
 | 
|    ExitTabbedFullscreenModeIfNecessary();
 | 
|    return true;
 | 
| 
 |