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

Issue 9310075: Ensure the previously active browser window gets the focus after a browser window is closed on OSX. (Closed)

Created:
8 years, 10 months ago by jennb
Modified:
8 years, 10 months ago
CC:
chromium-reviews, jennb, jianli, dcheng, prasadt
Visibility:
Public.

Description

Ensure the previously active browser window gets the focus after a browser window is closed on OSX. Also cleaned up extra orderOut: call since browser shutdown process has improved since that line was added. See crbug 23959 for history. BUG=112038 TEST=Manually open tabbed windows and panels and close them. Watch focus go back to last active window. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=120593

Patch Set 1 #

Patch Set 2 : fix small typos #

Total comments: 6

Patch Set 3 : separate return to its own line #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -18 lines) Patch
M chrome/browser/ui/cocoa/browser_window_cocoa.mm View 1 chunk +2 lines, -12 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller.mm View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_utils.h View 1 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_utils.mm View 1 2 2 chunks +20 lines, -0 lines 4 comments Download
M chrome/browser/ui/cocoa/tabs/tab_window_controller.mm View 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/ui/panels/panel_window_controller_cocoa.mm View 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
jennb
pinkerton@, viettrungluu@: I added you as reviewers because your names are associated with the orderOut ...
8 years, 10 months ago (2012-02-02 23:47:25 UTC) #1
Dmitry Titov
Will it also fix the mentioned bug if instead of closing the browser window it ...
8 years, 10 months ago (2012-02-03 03:01:45 UTC) #2
jennb
No, minimized is a different issue. Daniel is working on that separately. On Thu, Feb ...
8 years, 10 months ago (2012-02-03 04:28:53 UTC) #3
Dmitry Titov
lgtm for panels. Need either pink@ or viettrungluu@ to take a look though.
8 years, 10 months ago (2012-02-03 08:44:21 UTC) #4
pink (ping after 24hrs)
Fix the description, OXS -> OSX. I'm ok with the changes themselves, but not yet ...
8 years, 10 months ago (2012-02-03 14:24:55 UTC) #5
Mark Mentovai
Jenn, can you please explain why you think it’s desirable to go against the standard ...
8 years, 10 months ago (2012-02-03 16:22:53 UTC) #6
jennb
To address Mark's question, we are actually trying to make behavior look like 'standard system ...
8 years, 10 months ago (2012-02-03 18:12:06 UTC) #7
pink (ping after 24hrs)
lgtm http://codereview.chromium.org/9310075/diff/3001/chrome/browser/ui/cocoa/browser_window_controller.mm File chrome/browser/ui/cocoa/browser_window_controller.mm (right): http://codereview.chromium.org/9310075/diff/3001/chrome/browser/ui/cocoa/browser_window_controller.mm#newcode550 chrome/browser/ui/cocoa/browser_window_controller.mm:550: [BrowserWindowUtils selectPreviousActiveBrowserWindow:browser_.get()]; On 2012/02/03 18:12:06, jennb wrote: > ...
8 years, 10 months ago (2012-02-03 18:42:22 UTC) #8
pink (ping after 24hrs)
Sorry, didn't mean to give LGTM.
8 years, 10 months ago (2012-02-03 18:42:37 UTC) #9
jennb
I should also mention that I'm open to advice from Mac experts on better alternatives ...
8 years, 10 months ago (2012-02-03 19:20:30 UTC) #10
Dmitry Titov
Just to add some background: the use case we are after is a 'chat on ...
8 years, 10 months ago (2012-02-03 19:49:31 UTC) #11
pink (ping after 24hrs)
Ok, LGTM. Just make sure this doesn't impact any other window layering in the app.
8 years, 10 months ago (2012-02-06 14:31:40 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jennb@chromium.org/9310075/9001
8 years, 10 months ago (2012-02-06 17:44:32 UTC) #13
commit-bot: I haz the power
Change committed as 120593
8 years, 10 months ago (2012-02-06 20:06:13 UTC) #14
Scott Hess - ex-Googler
Sorry for the late comments, was OOT. http://codereview.chromium.org/9310075/diff/9001/chrome/browser/ui/cocoa/browser_window_utils.mm File chrome/browser/ui/cocoa/browser_window_utils.mm (right): http://codereview.chromium.org/9310075/diff/9001/chrome/browser/ui/cocoa/browser_window_utils.mm#newcode193 chrome/browser/ui/cocoa/browser_window_utils.mm:193: return; Are ...
8 years, 10 months ago (2012-02-09 22:51:54 UTC) #15
jennb
http://codereview.chromium.org/9310075/diff/9001/chrome/browser/ui/cocoa/browser_window_utils.mm File chrome/browser/ui/cocoa/browser_window_utils.mm (right): http://codereview.chromium.org/9310075/diff/9001/chrome/browser/ui/cocoa/browser_window_utils.mm#newcode193 chrome/browser/ui/cocoa/browser_window_utils.mm:193: return; On 2012/02/09 22:51:54, shess wrote: > Are you ...
8 years, 10 months ago (2012-02-09 23:25:24 UTC) #16
Scott Hess - ex-Googler
8 years, 10 months ago (2012-02-10 00:11:20 UTC) #17
On 2012/02/09 23:25:24, jennb wrote:
> Thanks for pointing out the non-browser window case. I wasn't aware of such
> windows. I want the last active Chrome window to become key, whether it's a
> browser or non-browser window. If a Panel was last active, it is allowed to
> become key so I can't rule out all Panels.
> 
> Perhaps I can use a combination of iterating the app's window list and
comparing
> against browserlist's last active list to find an alternate solution. Will
work
> on it more.

Hmm.

Since windows can be closed without becoming active (click close button while
window is not key, or calling close from script), in the limit this ends up
requiring that you maintain a set of windows ordered by when they last became
key.  Which is doable, but I think maybe not preferable.  I can see your
reasoning for why you might want the panel to become active again if you went
from a panel to a browser window and then closed the browser window, but at that
point I'm starting to wonder if we're abusing the system.

I think it would be reasonable to special-case panels so that they can become
key when directly selected, but otherwise they can only become key if all the
non-panel windows are closed or minimized.  I could see also allowing the next
panel in order to become key if a panel is closed when key (but not if closed
without making key), but I could also see not special-casing that.

BTW, as you might have guessed from earlier reviewer comments, how ordering goes
on Windows is probably a red herring.  If there are specific non-hypothetical
use cases, it might be useful to have an example app for people to look at to
see if it feels weird.  Meanwhile, I think there's some utility to having a
clear ordering to who gets focus next, rather than potentially breaking the
ordering now to fix hypothetical problems (unless you think we need to flush out
potential API changes early?).

Powered by Google App Engine
This is Rietveld 408576698