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

Issue 3547008: Handle resize corner layout entirely in the platform BrowserWindow*/BrowserView* code... (Closed)

Created:
10 years, 2 months ago by Aleksey Shlyapnikov
Modified:
9 years, 7 months ago
CC:
chromium-reviews, darin-cc_chromium.org, Paweł Hajdan Jr., brettw-cc_chromium.org, pam+watch_chromium.org, ben+cc_chromium.org
Visibility:
Public.

Description

Handle resize corner layout entirely in the BrowserView (views) or BrowserWindow* (Mac) and extend RenderViewHost with a concept of reserved contents rect, a place to show extra stuff, such as Sidebar's mini tab UI. sidebar UI implementation warranted this change (mini tabs UI and resize corner area for sidebar contents). TabContentsDelegate::GetRootWindowResizerRect() is no more, reserved contents area is now cached in RenderWidgetHostView and updated upon view resize. Views: BrowserView is responsible for the actual layout and reserved contents area update. Mac: TabContentsController now manages all TabContents views in the main browser window to solve two problems, first to prevent contents flickering during tab change not only for the page, but for the sidebar and devtools contents too and, second, to monitor contents view frame changes and update reserved contents area accordingly. BUG=51084 TEST=All tests should pass, this is a refactoring CL. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=66332

Patch Set 1 #

Total comments: 16

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 13

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Total comments: 9

Patch Set 10 : '' #

Patch Set 11 : '' #

Total comments: 14

Patch Set 12 : '' #

Total comments: 8

