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

Issue 6221005: Print Preview: Store preview data in the print preview controller.... (Closed)

Created:
9 years, 11 months ago by Lei Zhang
Modified:
9 years, 7 months ago
Reviewers:
James Hawkins
CC:
chromium-reviews, brettw-cc_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr., kmadhusu
Visibility:
Public.

Description

Print Preview: Promote the print preview tab controller to the print preview manager. Store preview data in the print preview manager. BUG=64125 TEST=included

Patch Set 1 : '' #

Total comments: 5

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+248 lines, -519 lines) Patch
M chrome/browser/browser_process.h View 1 2 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/browser_process_impl.h View 1 2 3 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/browser_process_impl.cc View 1 2 3 chunks +8 lines, -9 lines 0 comments Download
M chrome/browser/dom_ui/print_preview_handler.cc View 1 2 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/dom_ui/print_preview_ui.cc View 1 2 7 chunks +36 lines, -11 lines 0 comments Download
A + chrome/browser/printing/print_preview_manager.h View 1 2 4 chunks +54 lines, -21 lines 0 comments Download
A + chrome/browser/printing/print_preview_manager.cc View 1 2 8 chunks +58 lines, -32 lines 0 comments Download
A + chrome/browser/printing/print_preview_manager_unittest.cc View 1 2 6 chunks +61 lines, -16 lines 0 comments Download
M chrome/browser/printing/print_preview_tab_controller.h View 1 2 1 chunk +0 lines, -89 lines 0 comments Download
M chrome/browser/printing/print_preview_tab_controller.cc View 1 2 1 chunk +0 lines, -192 lines 0 comments Download
M chrome/browser/printing/print_preview_tab_controller_unittest.cc View 1 2 1 chunk +0 lines, -114 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host.cc View 1 2 4 chunks +16 lines, -16 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/testing_browser_process.h View 1 2 2 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Lei Zhang
9 years, 11 months ago (2011-01-13 01:11:25 UTC) #1
James Hawkins
-kmadhusu, since she's not a full committer.
9 years, 11 months ago (2011-01-13 06:38:21 UTC) #2
James Hawkins
May I see a high-level design diagram that shows what you're trying to accomplish here? ...
9 years, 11 months ago (2011-01-13 06:43:27 UTC) #3
kmadhusu
http://codereview.chromium.org/6221005/diff/12001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/6221005/diff/12001/chrome/browser/printing/print_preview_tab_controller.cc#newcode28 chrome/browser/printing/print_preview_tab_controller.cc:28: ++it) { nit: This can fit in the previous ...
9 years, 11 months ago (2011-01-13 18:03:13 UTC) #4
Lei Zhang
On 2011/01/13 06:43:27, James Hawkins wrote: > May I see a high-level design diagram that ...
9 years, 11 months ago (2011-01-13 19:47:49 UTC) #5
Lei Zhang
http://codereview.chromium.org/6221005/diff/12001/chrome/browser/printing/print_preview_tab_controller.cc File chrome/browser/printing/print_preview_tab_controller.cc (right): http://codereview.chromium.org/6221005/diff/12001/chrome/browser/printing/print_preview_tab_controller.cc#newcode28 chrome/browser/printing/print_preview_tab_controller.cc:28: ++it) { On 2011/01/13 18:03:14, kmadhusu wrote: > nit: ...
9 years, 11 months ago (2011-01-13 20:59:18 UTC) #6
James Hawkins
On 2011/01/13 19:47:49, Lei Zhang wrote: > On 2011/01/13 06:43:27, James Hawkins wrote: > > ...
9 years, 11 months ago (2011-01-13 21:04:37 UTC) #7
Lei Zhang
9 years, 11 months ago (2011-01-13 22:22:05 UTC) #8
On 2011/01/13 21:04:37, James Hawkins wrote:
> On 2011/01/13 19:47:49, Lei Zhang wrote:
> > On 2011/01/13 06:43:27, James Hawkins wrote:
> > > May I see a high-level design diagram that shows what you're trying to
> > > accomplish here?
> > > 
> > >
> >
>
http://codereview.chromium.org/6221005/diff/12001/chrome/browser/printing/pri...
> > > File chrome/browser/printing/print_preview_tab_controller.h (right):
> > > 
> > >
> >
>
http://codereview.chromium.org/6221005/diff/12001/chrome/browser/printing/pri...
> > > chrome/browser/printing/print_preview_tab_controller.h:10: // tabs, and
the
> > > associated initiator tabs and print preview data.
> > > This really feels shoe-horned in here.  The name of the class implies that
> > it's
> > > only responsibility is to Control Print Preview Tabs.
> > > 
> > > "This class manages X, and Y...oh and Z."
> > 
> > The idea is that we need to save the generated print preview somewhere and
it
> > has to be associated with the print preview tab, since that's the only
context
> > we have when we are in the DOM UI code. The place that naturally comes to
mind
> > is in the TabContents, but we discussed [1] on chromium-dev about
stabilizing
> > the TabContents API and putting new functionality in different classes.
Which
> is
> > why I'm putting this in the PrintPreviewTabController.
> > 
> > I don't believe this is shoe-horned in. "Controlling tabs" is vague and it
> > doesn't exclude controlling the content associated with the print preview
> tabs.
> 
> It's pretty explicit; the class controls print preview tabs.

In that case, this class deserves a promotion to PrintPreviewManager. If I were
to add PrintPreviewDataController instead, then BrowserProcess would get bigger
with ever single little controller we add. Not to mention
PrintPreviewDataController will largely be duplicating code from
PrintPreviewTabController.

> > Putting this in a separate class will just add more work, since the new
class
> > will have to talk to the PrintPreviewTabController to figure out whether a
> given
> > TabContents is valid of not.
> > 
> > [1] project carnitas thread
> 
> I'm not proposing you add anything to TabContents.  As I said previously, I'd
> like to see a class design and flow chart of what you're trying to accomplish
> here.

I expanded on the purpose of PrintPreviewManager in the header. I added the
changes in chrome/browser/dom_ui, so you can see how this is used to retrieve
the preview data.

Powered by Google App Engine
This is Rietveld 408576698