[go: nahoru, domu]

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

Issue 149644: Print only the focused frame. This makes more sense than trying to print all... (Closed)

Created:
11 years, 5 months ago by Sverrir
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, brettw, jam, Mohamed Mansour
Visibility:
Public.

Description

Print only the focused frame. This makes more sense than trying to print all frames since most of the time you end up with ugly clipping and scroll bars on the printed page. This also fixes printing issue with print selection since we don't pick up the currently selected text if's not in the main frame. Also did some refactoring of the printing test in render_view_unittest. Mainly to reuse the new Image class. BUG=http://crbug.com/15250 TEST=Print pages with frames. Print selection when using multiple frames (one example in bug). Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=20876

Patch Set 1 #

Total comments: 9

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+216 lines, -274 lines) Patch
M chrome/chrome.gyp View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/renderer/mock_printer.h View 1 2 4 chunks +17 lines, -39 lines 0 comments Download
M chrome/renderer/mock_printer.cc View 1 2 6 chunks +16 lines, -41 lines 0 comments Download
D chrome/renderer/mock_printer_driver_win.h View 1 2 1 chunk +0 lines, -25 lines 0 comments Download
D chrome/renderer/mock_printer_driver_win.cc View 1 2 1 chunk +0 lines, -125 lines 0 comments Download
M chrome/renderer/render_view.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/render_view.cc View 1 2 2 chunks +13 lines, -3 lines 2 comments Download
M chrome/renderer/render_view_unittest.cc View 1 2 3 chunks +42 lines, -8 lines 0 comments Download
M printing/image.h View 1 2 4 chunks +21 lines, -3 lines 0 comments Download
M printing/image.cc View 1 2 5 chunks +106 lines, -28 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Sverrir
Could you take a look at this change since maruel is on vacation? I also ...
11 years, 5 months ago (2009-07-14 22:50:50 UTC) #1
darin (slow to review)
This seems like it could result in very confusing printer output in some cases. Imagine ...
11 years, 5 months ago (2009-07-15 00:11:59 UTC) #2
Hironori Bono
These are drive-through nits. Changing the MockPrinter class itself is OK for me. Nevertheless, I ...
11 years, 5 months ago (2009-07-15 03:09:54 UTC) #3
M-A Ruel
I haven't looked at the code yet, The feature is useful and should be implemented ...
11 years, 5 months ago (2009-07-15 12:37:46 UTC) #4
M-A Ruel
lgtm with one change http://codereview.chromium.org/149644/diff/1/5 File chrome/renderer/render_view.cc (right): http://codereview.chromium.org/149644/diff/1/5#newcode451 Line 451: Print(webview()->GetFocusedFrame(), false); As said ...
11 years, 5 months ago (2009-07-15 18:11:19 UTC) #5
Sverrir
Uploaded a new version. I agree that the solution was not ideal but I thought ...
11 years, 5 months ago (2009-07-15 22:09:41 UTC) #6
Sverrir
Now with comments... http://codereview.chromium.org/149644/diff/1/5 File chrome/renderer/render_view.cc (right): http://codereview.chromium.org/149644/diff/1/5#newcode451 Line 451: Print(webview()->GetFocusedFrame(), false); I changed this ...
11 years, 5 months ago (2009-07-15 22:10:08 UTC) #7
Hironori Bono
LGTM. Thank you so much for your refactoring. http://codereview.chromium.org/149644/diff/1/6 File chrome/renderer/render_view_unittest.cc (right): http://codereview.chromium.org/149644/diff/1/6#newcode358 Line 358: ...
11 years, 5 months ago (2009-07-16 03:39:26 UTC) #8
darin (slow to review)
http://codereview.chromium.org/149644/diff/1027/39 File chrome/renderer/render_view.cc (right): http://codereview.chromium.org/149644/diff/1027/39#newcode2321 Line 2321: Print(webview()->GetMainFrame(), true); this seems like it is introducing ...
11 years, 3 months ago (2009-09-16 16:28:50 UTC) #9
M-A Ruel
11 years, 3 months ago (2009-09-16 16:35:03 UTC) #10
http://codereview.chromium.org/149644/diff/1027/39
File chrome/renderer/render_view.cc (right):

http://codereview.chromium.org/149644/diff/1027/39#newcode2321
Line 2321: Print(webview()->GetMainFrame(), true);
On 2009/09/16 16:28:50, darin wrote:
> this seems like it is introducing a potential web compat bug.  why was this
> change made?  if i use window.print(), other browsers will print the frame
> corresponding to window.  it seems like this could matter to some web apps
that
> use window.print().  how do we know that this change is a good thing?
> 
> neither the description of this CL nor the comment above provide the
> justification for this change.  can you please enlighten me? :-)

That is interesting, I didn't realize that change. I'll create a separate
change.

Powered by Google App Engine
This is Rietveld 408576698