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

Issue 209023003: Remove references to WebContentsView::SizeContents from chrome/ and app/ (Closed)

Created:
6 years, 9 months ago by erikchen
Modified:
6 years, 8 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Remove references to WebContentsView::SizeContents from chrome/ and app/ WebContentsView::SizeContents was initially introduced as a hack to allow the content module to resize a WebContentsView. This is odd because the embedder should be in full control of the layout of the WebContentsView. Unfortunately, SizeContents started being used as a platform-agnostic way for the embedder to change the size of a WebContentsView. The mac implementation of SizeContents has never been correct. The implementation would work correctly when SizeContents was used by the embedder, but it did not work when used by the content module. See https://code.google.com/p/chromium/issues/detail?id=264207 for details. I changed the mac implementation of SizeContents to be a no-op, which fixed the use of SizeContents from the content module, and broke its usage from the embedder. This CL introduces a new platform agnostic utility method to resize a WebContents. I've replaced all calls to SizeContents from chrome/ and app/ with a call to the new utility method. There is no expected behavioral change on aura, gtk, or android. This should fix the problems that have arisen from my change to the mac implementation of SizeContents. Ideally, the utility method would take a gfx::NativeView as its parameter. Unfortunately, I was unable perform the resizing on a ui::AndroidView*, and I was forced to pass in the whole WebContents to mimic the behavior of WebContentsViewAndroid::SizeContents. BUG=354769 TEST=Follow steps listed in bug. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=262276

Patch Set 1 #

Patch Set 2 : Minor fixes #

Patch Set 3 : Remove all references to SizeContents from chrome/ and app/ #

Patch Set 4 : Comments & styling. #

Total comments: 4

Patch Set 5 : Rebase against top of tree and fix a compile error in prerender_contents.cc #

Patch Set 6 : Change WebKit->Blink in a comment as suggested by avi. #

Total comments: 5

Patch Set 7 : Change location of util to ui/base, as per sky's suggestion #

Patch Set 8 : clang-format #

Total comments: 3

Patch Set 9 : Move web_contents_sizer to apps/ui/ #

Patch Set 10 : Alphabetization. #

Total comments: 6

Patch Set 11 : Remove unused #if. #

Patch Set 12 : Respond to sky's comments. #

Patch Set 13 : Add missing include to android. #

Patch Set 14 : Rebase against top of tree. #

