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

Issue 396503003: DomDistiller: fix 0 document width (Closed)

Created:
6 years, 5 months ago by kuan
Modified:
6 years, 5 months ago
Reviewers:
miket_OOO, nyquist, Yaron, danakj
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, darin-cc_chromium.org, jam, extensions-reviews_chromium.org
Project:
chromium
Visibility:
Public.

Description

DomDistiller: fix 0 document width bug: When distilling a page with new WebContents, document.offsetWidth in domdistiller.js is always 0, because the newly created RenderView doesn't have a size. fix: DistillerPageWebContents extends WebContentsDelegate and implements GetNewSizeForRenderView() to return the size for the new RenderView. This size is the container bounds of the WebContents from where the distillation is triggered. The size is plumbed through the pipeline from the following sources all the way down to DistillerPageWebContents. 1) WebUI: WebContents of chrome:://dom-distiller 3) ReadingList: WebContents currently associated with the extension 2) standalone ContentExtractor: WebContents of content::Shell As for the reused WebContents (via "Distill page" in wrench menu), it already has a size, so we just use it. BUG=368941, 367254 TBR=danakj (ui/gfx/size.h) Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=284094

Patch Set 1 #

Total comments: 16

Patch Set 2 : addressed comments #

Patch Set 3 : resolve patch conflicts #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -58 lines) Patch
M chrome/browser/dom_distiller/lazy_dom_distiller_service.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/dom_distiller/lazy_dom_distiller_service.cc View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc View 2 chunks +6 lines, -1 line 0 comments Download
M components/dom_distiller/DEPS View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/dom_distiller/content/distiller_page_web_contents.h View 4 chunks +10 lines, -1 line 0 comments Download
M components/dom_distiller/content/distiller_page_web_contents.cc View 1 4 chunks +29 lines, -5 lines 0 comments Download
M components/dom_distiller/content/distiller_page_web_contents_browsertest.cc View 7 chunks +8 lines, -1 line 0 comments Download
M components/dom_distiller/content/dom_distiller_viewer_source.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M components/dom_distiller/core/distiller_page.h View 2 chunks +3 lines, -1 line 0 comments Download
M components/dom_distiller/core/dom_distiller_service.h View 1 2 2 chunks +4 lines, -2 lines 0 comments Download
M components/dom_distiller/core/dom_distiller_service.cc View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M components/dom_distiller/core/dom_distiller_service_unittest.cc View 1 2 12 chunks +37 lines, -25 lines 0 comments Download
M components/dom_distiller/core/fake_distiller_page.h View 1 chunk +2 lines, -1 line 0 comments Download
M components/dom_distiller/core/viewer.h View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M components/dom_distiller/core/viewer.cc View 1 2 2 chunks +10 lines, -9 lines 0 comments Download
M components/dom_distiller/core/viewer_unittest.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M components/dom_distiller/standalone/content_extractor.cc View 1 2 2 chunks +6 lines, -2 lines 0 comments Download
M components/dom_distiller/webui/dom_distiller_handler.cc View 1 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 22 (0 generated)
kuan
6 years, 5 months ago (2014-07-15 00:05:31 UTC) #1
Yaron
Awesome! Glad to see this. I added another bug which I think is related whereby ...
6 years, 5 months ago (2014-07-15 01:46:27 UTC) #2
kuan
https://codereview.chromium.org/396503003/diff/1/components/dom_distiller/content/distiller_page_web_contents.cc File components/dom_distiller/content/distiller_page_web_contents.cc (right): https://codereview.chromium.org/396503003/diff/1/components/dom_distiller/content/distiller_page_web_contents.cc#newcode107 components/dom_distiller/content/distiller_page_web_contents.cc:107: create_params.initially_hidden = true; On 2014/07/15 01:46:27, Yaron wrote: > ...
6 years, 5 months ago (2014-07-15 16:52:52 UTC) #3
nyquist
https://codereview.chromium.org/396503003/diff/1/components/dom_distiller/content/distiller_page_web_contents.cc File components/dom_distiller/content/distiller_page_web_contents.cc (right): https://codereview.chromium.org/396503003/diff/1/components/dom_distiller/content/distiller_page_web_contents.cc#newcode123 components/dom_distiller/content/distiller_page_web_contents.cc:123: web_contents->GetContainerBounds().size(); was this supposed to say |size = wc->GCB().size()| ...
6 years, 5 months ago (2014-07-15 17:13:03 UTC) #4
Yaron
https://codereview.chromium.org/396503003/diff/1/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc File chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc (right): https://codereview.chromium.org/396503003/diff/1/chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc#newcode5 chrome/browser/extensions/api/reading_list_private/reading_list_private_api.cc:5: #include "chrome/browser/extensions/api/reading_list_private/reading_list_private_api.h" You'll need a chrome/browser/extensions OWNER https://codereview.chromium.org/396503003/diff/1/components/dom_distiller/content/distiller_page_web_contents.cc File ...
6 years, 5 months ago (2014-07-16 17:46:28 UTC) #5
nyquist
https://codereview.chromium.org/396503003/diff/1/components/dom_distiller/webui/dom_distiller_ui.cc File components/dom_distiller/webui/dom_distiller_ui.cc (right): https://codereview.chromium.org/396503003/diff/1/components/dom_distiller/webui/dom_distiller_ui.cc#newcode56 components/dom_distiller/webui/dom_distiller_ui.cc:56: web_ui->GetWebContents()->GetContainerBounds().size())); On 2014/07/16 17:46:28, Yaron wrote: > On 2014/07/15 ...
6 years, 5 months ago (2014-07-16 19:20:49 UTC) #6
kuan
mike: pls provide owners approval for chrome/browser/extensions. thx. yaron, tommy: i've addressed all comments in ...
6 years, 5 months ago (2014-07-17 09:57:26 UTC) #7
Yaron
lgtm
6 years, 5 months ago (2014-07-17 17:40:03 UTC) #8
miket_OOO
OWNERS LGTM
6 years, 5 months ago (2014-07-17 19:36:14 UTC) #9
nyquist
lgtm
6 years, 5 months ago (2014-07-17 20:15:17 UTC) #10
kuan
The CQ bit was checked by kuan@chromium.org
6 years, 5 months ago (2014-07-17 20:32:10 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kuan@chromium.org/396503003/20001
6 years, 5 months ago (2014-07-17 20:36:00 UTC) #12
kuan
The CQ bit was checked by kuan@chromium.org
6 years, 5 months ago (2014-07-17 21:54:17 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kuan@chromium.org/396503003/40001
6 years, 5 months ago (2014-07-17 21:56:37 UTC) #14
kuan
danakj@, cld u pls provide owners approval for adding ui/gfx to components/dom_distiller/DEPS? i added to ...
6 years, 5 months ago (2014-07-17 22:25:11 UTC) #15
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: chromium_presubmit on tryserver.chromium ...
6 years, 5 months ago (2014-07-18 02:35:19 UTC) #16
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-18 02:39:59 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/chromium_presubmit/builds/80778)
6 years, 5 months ago (2014-07-18 02:40:00 UTC) #18
kuan
tbring danakj for ui/gfx/size.h
6 years, 5 months ago (2014-07-18 14:17:21 UTC) #19
kuan
The CQ bit was checked by kuan@chromium.org
6 years, 5 months ago (2014-07-18 14:17:30 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kuan@chromium.org/396503003/40001
6 years, 5 months ago (2014-07-18 14:20:43 UTC) #21
commit-bot: I haz the power
6 years, 5 months ago (2014-07-18 14:26:17 UTC) #22
Message was sent while issue was closed.
Change committed as 284094

Powered by Google App Engine
This is Rietveld 408576698