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

Issue 159776: Rewrites the Mac view resizing logic to have the BrowserWindowController... (Closed)

Created:
11 years, 4 months ago by rohitrao (ping after 24h)
Modified:
9 years, 7 months ago
Reviewers:
John Grabowski, Nico
CC:
chromium-reviews_googlegroups.com, John Grabowski, Paul Godavari, Ben Goodger (Google)
Visibility:
Public.

Description

Rewrites the Mac view resizing logic to have the BrowserWindowController directly resize and relayout its children views. Now when a view needs to be resized, it asks its resize delegate (typically its controller's parent) to perform the resize. BUG=http://crbug.com/17619 TEST=Make sure that views are laid out correctly, even when they change size. Open and close the bookmark bar. Trigger an infobar and then close it. Trigger the download shelf and then close it. Trigger a download shelf with the infobar open, or with the bookmark bar open. Switch to and from fullscreen with various bars open. Resize the browser window with various bars open. Start the browser with and without the bookmark bar open. Try all of the above in a popup window. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=22517

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 38

Patch Set 3 : '' #

Total comments: 4

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+492 lines, -437 lines) Patch
M chrome/app/nibs/InfoBarContainer.xib View 1 2 3 4 5 6 4 chunks +22 lines, -12 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm View 2 3 4 5 6 3 chunks +5 lines, -19 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_controller.h View 1 2 3 4 5 6 4 chunks +15 lines, -20 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_controller.mm View 1 2 3 4 5 6 10 chunks +24 lines, -101 lines 0 comments Download
M chrome/browser/cocoa/bookmark_bar_controller_unittest.mm View 2 3 4 5 6 11 chunks +18 lines, -33 lines 0 comments Download
M chrome/browser/cocoa/browser_window_controller.h View 1 2 3 4 5 6 3 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/cocoa/browser_window_controller.mm View 1 2 3 4 5 6 15 chunks +120 lines, -116 lines 0 comments Download
M chrome/browser/cocoa/browser_window_controller_unittest.mm View 3 4 5 6 2 chunks +110 lines, -1 line 0 comments Download
M chrome/browser/cocoa/download_shelf_controller.h View 1 2 3 4 5 6 4 chunks +6 lines, -9 lines 0 comments Download
M chrome/browser/cocoa/download_shelf_controller.mm View 1 2 3 4 5 6 4 chunks +7 lines, -52 lines 0 comments Download
M chrome/browser/cocoa/download_shelf_mac.mm View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/cocoa/download_shelf_mac_unittest.mm View 2 3 4 5 6 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/cocoa/find_bar_cocoa_controller.h View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/cocoa/find_bar_cocoa_controller.mm View 1 2 3 4 5 6 1 chunk +12 lines, -10 lines 0 comments Download
M chrome/browser/cocoa/infobar_container_controller.h View 1 2 3 4 5 6 3 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/cocoa/infobar_container_controller.mm View 1 2 3 4 5 6 3 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/cocoa/infobar_container_controller_unittest.mm View 2 3 4 5 6 3 chunks +8 lines, -29 lines 0 comments Download
M chrome/browser/cocoa/toolbar_controller.h View 1 2 3 4 5 6 4 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/cocoa/toolbar_controller.mm View 1 2 3 4 5 6 5 chunks +27 lines, -8 lines 0 comments Download
M chrome/browser/cocoa/toolbar_controller_unittest.mm View 2 3 4 5 6 4 chunks +32 lines, -2 lines 0 comments Download
A chrome/browser/cocoa/view_resizer.h View 1 2 1 chunk +21 lines, -0 lines 0 comments Download
A chrome/browser/cocoa/view_resizer_pong.h View 1 chunk +21 lines, -0 lines 0 comments Download
A chrome/browser/cocoa/view_resizer_pong.mm View 1 chunk +19 lines, -0 lines 0 comments Download
M chrome/chrome.gyp View 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
rohitrao (ping after 24h)
http://codereview.chromium.org/159776/diff/21/1024 File chrome/browser/cocoa/download_shelf_mac.mm (right): http://codereview.chromium.org/159776/diff/21/1024#newcode16 Line 16: //Show(); Deleted in my client. Not going to ...
11 years, 4 months ago (2009-08-03 19:36:48 UTC) #1
John Grabowski
Overall I really like the direction this takes and how it cleans up resizing. http://codereview.chromium.org/159776/diff/21/1026 ...
11 years, 4 months ago (2009-08-04 07:55:23 UTC) #2
rohitrao (ping after 24h)
http://codereview.chromium.org/159776/diff/21/1026 File chrome/browser/cocoa/bookmark_bar_controller.h (right): http://codereview.chromium.org/159776/diff/21/1026#newcode56 Line 56: BOOL barShouldBeShown_; On 2009/08/04 07:55:23, John Grabowski wrote: ...
11 years, 4 months ago (2009-08-04 19:46:02 UTC) #3
Nico
Download shelf changes look good. The other platforms call show() on shelf construction, but since ...
11 years, 4 months ago (2009-08-04 20:20:57 UTC) #4
John Grabowski
LGTM Thanks for taking this on Rohit. I'll bounce some bugs to you fixed by ...
11 years, 4 months ago (2009-08-04 20:25:36 UTC) #5
Nico
For the records, rohitrao on IRC: " the show call into [BWC downloadShelf], so the ...
11 years, 4 months ago (2009-08-04 20:34:53 UTC) #6
rohitrao (ping after 24h)
11 years, 4 months ago (2009-08-04 20:54:04 UTC) #7
http://codereview.chromium.org/159776/diff/21/1022
File chrome/browser/cocoa/browser_window_controller.mm (right):

