diff options
author | yusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 14:38:36 +0000 |
---|---|---|
committer | yusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 14:38:36 +0000 |
commit | fdc9a1676cec3d933c3c5a1e875eee76aa603f87 (patch) | |
tree | a0c01a8db30f893c4fe30afe7f9e9495fbb28289 /chrome | |
parent | a848c872538d4e8ac9bf09af0f584a4c1b371711 (diff) | |
download | chromium_src-fdc9a1676cec3d933c3c5a1e875eee76aa603f87.zip chromium_src-fdc9a1676cec3d933c3c5a1e875eee76aa603f87.tar.gz chromium_src-fdc9a1676cec3d933c3c5a1e875eee76aa603f87.tar.bz2 |
Temporarily revert 152729 - Revert "Fixing crash Crash Report - Stack Signature: content::RenderWidgetHostImpl::ForwardKeybo"
ben asked to revert this in the main trunk. The real fix will be in once Issue
142422 gets fixed.
This reverts commit 54bac78404d9b2d3ddb475526da8211414ae36b2.
R=skuhne@chromium.org
BUG=134465
Review URL: https://chromiumcodereview.appspot.com/10866009
TBR=skuhne@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10876066
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153205 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/ui/browser_command_controller.cc | 36 | ||||
-rw-r--r-- | chrome/browser/ui/browser_command_controller.h | 3 |
2 files changed, 37 insertions, 2 deletions
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index c316c7e..fd53d59 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc @@ -23,6 +23,7 @@ #include "chrome/browser/ui/browser_tabstrip.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/chrome_pages.h" +#include "chrome/browser/ui/fullscreen/fullscreen_controller.h" #include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" @@ -43,6 +44,10 @@ #include "base/win/metro.h" #endif +#if defined(USE_ASH) +#include "ash/wm/window_util.h" +#endif + using content::WebContents; using content::NavigationEntry; using content::NavigationController; @@ -282,13 +287,31 @@ void BrowserCommandController::ExecuteCommandWithDisposition( NewIncognitoWindow(browser_); break; case IDC_CLOSE_WINDOW: - CloseWindow(browser_); + // Destroying a tab / browser window while it has opened a full screen + // window will destroy it's content class - which will destroy the + // delegate - which is also used by the opened full screen window's + // event handler. That will cause then a crash. To avoid that we supress + // closing of windows via key stroke while a full screen window is open. + // http://crbug.com/134465, http://crbug.com/131436 +#if defined(OS_CHROMEOS) + if (!IsFullScreenWindowOpen()) +#endif + CloseWindow(browser_); break; case IDC_NEW_TAB: NewTab(browser_); break; case IDC_CLOSE_TAB: - CloseTab(browser_); + // Destroying a tab / browser window while it has opened a full screen + // window will destroy it's content class - which will destroy the + // delegate - which is also used by the opened full screen window's + // event handler. That will cause then a crash. To avoid that we supress + // closing of windows via key stroke while a full screen window is open. + // http://crbug.com/134465, http://crbug.com/131436 +#if defined(OS_CHROMEOS) + if (!IsFullScreenWindowOpen()) +#endif + CloseTab(browser_); break; case IDC_SELECT_NEXT_TAB: SelectNextTab(browser_); @@ -1075,4 +1098,13 @@ Profile* BrowserCommandController::profile() { return browser_->profile(); } +bool BrowserCommandController::IsFullScreenWindowOpen() { +#if defined(USE_ASH) + aura::Window* window = ash::wm::GetActiveWindow(); + return (window && ash::wm::IsWindowFullscreen(window)); +#else + return false; +#endif +} + } // namespace chrome diff --git a/chrome/browser/ui/browser_command_controller.h b/chrome/browser/ui/browser_command_controller.h index 00400a3..7f5ccbd 100644 --- a/chrome/browser/ui/browser_command_controller.h +++ b/chrome/browser/ui/browser_command_controller.h @@ -161,6 +161,9 @@ class BrowserCommandController : public CommandUpdater::CommandUpdaterDelegate, inline BrowserWindow* window(); inline Profile* profile(); + // Check if any window is open in full screen mode. + bool IsFullScreenWindowOpen(); + Browser* browser_; // The CommandUpdater that manages the browser window commands. |