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

Issue 4338001: Implement print preview tab controller. (Closed)

Created:
10 years, 1 month ago by kmadhusu
Modified:
9 years, 7 months ago
CC:
chromium-reviews, Paweł Hajdan Jr., ben+cc_chromium.org, brettw-cc_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

Implement print preview tab controller. For print preview, a PP tab should be linked with the tab that initiated the printing operation. If the tab initiates a second printing operation while the first print preview tab is still open, that PP tab should be focused/activated. There may be more than one PP tab open. Hook ctrl+p to show print preview tab. BUG=59653, 57893 TEST=new unittest created. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=66319

Patch Set 1 #

Total comments: 6

Patch Set 2 : Hook up ctrl+p to show print preview tab. #

Total comments: 43

Patch Set 3 : Made changes as per comments. #

Patch Set 4 : '' #

Patch Set 5 : Fixed a style issue. #

Total comments: 22

Patch Set 6 : Made code changes as per comments. #

Total comments: 22

Patch Set 7 : Fixed style issues. #

Patch Set 8 : Made code changes as per comments. #

Patch Set 9 : Uploading my changes again. #

Total comments: 15

Patch Set 10 : '' #

Total comments: 2

Patch Set 11 : '' #

Total comments: 39

Patch Set 12 : '' #

Patch Set 13 : '' #

Total comments: 12

