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

Issue 384113: Mac: Only show one per-tab sheet at a time per tab. (Closed)

Created:
11 years, 1 month ago by Nico
Modified:
9 years, 7 months ago
Reviewers:
viettrungluu
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Mac: Only show one per-tab sheet at a time per tab. BUG=26900 TEST=Go to http://www/~thakis/cgi-bin/test.html . Test that two sheets show up (the first expects "u" as user and no pass, the other "v" and no pass). The first sheet appears immediately, the second after 2 seconds. Try entering u for the first faster than 2 seconds and switch tabs, when coming back to the original tab, the 2nd sheet should wait for you. Try closing the window and the tab while a sheet is showing, both when the tab with the sheet is in the background and in the foreground. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=31920

Patch Set 1 #

Total comments: 22

Patch Set 2 : rebase tot #

Patch Set 3 : comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -14 lines) Patch
M chrome/browser/cocoa/browser_window_controller.h View 1 2 1 chunk +9 lines, -1 line 0 comments Download
M chrome/browser/cocoa/browser_window_controller.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/cocoa/constrained_window_mac.h View 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/cocoa/constrained_window_mac.mm View 1 2 1 chunk +8 lines, -2 lines 0 comments Download
M chrome/browser/cocoa/tab_strip_controller.h View 1 2 3 chunks +12 lines, -1 line 0 comments Download
M chrome/browser/cocoa/tab_strip_controller.mm View 1 2 5 chunks +44 lines, -7 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Nico
More or less the same thing as last time, but mac-only.
11 years, 1 month ago (2009-11-13 05:59:20 UTC) #1
viettrungluu
Basically LGTM, with my comments (mostly demands for more comments :-) ) addressed. http://codereview.chromium.org/384113/diff/1/2 File ...
11 years, 1 month ago (2009-11-13 18:17:48 UTC) #2
Nico
Thanks for the swift review! http://codereview.chromium.org/384113/diff/1/2 File chrome/browser/cocoa/browser_window_controller.h (right): http://codereview.chromium.org/384113/diff/1/2#newcode163 Line 163: - (BOOL)attachConstrainedWindow:(ConstrainedWindowMac*)window; On ...
11 years, 1 month ago (2009-11-13 18:35:15 UTC) #3
viettrungluu
http://codereview.chromium.org/384113/diff/1/7 File chrome/browser/cocoa/tab_strip_controller.mm (right): http://codereview.chromium.org/384113/diff/1/7#newcode1401 Line 1401: std::deque<ConstrainedWindowMac*>& windows = constrainedWindows_[tab]; On 2009/11/13 18:35:15, Nico ...
11 years, 1 month ago (2009-11-13 22:48:54 UTC) #4
Nico
11 years, 1 month ago (2009-11-13 22:55:38 UTC) #5
http://codereview.chromium.org/384113/diff/1/7
File chrome/browser/cocoa/tab_strip_controller.mm (right):

http://codereview.chromium.org/384113/diff/1/7#newcode1401
Line 1401: std::deque<ConstrainedWindowMac*>& windows =
constrainedWindows_[tab];
On 2009/11/13 22:48:54, viettrungluu wrote:
> On 2009/11/13 18:35:15, Nico wrote:
> > On 2009/11/13 18:17:48, viettrungluu wrote:
> > > Evil, I say!
> > 
> > :-)
> > 
> > When removeConstrainedWindow: is called, at least one sheet must've been
> > visible, hence the deque already exists anyway.
> 
> And if something goes horribly wrong, and it doesn't exist, it'll conveniently
> and silently create one for you!

But in that case, things have already gone horribly wrong anyway. AND I erase it
again just a few lines below.

http://codereview.chromium.org/384113/diff/1/7#newcode1418
Line 1418:
windows[0]->Realize(static_cast<BrowserWindowController*>(controller));
On 2009/11/13 22:48:54, viettrungluu wrote:
> On 2009/11/13 18:35:15, Nico wrote:
> > On 2009/11/13 18:17:48, viettrungluu wrote:
> > > I'm not a big fan of windows[0] as an idiom here; maybe windows.front()
> > instead?
> > 
> > But then it's over 80 cols! :-D
> 
> The 80-columns thing almost makes it okay. But only almost. :-P
> 
> > Done, but what's wrong with [0]? I get the impression that you don't like
> > operator overloading in general :-)
> 
> I just think deques (I hate that as a word) should have a front and a back (or
> equivalent), rather than having random access.

Why? I thought the main selling point of a deque (instead of a list) is that it
has fast random access _and_ fast push_front and push_back operations?

> I could try to make an argument
> that .front() might be slightly more efficient (not having a parameter), but I
> won't (since I don't want to look at a disassembly).

Big-O is all that matters :-)

Powered by Google App Engine
This is Rietveld 408576698