|
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
Total comments: 16
|
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
|
Total messages: 22 (0 generated)
|