Patch Set 14 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+460 lines, -3 lines) Patch
M chrome/browser/browser_process.h View 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/browser_process_impl.h View 1 2 3 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/browser_process_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +14 lines, -0 lines 0 comments Download
A chrome/browser/printing/print_preview_tab_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +87 lines, -0 lines 0 comments Download
A chrome/browser/printing/print_preview_tab_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +194 lines, -0 lines 0 comments Download
A chrome/browser/printing/print_preview_tab_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +114 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/browser_render_process_host.cc View 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_view_host.h View 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host.cc View 2 3 4 5 6 7 8 9 10 11 3 chunks +22 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.cc View 2 3 4 5 6 7 8 9 10 2 chunks +9 lines, -2 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/testing_browser_process.h View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
kmadhusu
10 years, 1 month ago (2010-11-02 20:54:14 UTC) #1
Lei Zhang
Can you also just hook up IDC_PRINT to this code in this CL? It should ...
10 years, 1 month ago (2010-11-02 22:37:40 UTC) #2
kmadhusu
Lei, Thanks for your comments. Made code changes as per your suggestions and hooked up ...
10 years, 1 month ago (2010-11-05 18:56:53 UTC) #3
James Hawkins
http://codereview.chromium.org/4338001/diff/6001/7003 File chrome/browser/browser_process_impl.h (right): http://codereview.chromium.org/4338001/diff/6001/7003#newcode163 chrome/browser/browser_process_impl.h:163: bool created_print_preview_tab_controller_; I realize that everyone else has used ...
10 years, 1 month ago (2010-11-05 20:51:10 UTC) #4
Lei Zhang
http://codereview.chromium.org/4338001/diff/6001/7003 File chrome/browser/browser_process_impl.h (right): http://codereview.chromium.org/4338001/diff/6001/7003#newcode163 chrome/browser/browser_process_impl.h:163: bool created_print_preview_tab_controller_; On 2010/11/05 20:51:11, James Hawkins wrote: > ...
10 years, 1 month ago (2010-11-05 21:32:17 UTC) #5
Lei Zhang
http://codereview.chromium.org/4338001/diff/6001/7002 File chrome/browser/browser_process_impl.cc (right): http://codereview.chromium.org/4338001/diff/6001/7002#newcode719 chrome/browser/browser_process_impl.cc:719: DCHECK(print_preview_tab_controller_.get() == NULL); DCHECK(!created_print_preview_tab_controller_ && print_preview_tab_controller_.get() == NULL); http://codereview.chromium.org/4338001/diff/6001/7008 ...
10 years, 1 month ago (2010-11-05 21:42:56 UTC) #6
kmadhusu
http://codereview.chromium.org/4338001/diff/6001/7002 File chrome/browser/browser_process_impl.cc (right): http://codereview.chromium.org/4338001/diff/6001/7002#newcode719 chrome/browser/browser_process_impl.cc:719: DCHECK(print_preview_tab_controller_.get() == NULL); On 2010/11/05 21:42:56, Lei Zhang wrote: ...
10 years, 1 month ago (2010-11-09 18:33:25 UTC) #7
Lei Zhang
I found a test case that doesn't work: 1. Open google.com in tab A. 2. ...
10 years, 1 month ago (2010-11-10 01:03:23 UTC) #8
kmadhusu
Lei, Thanks for the test case. Made code changes to handle these situations. Please retest ...
10 years, 1 month ago (2010-11-12 00:02:06 UTC) #9
Lei Zhang
I'll finish reviewing this later. Not feeling well. http://codereview.chromium.org/4338001/diff/44001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/4338001/diff/44001/chrome/browser/printing/print_preview_tab_controller.cc#newcode5 chrome/browser/printing/print_preview_tab_controller.cc:5: #include ...
10 years, 1 month ago (2010-11-12 02:10:55 UTC) #10
kmadhusu
http://codereview.chromium.org/4338001/diff/44001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/4338001/diff/44001/chrome/browser/printing/print_preview_tab_controller.cc#newcode5 chrome/browser/printing/print_preview_tab_controller.cc:5: #include "chrome/browser/browser.h" On 2010/11/12 02:10:55, Lei Zhang wrote: > ...
10 years, 1 month ago (2010-11-12 22:21:48 UTC) #11
Lei Zhang
http://codereview.chromium.org/4338001/diff/55001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/4338001/diff/55001/chrome/browser/printing/print_preview_tab_controller.cc#newcode34 chrome/browser/printing/print_preview_tab_controller.cc:34: TabContents* current_tab, int browser_window_id ) { nit: |current_tab| should ...
10 years, 1 month ago (2010-11-12 23:17:17 UTC) #12
Lei Zhang
http://codereview.chromium.org/4338001/diff/55001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/4338001/diff/55001/chrome/browser/printing/print_preview_tab_controller.cc#newcode82 chrome/browser/printing/print_preview_tab_controller.cc:82: // Add TAB_CONTENTS_DESTROYED notification. nit: the comments in {Add,Remove}Observers ...
10 years, 1 month ago (2010-11-12 23:48:40 UTC) #13
kmadhusu
http://codereview.chromium.org/4338001/diff/55001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/4338001/diff/55001/chrome/browser/printing/print_preview_tab_controller.cc#newcode34 chrome/browser/printing/print_preview_tab_controller.cc:34: TabContents* current_tab, int browser_window_id ) { On 2010/11/12 23:17:18, ...
10 years, 1 month ago (2010-11-13 00:05:59 UTC) #14
Lei Zhang
http://codereview.chromium.org/4338001/diff/78001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/4338001/diff/78001/chrome/browser/printing/print_preview_tab_controller.cc#newcode34 chrome/browser/printing/print_preview_tab_controller.cc:34: TabContents* initiator_tab, int browser_window_id ) { The current implementation ...
10 years, 1 month ago (2010-11-13 05:04:55 UTC) #15
kmadhusu
http://codereview.chromium.org/4338001/diff/78001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/4338001/diff/78001/chrome/browser/printing/print_preview_tab_controller.cc#newcode34 chrome/browser/printing/print_preview_tab_controller.cc:34: TabContents* initiator_tab, int browser_window_id ) { On 2010/11/13 05:04:56, ...
10 years, 1 month ago (2010-11-15 21:22:26 UTC) #16
Lei Zhang
http://codereview.chromium.org/4338001/diff/78001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/4338001/diff/78001/chrome/browser/printing/print_preview_tab_controller.cc#newcode71 chrome/browser/printing/print_preview_tab_controller.cc:71: if ((it->second == current_tab) || (it->first == current_tab)) On ...
10 years, 1 month ago (2010-11-16 00:47:39 UTC) #17
kmadhusu
On 2010/11/16 00:47:39, Lei Zhang wrote: > http://codereview.chromium.org/4338001/diff/78001/chrome/browser/printing/print_preview_tab_controller.cc > File chrome/browser/printing/print_preview_tab_controller.cc (right): > > http://codereview.chromium.org/4338001/diff/78001/chrome/browser/printing/print_preview_tab_controller.cc#newcode71 ...
10 years, 1 month ago (2010-11-16 01:24:12 UTC) #18
kmadhusu
http://codereview.chromium.org/4338001/diff/85001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/4338001/diff/85001/chrome/browser/printing/print_preview_tab_controller.cc#newcode53 chrome/browser/printing/print_preview_tab_controller.cc:53: if (url.SchemeIs(chrome::kChromeUIScheme) && On 2010/11/16 00:47:39, Lei Zhang wrote: ...
10 years, 1 month ago (2010-11-16 01:24:22 UTC) #19
Lei Zhang
LGTM
10 years, 1 month ago (2010-11-16 01:51:01 UTC) #20
James Hawkins
http://codereview.chromium.org/4338001/diff/94001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/4338001/diff/94001/chrome/browser/printing/print_preview_tab_controller.cc#newcode37 chrome/browser/printing/print_preview_tab_controller.cc:37: // |initiator_tab| is preview tab. is a print preview ...
10 years, 1 month ago (2010-11-16 02:15:42 UTC) #21
Lei Zhang
http://codereview.chromium.org/4338001/diff/94001/chrome/browser/printing/print_preview_tab_controller.h File chrome/browser/printing/print_preview_tab_controller.h (right): http://codereview.chromium.org/4338001/diff/94001/chrome/browser/printing/print_preview_tab_controller.h#newcode57 chrome/browser/printing/print_preview_tab_controller.h:57: TabContents* GetPreviewTab(TabContents* current_tab); On 2010/11/16 02:15:42, James Hawkins wrote: ...
10 years, 1 month ago (2010-11-16 02:24:23 UTC) #22
James Hawkins
http://codereview.chromium.org/4338001/diff/94001/chrome/browser/printing/print_preview_tab_controller.h File chrome/browser/printing/print_preview_tab_controller.h (right): http://codereview.chromium.org/4338001/diff/94001/chrome/browser/printing/print_preview_tab_controller.h#newcode57 chrome/browser/printing/print_preview_tab_controller.h:57: TabContents* GetPreviewTab(TabContents* current_tab); On 2010/11/16 02:24:23, Lei Zhang wrote: ...
10 years, 1 month ago (2010-11-16 02:27:14 UTC) #23
kmadhusu
http://codereview.chromium.org/4338001/diff/94001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/4338001/diff/94001/chrome/browser/printing/print_preview_tab_controller.cc#newcode37 chrome/browser/printing/print_preview_tab_controller.cc:37: // |initiator_tab| is preview tab. On 2010/11/16 02:15:42, James ...
10 years, 1 month ago (2010-11-16 18:16:09 UTC) #24
James Hawkins
LGTM with comment nits fixed. http://codereview.chromium.org/4338001/diff/114001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/4338001/diff/114001/chrome/browser/printing/print_preview_tab_controller.cc#newcode37 chrome/browser/printing/print_preview_tab_controller.cc:37: // |initiator_tab| is a ...
10 years, 1 month ago (2010-11-16 18:24:30 UTC) #25
kmadhusu
10 years, 1 month ago (2010-11-16 18:41:42 UTC) #26
http://codereview.chromium.org/4338001/diff/114001/chrome/browser/printing/pr...
File chrome/browser/printing/print_preview_tab_controller.cc (right):

