diff options
author | jennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-19 20:08:27 +0000 |
---|---|---|
committer | jennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-19 20:08:27 +0000 |
commit | eaf60d8ba229a9dc7344cc305ef23607ce4b52be (patch) | |
tree | 666ac84c6970b8c6ce6301d47e3cd2bc7f4f49c8 /chrome/browser/chrome_browser_application_mac.h | |
parent | 19331e339db762b810aee2b18226cafada8078bb (diff) | |
download | chromium_src-eaf60d8ba229a9dc7344cc305ef23607ce4b52be.zip chromium_src-eaf60d8ba229a9dc7344cc305ef23607ce4b52be.tar.gz chromium_src-eaf60d8ba229a9dc7344cc305ef23607ce4b52be.tar.bz2 |
Ensure the previously active window gets the focus after a Chrome window is closed on OSX.
This is a rework of the previous fix in r120593 to handle non-browser windows as well.
New logic relies on Panel browser windows returning false to -canBecomeKeyWindow in most cases.
App could be left without a key window as a result, so I also added logic to ensure that there is a key window in this case.
BUG=112038
TEST=Manually open/close tabbed windows, panels, Task Manager. Check focus after closing windows.
Review URL: https://chromiumcodereview.appspot.com/9417033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_browser_application_mac.h')
-rw-r--r-- | chrome/browser/chrome_browser_application_mac.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/chrome_browser_application_mac.h b/chrome/browser/chrome_browser_application_mac.h index c6147fd..52c6be3 100644 --- a/chrome/browser/chrome_browser_application_mac.h +++ b/chrome/browser/chrome_browser_application_mac.h @@ -23,9 +23,14 @@ CrAppControlProtocol> { @private BOOL handlingSendEvent_; + BOOL cyclingWindows_; // Array of objects implementing CrApplicationEventHookProtocol. scoped_nsobject<NSMutableArray> eventHooks_; + + // App's previous key windows. Most recent key window is last. + // Does not include current key window. + scoped_nsobject<NSMutableArray> previousKeyWindows_; } // Our implementation of |-terminate:| only attempts to terminate the @@ -43,6 +48,12 @@ // context" out of it). - (void)addEventHook:(id<CrApplicationEventHookProtocol>)hook; - (void)removeEventHook:(id<CrApplicationEventHookProtocol>)hook; + +// Keep track of the previous key windows and whether windows are being +// cycled for use in determining whether a Panel window can become the +// key window. +- (id)previousKeyWindow; +- (BOOL)isCyclingWindows; @end namespace chrome_browser_application_mac { |