Patch Set 13 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+503 lines, -266 lines) Patch
M chrome/browser/cocoa/browser_window_cocoa.h View 1 2 3 4 5 6 11 12 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/cocoa/browser_window_cocoa.mm View 1 2 3 4 5 6 11 12 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/cocoa/browser_window_controller.h View 1 2 3 4 5 6 11 12 3 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/cocoa/browser_window_controller.mm View 1 2 3 4 5 6 11 12 6 chunks +49 lines, -22 lines 0 comments Download
M chrome/browser/cocoa/dev_tools_controller.h View 11 12 3 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/cocoa/dev_tools_controller.mm View 11 12 6 chunks +35 lines, -8 lines 0 comments Download
M chrome/browser/cocoa/sidebar_controller.h View 11 12 3 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/cocoa/sidebar_controller.mm View 11 12 5 chunks +21 lines, -12 lines 0 comments Download
M chrome/browser/cocoa/tab_contents_controller.h View 11 12 3 chunks +33 lines, -11 lines 0 comments Download
M chrome/browser/cocoa/tab_contents_controller.mm View 6 11 12 3 chunks +136 lines, -16 lines 0 comments Download
M chrome/browser/cocoa/tab_strip_controller.h View 11 12 3 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/cocoa/tab_strip_controller.mm View 1 2 11 12 4 chunks +12 lines, -3 lines 0 comments Download
M chrome/browser/gtk/browser_window_gtk.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/gtk/browser_window_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/instant/instant_loader.cc View 11 12 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_view_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +10 lines, -4 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +30 lines, -21 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +8 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view.h View 9 10 11 12 3 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_win.h View 7 8 9 10 11 12 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_win.cc View 7 8 9 10 11 12 5 chunks +11 lines, -61 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/browser.h View 12 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/browser.cc View 12 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/browser_window.h View 12 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.h View 12 5 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 12 8 chunks +45 lines, -23 lines 0 comments Download
M chrome/browser/ui/views/tab_contents/tab_contents_container.h View 12 4 chunks +25 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/tab_contents/tab_contents_container.cc View 12 6 chunks +25 lines, -1 line 0 comments Download
M chrome/common/render_messages_params.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/common/render_messages_params.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +4 lines, -0 lines 0 comments Download
M chrome/renderer/render_widget.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +9 lines, -4 lines 0 comments Download
M chrome/test/test_browser_window.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 48 (0 generated)
Aleksey Shlyapnikov
10 years, 2 months ago (2010-09-30 19:58:49 UTC) #1
sky
http://codereview.chromium.org/3547008/diff/1/15 File chrome/browser/renderer_host/render_view_host_delegate.h (right): http://codereview.chromium.org/3547008/diff/1/15#newcode813 chrome/browser/renderer_host/render_view_host_delegate.h:813: virtual gfx::Rect GetReservedContentsRect() const; This (and GetRootWindowResizerRect) should be ...
10 years, 2 months ago (2010-09-30 22:50:21 UTC) #2
Aleksey Shlyapnikov
http://codereview.chromium.org/3547008/diff/1/15 File chrome/browser/renderer_host/render_view_host_delegate.h (right): http://codereview.chromium.org/3547008/diff/1/15#newcode813 chrome/browser/renderer_host/render_view_host_delegate.h:813: virtual gfx::Rect GetReservedContentsRect() const; On 2010/09/30 22:50:21, sky wrote: ...
10 years, 2 months ago (2010-10-01 17:28:33 UTC) #3
sky
http://codereview.chromium.org/3547008/diff/1/15 File chrome/browser/renderer_host/render_view_host_delegate.h (right): http://codereview.chromium.org/3547008/diff/1/15#newcode813 chrome/browser/renderer_host/render_view_host_delegate.h:813: virtual gfx::Rect GetReservedContentsRect() const; On 2010/10/01 17:28:34, Aleksey Shlyapnikov ...
10 years, 2 months ago (2010-10-01 18:21:12 UTC) #4
Aleksey Shlyapnikov
http://codereview.chromium.org/3547008/diff/1/15 File chrome/browser/renderer_host/render_view_host_delegate.h (right): http://codereview.chromium.org/3547008/diff/1/15#newcode813 chrome/browser/renderer_host/render_view_host_delegate.h:813: virtual gfx::Rect GetReservedContentsRect() const; On 2010/10/01 18:21:12, sky wrote: ...
10 years, 2 months ago (2010-10-01 22:32:22 UTC) #5
Aleksey Shlyapnikov
Hey Rohit, would you please have a look at the Mac specific changes in this ...
10 years, 2 months ago (2010-10-02 01:26:40 UTC) #6
rohitrao (ping after 24h)
http://codereview.chromium.org/3547008/diff/54001/55003 File chrome/browser/browser_window.h (right): http://codereview.chromium.org/3547008/diff/54001/55003#newcode170 chrome/browser/browser_window.h:170: // Returns the rect in contents coordinates where contents ...
10 years, 2 months ago (2010-10-04 14:36:39 UTC) #7
sky
http://codereview.chromium.org/3547008/diff/54001/55018 File chrome/browser/renderer_host/render_widget_host.cc (right): http://codereview.chromium.org/3547008/diff/54001/55018#newcode280 chrome/browser/renderer_host/render_widget_host.cc:280: if (!new_size.IsEmpty() && new_size != current_size_) resize_ack_pending = (the ...
10 years, 2 months ago (2010-10-04 15:45:11 UTC) #8
Aleksey Shlyapnikov
http://codereview.chromium.org/3547008/diff/54001/55003 File chrome/browser/browser_window.h (right): http://codereview.chromium.org/3547008/diff/54001/55003#newcode170 chrome/browser/browser_window.h:170: // Returns the rect in contents coordinates where contents ...
10 years, 2 months ago (2010-10-05 00:03:30 UTC) #9
Aleksey Shlyapnikov
@pinkerton,could you please check TabContentsController changes?
10 years, 2 months ago (2010-10-05 01:40:46 UTC) #10
pink (ping after 24hrs)
TabContentsController looks ok to me, i guess.
10 years, 2 months ago (2010-10-05 13:20:39 UTC) #11
sky
http://codereview.chromium.org/3547008/diff/54001/55039 File chrome/browser/views/tab_contents/tab_contents_view_win.cc (right): http://codereview.chromium.org/3547008/diff/54001/55039#newcode330 chrome/browser/views/tab_contents/tab_contents_view_win.cc:330: const WidgetWin* root_widget = GetRootWidget(GetNativeView()); On 2010/10/05 00:03:30, Aleksey ...
10 years, 2 months ago (2010-10-05 15:29:34 UTC) #12
Aleksey Shlyapnikov
Scott, I changed the implementation according to our discussion earlier this week. While I'm working ...
10 years, 2 months ago (2010-10-07 23:34:35 UTC) #13
sky
On 2010/10/07 23:34:35, Aleksey Shlyapnikov wrote: > Scott, I changed the implementation according to our ...
10 years, 2 months ago (2010-10-08 16:45:52 UTC) #14
Aleksey Shlyapnikov
I explored that approach too, the problem with it is that it has to be ...
10 years, 2 months ago (2010-10-08 16:57:50 UTC) #15
Ben Goodger (Google)
What do you mean "synced with resize"? and "resize does not always happen during layout?"
10 years, 2 months ago (2010-10-08 17:06:50 UTC) #16
Aleksey Shlyapnikov
If we store just the size of the reserved rect in RVH (or wherever else), ...
10 years, 2 months ago (2010-10-08 17:28:22 UTC) #17
Ben Goodger (Google)
But the BrowserView knows LTR/RTLness too. It should take LTR/RTLness into account when setting the ...
10 years, 2 months ago (2010-10-08 17:42:15 UTC) #18
Aleksey Shlyapnikov
That's correct and it does, but as I mentioned earlier there's still an issue with ...
10 years, 2 months ago (2010-10-08 18:22:23 UTC) #19
Ben Goodger (Google)
The RenderWidgetHostView is always sized by its container. If you need to store the rect ...
10 years, 2 months ago (2010-10-08 19:52:42 UTC) #20
Aleksey Shlyapnikov
BrowserView does not originate and is not notified about all view resizes (Mac view has ...
10 years, 2 months ago (2010-10-08 20:58:57 UTC) #21
Aleksey Shlyapnikov
Please have another look, now reserved rect is cached in RenderWidgetHostView, TabContentsContainer notifies BrowserView about ...
10 years, 2 months ago (2010-10-11 00:25:05 UTC) #22
sky
Sorry for not responding, I thought Ben was going to take over the review. http://codereview.chromium.org/3547008/diff/101001/102023 ...
10 years, 2 months ago (2010-10-13 15:41:35 UTC) #23
Ben Goodger (Google)
I have been busy with yell and other things over the past couple of days. ...
10 years, 2 months ago (2010-10-13 17:14:29 UTC) #24
Aleksey Shlyapnikov
BrowserView should know somehow the moment RenderWidgetHostView size (or view itself) has changed, layout is ...
10 years, 2 months ago (2010-10-13 18:15:47 UTC) #25
Ben Goodger (Google)
http://codereview.chromium.org/3547008/diff/101001/102011 File chrome/browser/renderer_host/render_widget_host.h (right): http://codereview.chromium.org/3547008/diff/101001/102011#newcode594 chrome/browser/renderer_host/render_widget_host.h:594: gfx::Rect current_reserved_rect_; Note that content will be drawn here ...
10 years, 2 months ago (2010-10-13 20:29:41 UTC) #26
Aleksey Shlyapnikov
http://codereview.chromium.org/3547008/diff/101001/102023 File chrome/browser/views/tab_contents/tab_contents_container.h (right): http://codereview.chromium.org/3547008/diff/101001/102023#newcode22 chrome/browser/views/tab_contents/tab_contents_container.h:22: class ReservedAreaDelegate { But if we update reserved area ...
10 years, 2 months ago (2010-10-13 21:23:00 UTC) #27
Ben Goodger (Google)
http://codereview.chromium.org/3547008/diff/101001/102023 File chrome/browser/views/tab_contents/tab_contents_container.h (right): http://codereview.chromium.org/3547008/diff/101001/102023#newcode22 chrome/browser/views/tab_contents/tab_contents_container.h:22: class ReservedAreaDelegate { How about this: 1. In BrowserView::Layout, ...
10 years, 2 months ago (2010-10-13 21:31:18 UTC) #28
Aleksey Shlyapnikov
I thought about this approach, but 1) Resizing split view components does not trigger layout; ...
10 years, 2 months ago (2010-10-13 21:53:13 UTC) #29
Aleksey Shlyapnikov
http://codereview.chromium.org/3547008/diff/101001/102011 File chrome/browser/renderer_host/render_widget_host.h (right): http://codereview.chromium.org/3547008/diff/101001/102011#newcode594 chrome/browser/renderer_host/render_widget_host.h:594: gfx::Rect current_reserved_rect_; Yes, I realize that (with the addition ...
10 years, 2 months ago (2010-10-14 19:55:00 UTC) #30
Aleksey Shlyapnikov
Not to be a nagger, but ping?
10 years, 2 months ago (2010-10-19 01:42:43 UTC) #31
Ben Goodger (Google)
I am trying to reconcile my proposal with the way SingleSplitView works. -Ben On Mon, ...
10 years, 2 months ago (2010-10-19 19:09:13 UTC) #32
Aleksey Shlyapnikov
Any chance to get it moving, please?
10 years, 2 months ago (2010-10-22 17:31:36 UTC) #33
Aleksey Shlyapnikov
Ben, would you happen to have time this week to look at this issue? Thanks.
10 years, 1 month ago (2010-10-27 00:35:28 UTC) #34
Ben Goodger (Google)
I have been OOO, I will look Weds or Thurs. -Ben On Tue, Oct 26, ...
10 years, 1 month ago (2010-10-27 01:06:43 UTC) #35
Ben Goodger (Google)
Looking at this again now. -Ben On Tue, Oct 26, 2010 at 6:06 PM, Ben ...
10 years, 1 month ago (2010-11-01 15:01:44 UTC) #36
Ben Goodger (Google)
After much thought I have not been able to come up with anything that's less ...
10 years, 1 month ago (2010-11-01 16:56:27 UTC) #37
Ben Goodger (Google)
After some discussion, LGTM. On Mon, Nov 1, 2010 at 9:56 AM, <ben@chromium.org> wrote: > ...
10 years, 1 month ago (2010-11-02 17:42:24 UTC) #38
Aleksey Shlyapnikov
Rohit, Mac specific part of this CL was completely reworked since your last comment, would ...
10 years, 1 month ago (2010-11-03 00:49:48 UTC) #39
rohitrao (ping after 24h)
How many different views need to have reserved content areas? I dislike that we have ...
10 years, 1 month ago (2010-11-04 23:13:48 UTC) #40
Aleksey Shlyapnikov
At the moment, there're three views, the page itself, sidebar and devTools. TabContentsViewController handles flicker-less ...
10 years, 1 month ago (2010-11-05 00:45:11 UTC) #41
pink (ping after 24hrs)
Are there mocks somewhere for these minitabs or the sidebar? I must admit I have ...
10 years, 1 month ago (2010-11-12 17:34:25 UTC) #42
rohitrao (ping after 24h)
Ok, I can't work out all of the kinks when using notifications, so we're back ...
10 years, 1 month ago (2010-11-12 18:45:18 UTC) #43
Aleksey Shlyapnikov
There's a mock screenshot at the top of http://www.chromium.org/developers/design-documents/extensions/sidebar-extension-api. On 2010/11/12 17:34:25, pink wrote: > ...
10 years, 1 month ago (2010-11-12 18:45:20 UTC) #44
Aleksey Shlyapnikov
http://codereview.chromium.org/3547008/diff/172001/chrome/browser/cocoa/dev_tools_controller.h File chrome/browser/cocoa/dev_tools_controller.h (right): http://codereview.chromium.org/3547008/diff/172001/chrome/browser/cocoa/dev_tools_controller.h#newcode11 chrome/browser/cocoa/dev_tools_controller.h:11: #import "chrome/browser/cocoa/tab_contents_controller.h" On 2010/11/12 17:34:26, pink wrote: > alphabetize ...
10 years, 1 month ago (2010-11-13 01:37:11 UTC) #45
rohitrao (ping after 24h)
Looks ok to me, with a few comments. I had a few other comments here, ...
10 years, 1 month ago (2010-11-15 23:46:57 UTC) #46
Aleksey Shlyapnikov
http://codereview.chromium.org/3547008/diff/227001/chrome/browser/cocoa/dev_tools_controller.mm File chrome/browser/cocoa/dev_tools_controller.mm (right): http://codereview.chromium.org/3547008/diff/227001/chrome/browser/cocoa/dev_tools_controller.mm#newcode154 chrome/browser/cocoa/dev_tools_controller.mm:154: shouldAdjustSizeOfSubview:(NSView *)subview { It was broken since we switched ...
10 years, 1 month ago (2010-11-16 02:07:37 UTC) #47
rohitrao (ping after 24h)
10 years, 1 month ago (2010-11-16 02:14:47 UTC) #48
Please run these latest changes through the trybots once and then go ahead and
submit.  Thanks for your patience =)

http://codereview.chromium.org/3547008/diff/227001/chrome/browser/cocoa/dev_t...
File chrome/browser/cocoa/dev_tools_controller.mm (right):

http://codereview.chromium.org/3547008/diff/227001/chrome/browser/cocoa/dev_t...
chrome/browser/cocoa/dev_tools_controller.mm:154:
shouldAdjustSizeOfSubview:(NSView *)subview {
Nah, this is fine.

On 2010/11/16 02:07:37, Aleksey Shlyapnikov wrote:
> It was broken since we switched to one devtools container per browser window
> (see CL description for the repro case) and it used to be required for the
> earlier versions of this CL, but looks like now it works without this change.
> Should I fix it in a separate CL then?
> 
> On 2010/11/15 23:46:58, rohitrao wrote:
> > Is this new?  Is it now required because of some other change in this CL, or
> was
> > our behavior always broken?
>

Powered by Google App Engine
This is Rietveld 408576698