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

Side by Side Diff: chrome/browser/printing/print_preview_message_handler.cc

Issue 8351048: Print Preview: Making margin selection sticky (part 2/2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/printing/print_preview_message_handler.h" 5 #include "chrome/browser/printing/print_preview_message_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 // Inform the print preview tab of the failure. 93 // Inform the print preview tab of the failure.
94 TabContentsWrapper* print_preview_tab = GetPrintPreviewTab(); 94 TabContentsWrapper* print_preview_tab = GetPrintPreviewTab();
95 // User might have closed it already. 95 // User might have closed it already.
96 if (!print_preview_tab || !print_preview_tab->web_ui()) 96 if (!print_preview_tab || !print_preview_tab->web_ui())
97 return NULL; 97 return NULL;
98 98
99 return static_cast<PrintPreviewUI*>(print_preview_tab->web_ui()); 99 return static_cast<PrintPreviewUI*>(print_preview_tab->web_ui());
100 } 100 }
101 101
102 void PrintPreviewMessageHandler::OnRequestPrintPreview() { 102 void PrintPreviewMessageHandler::OnRequestPrintPreview(
103 bool source_is_modifiable) {
103 PrintPreviewTabController::PrintPreview(tab_contents_wrapper()); 104 PrintPreviewTabController::PrintPreview(tab_contents_wrapper());
105
106 TabContentsWrapper* print_preview_tab = GetPrintPreviewTab();
107 if (!print_preview_tab || !print_preview_tab->web_ui())
108 return;
109 PrintPreviewUI* print_preview_ui =
110 static_cast<PrintPreviewUI*>(print_preview_tab->web_ui());
111 print_preview_ui->SetSourceIsModifiable(source_is_modifiable);
104 } 112 }
105 113
106 void PrintPreviewMessageHandler::OnDidGetPreviewPageCount( 114 void PrintPreviewMessageHandler::OnDidGetPreviewPageCount(
107 const PrintHostMsg_DidGetPreviewPageCount_Params& params) { 115 const PrintHostMsg_DidGetPreviewPageCount_Params& params) {
108 if (params.page_count <= 0) { 116 if (params.page_count <= 0) {
109 NOTREACHED(); 117 NOTREACHED();
110 return; 118 return;
111 } 119 }
112 120
113 TabContentsWrapper* print_preview_tab = GetPrintPreviewTab(); 121 TabContentsWrapper* print_preview_tab = GetPrintPreviewTab();
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 253 }
246 254
247 void PrintPreviewMessageHandler::DidStartLoading() { 255 void PrintPreviewMessageHandler::DidStartLoading() {
248 if (tab_contents()->delegate() && 256 if (tab_contents()->delegate() &&
249 PrintPreviewTabController::IsPrintPreviewTab(tab_contents_wrapper())) { 257 PrintPreviewTabController::IsPrintPreviewTab(tab_contents_wrapper())) {
250 tab_contents()->SetContentRestrictions(content::CONTENT_RESTRICTION_PRINT); 258 tab_contents()->SetContentRestrictions(content::CONTENT_RESTRICTION_PRINT);
251 } 259 }
252 } 260 }
253 261
254 } // namespace printing 262 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_preview_message_handler.h ('k') | chrome/browser/printing/print_system_task_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698