http://codereview.chromium.org/4338001/diff/114001/chrome/browser/printing/pr...
chrome/browser/printing/print_preview_tab_controller.cc:37: // |initiator_tab|
is a print preview tab.
On 2010/11/16 18:24:30, James Hawkins wrote:
> This comment is stating the obvious, please remove it.

Done.

http://codereview.chromium.org/4338001/diff/114001/chrome/browser/printing/pr...
chrome/browser/printing/print_preview_tab_controller.cc:141: }
On 2010/11/16 18:24:30, James Hawkins wrote:
> Blank line here.

Done.

http://codereview.chromium.org/4338001/diff/114001/chrome/browser/printing/pr...
File chrome/browser/printing/print_preview_tab_controller.h (right):

http://codereview.chromium.org/4338001/diff/114001/chrome/browser/printing/pr...
chrome/browser/printing/print_preview_tab_controller.h:36: // Get/Create the
print preview tab for initiator_tab.
On 2010/11/16 18:24:30, James Hawkins wrote:
> |initiator_tab|

Done.

http://codereview.chromium.org/4338001/diff/114001/chrome/browser/printing/pr...
chrome/browser/printing/print_preview_tab_controller.h:52: // Returns initiator
tab for |preview_tab| or NULL.
On 2010/11/16 18:24:30, James Hawkins wrote:
> or NULL when...?

Done.

http://codereview.chromium.org/4338001/diff/114001/chrome/browser/printing/pr...
chrome/browser/printing/print_preview_tab_controller.h:55: // Returns preview
tab for |tab| or NULL.
On 2010/11/16 18:24:30, James Hawkins wrote:
> or NULL when...?

Done.

http://codereview.chromium.org/4338001/diff/114001/chrome/browser/printing/pr...
chrome/browser/printing/print_preview_tab_controller.h:73: // A registrar for
listening for TAB_CONTENTS_DESTROYED notification.
On 2010/11/16 18:24:30, James Hawkins wrote:
> s/TAB_CONTENTS_DESTROYED //
> 
> "A registrar for listening for notifications."
> 
> ^ Because it's easy to get out of date (it's already out of date).

Done.

Powered by Google App Engine
This is Rietveld 408576698