http://codereview.chromium.org/159776/diff/21/1022#newcode7
Line 7: #include "base/mac_util.h"
On 2009/08/04 07:55:23, John Grabowski wrote:
> For this whole file: be sure to add generous amounts of regression testing in
> the bug.  E.g.
> - fullscreen and back, with info bar open and closed, and bookmark bar open
and
> closed
> - pop-up windows
> 
> 

Done.

http://codereview.chromium.org/159776/diff/21/1022#newcode732
Line 732: [[toolbarController_ bookmarkBarController] setBookmarkBarEnabled:NO];
On 2009/08/04 20:25:36, John Grabowski wrote:
> On 2009/08/04 19:46:02, rohitrao wrote:
> > On 2009/08/04 07:55:23, John Grabowski wrote:
> > > This is wrong?  We don't show the toolbar in fullscreen so no need to turn
> off
> > > the bookmark bar.
> > > 
> > 
> > Don't we need this call to properly handle enabling/disabling Cmd-B?
> 
> I'm not sure.  Right now, the bookmark bar is a subview of the toolbar view.
> No toolbar view on the fullscreen window means, no matter what, you'll never
see
> the bookmark bar.  I suspect this was added when the bookmark bar was not a
> subview of the toolbar.
> 
> But don't worry about it; just add a TODO(jrg) here for me.

Done.

http://codereview.chromium.org/159776/diff/21/1021
File chrome/browser/cocoa/toolbar_controller.mm (right):

http://codereview.chromium.org/159776/diff/21/1021#newcode126
Line 126: // bookmark bar as a subview, so its width is never set correctly. 
Reset the
On 2009/08/04 20:25:36, John Grabowski wrote:
> Can you think of a better way to accomplish this?   
> 

I think my main objection is to storing a variable just so we can use it once in
awakeFromNib and never again, but it's not a very big objection.  This solution
seems as good as any to me, so I'll leave it as is.

http://codereview.chromium.org/159776/diff/28/1078
File chrome/browser/cocoa/toolbar_controller_unittest.mm (right):

http://codereview.chromium.org/159776/diff/28/1078#newcode195
Line 195: // resize to 69px.
On 2009/08/04 20:25:36, John Grabowski wrote:
> If possible use the kBaseToolbarHeight constant in case it changes.

The constant doesn't help me directly, since the only way to derive the correct
value from the constant is to copy/paste the math from the code =)

Powered by Google App Engine
This is Rietveld 408576698