Patch Set 15 : Add a missing NULL pointer check to android code. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+113 lines, -13 lines) Patch
M apps/app_window.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -1 line 0 comments Download
M apps/apps.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +10 lines, -0 lines 0 comments Download
A apps/ui/web_contents_sizer.h View 1 2 3 4 5 6 7 8 1 chunk +24 lines, -0 lines 0 comments Download
A apps/ui/web_contents_sizer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +35 lines, -0 lines 0 comments Download
A apps/ui/web_contents_sizer.mm View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +26 lines, -0 lines 0 comments Download
M chrome/browser/prerender/prerender_contents.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/browser_tabrestore.cc View 1 2 3 4 5 6 7 8 2 chunks +9 lines, -8 lines 0 comments Download
M chrome/browser/ui/fullscreen/fullscreen_controller.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/tabs/tab_strip_model.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 43 (0 generated)
erikchen
avi: Please take a look. If the general approach seems reasonable, I will pass it ...
6 years, 9 months ago (2014-03-21 23:38:50 UTC) #1
Avi (use Gerrit)
The Mac code LGTM. I'm not sure about the DEPS, and the fact that all ...
6 years, 9 months ago (2014-03-22 04:48:06 UTC) #2
erikchen
tedchoc: Looking for a review of the android code in layout_util.cc, which copies the code ...
6 years, 9 months ago (2014-03-24 16:43:39 UTC) #3
erikchen
tedchoc: ping
6 years, 9 months ago (2014-03-26 21:33:51 UTC) #4
Ted C
+sievers to keep me honest lgtm SetSize triggered from native does nothing in android as ...
6 years, 9 months ago (2014-03-27 00:58:53 UTC) #5
no sievers
On 2014/03/27 00:58:53, Ted C wrote: > +sievers to keep me honest > > lgtm ...
6 years, 9 months ago (2014-03-27 01:29:12 UTC) #6
erikchen
ben: Looking for an overall review. The logic in layout_util is likely correct, but it's ...
6 years, 9 months ago (2014-03-27 17:51:27 UTC) #7
erikchen
-ben sky: Looking for an overall review. The logic in layout_util is likely correct, but ...
6 years, 8 months ago (2014-04-02 01:23:39 UTC) #8
sky
https://codereview.chromium.org/209023003/diff/80001/ui/gfx/layout_util.cc File ui/gfx/layout_util.cc (right): https://codereview.chromium.org/209023003/diff/80001/ui/gfx/layout_util.cc#newcode30 ui/gfx/layout_util.cc:30: content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView(); Is it possible to use ...
6 years, 8 months ago (2014-04-02 14:39:42 UTC) #9
erikchen
https://codereview.chromium.org/209023003/diff/80001/ui/gfx/layout_util.cc File ui/gfx/layout_util.cc (right): https://codereview.chromium.org/209023003/diff/80001/ui/gfx/layout_util.cc#newcode30 ui/gfx/layout_util.cc:30: content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView(); On 2014/04/02 14:39:42, sky wrote: ...
6 years, 8 months ago (2014-04-02 17:10:41 UTC) #10
sky
Maybe some where in ui/base? https://codereview.chromium.org/209023003/diff/80001/ui/gfx/layout_util.cc File ui/gfx/layout_util.cc (right): https://codereview.chromium.org/209023003/diff/80001/ui/gfx/layout_util.cc#newcode30 ui/gfx/layout_util.cc:30: content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView(); ...
6 years, 8 months ago (2014-04-02 19:55:45 UTC) #11
sky
Also, layout_util is an incredibly generic name. Maybe web_contents_sizer.
6 years, 8 months ago (2014-04-02 19:56:13 UTC) #12
erikchen
On 2014/04/02 19:55:45, sky wrote: > Maybe some where in ui/base? > > https://codereview.chromium.org/209023003/diff/80001/ui/gfx/layout_util.cc > ...
6 years, 8 months ago (2014-04-02 20:04:31 UTC) #13
sky
Ok, I get it. Everyone just wants to be different:) -Scott On Wed, Apr 2, ...
6 years, 8 months ago (2014-04-02 22:22:59 UTC) #14
erikchen
sky: PTAL I've done as you've suggested and moved the class to ui/base, and renamed ...
6 years, 8 months ago (2014-04-03 01:29:17 UTC) #15
sky
Unfortunately I was wrong, ui/base can't depend upon aura. Which is why you're seeing the ...
6 years, 8 months ago (2014-04-03 15:05:50 UTC) #16
sky
Also, there is no longer such a build as non-aura windows. On Thu, Apr 3, ...
6 years, 8 months ago (2014-04-03 15:06:12 UTC) #17
erikchen
sky: PTAL
6 years, 8 months ago (2014-04-03 17:49:07 UTC) #18
sky
You're going to need a new owner for apps. https://codereview.chromium.org/209023003/diff/160001/apps/ui/web_contents_sizer.cc File apps/ui/web_contents_sizer.cc (right): https://codereview.chromium.org/209023003/diff/160001/apps/ui/web_contents_sizer.cc#newcode15 apps/ui/web_contents_sizer.cc:15: ...
6 years, 8 months ago (2014-04-03 19:46:15 UTC) #19
erikchen
https://codereview.chromium.org/209023003/diff/160001/apps/ui/web_contents_sizer.cc File apps/ui/web_contents_sizer.cc (right): https://codereview.chromium.org/209023003/diff/160001/apps/ui/web_contents_sizer.cc#newcode15 apps/ui/web_contents_sizer.cc:15: #endif On 2014/04/03 19:46:16, sky wrote: > no reason ...
6 years, 8 months ago (2014-04-04 01:06:23 UTC) #20
erikchen
yoz: Looking for an OWNER review of apps/
6 years, 8 months ago (2014-04-04 01:07:10 UTC) #21
sky
https://codereview.chromium.org/209023003/diff/160001/apps/ui/web_contents_sizer.cc File apps/ui/web_contents_sizer.cc (right): https://codereview.chromium.org/209023003/diff/160001/apps/ui/web_contents_sizer.cc#newcode23 apps/ui/web_contents_sizer.cc:23: gfx::Rect rect = view->bounds(); On 2014/04/04 01:06:23, erikchen1 wrote: ...
6 years, 8 months ago (2014-04-04 14:18:02 UTC) #22
erikchen
sky: PTAL https://codereview.chromium.org/209023003/diff/160001/apps/ui/web_contents_sizer.cc File apps/ui/web_contents_sizer.cc (right): https://codereview.chromium.org/209023003/diff/160001/apps/ui/web_contents_sizer.cc#newcode23 apps/ui/web_contents_sizer.cc:23: gfx::Rect rect = view->bounds(); On 2014/04/04 14:18:03, ...
6 years, 8 months ago (2014-04-04 20:47:52 UTC) #23
sky
LGTM
6 years, 8 months ago (2014-04-04 20:51:44 UTC) #24
Yoyo Zhou
apps LGTM
6 years, 8 months ago (2014-04-04 21:02:02 UTC) #25
erikchen
The CQ bit was checked by erikchen@chromium.org
6 years, 8 months ago (2014-04-04 21:03:46 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/209023003/200001
6 years, 8 months ago (2014-04-04 21:04:44 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/209023003/200001
6 years, 8 months ago (2014-04-04 21:31:59 UTC) #28
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-04 22:32:44 UTC) #29
commit-bot: I haz the power
Retried try job too often on android_dbg for step(s) slave_steps http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=android_dbg&number=168229
6 years, 8 months ago (2014-04-04 22:32:45 UTC) #30
erikchen
The CQ bit was checked by erikchen@chromium.org
6 years, 8 months ago (2014-04-04 22:46:44 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/209023003/200001
6 years, 8 months ago (2014-04-04 22:48:00 UTC) #32
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-04 23:44:21 UTC) #33
commit-bot: I haz the power
Retried try job too often on android_clang_dbg for step(s) slave_steps http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=android_clang_dbg&number=130096
6 years, 8 months ago (2014-04-04 23:44:22 UTC) #34
erikchen
The CQ bit was checked by erikchen@chromium.org
6 years, 8 months ago (2014-04-05 01:08:12 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/209023003/220001
6 years, 8 months ago (2014-04-05 01:08:36 UTC) #36
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-05 08:26:06 UTC) #37
commit-bot: I haz the power
The commit queue went berserk retrying too often for a seemingly flaky test on builder ...
6 years, 8 months ago (2014-04-05 08:26:06 UTC) #38
erikchen
The CQ bit was checked by erikchen@chromium.org
6 years, 8 months ago (2014-04-07 17:58:35 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/209023003/220001
6 years, 8 months ago (2014-04-07 17:58:48 UTC) #40
erikchen
The CQ bit was checked by erikchen@chromium.org
6 years, 8 months ago (2014-04-07 22:25:10 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/209023003/260001
6 years, 8 months ago (2014-04-07 22:25:41 UTC) #42
commit-bot: I haz the power
6 years, 8 months ago (2014-04-08 01:09:34 UTC) #43
Message was sent while issue was closed.
Change committed as 262276

Powered by Google App Engine
This is Rietveld 408576698