Chromium Code Reviews| Index: chrome/browser/printing/print_preview_message_handler.cc |
| =================================================================== |
| --- chrome/browser/printing/print_preview_message_handler.cc (revision 113720) |
| +++ chrome/browser/printing/print_preview_message_handler.cc (working copy) |
| @@ -21,6 +21,7 @@ |
| #include "content/browser/renderer_host/render_view_host.h" |
| #include "content/browser/tab_contents/tab_contents.h" |
| #include "content/public/browser/browser_thread.h" |
| +#include "content/public/common/content_restriction.h" |
| #include "printing/page_size_margins.h" |
| #include "printing/print_job_constants.h" |
| @@ -243,6 +244,15 @@ |
| return handled; |
| } |
| +void PrintPreviewMessageHandler::DidStartLoading() { |
| + // This helps prevents the print preview tab from being able to print. |
|
Lei Zhang
2011/12/09 07:07:49
Should not have removed this earlier.
|
| + // It also disables the print menu entry. |
| + if (tab_contents()->delegate() && |
| + PrintPreviewTabController::IsPrintPreviewTab(tab_contents_wrapper())) { |
| + tab_contents()->SetContentRestrictions(content::CONTENT_RESTRICTION_PRINT); |
| + } |
| +} |
| + |
| void PrintPreviewMessageHandler::NavigateToPendingEntry( |
| const GURL& url, |
| NavigationController::ReloadType reload_type) { |