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

Side by Side Diff: chrome/browser/ui/webui/print_preview_ui.cc

Issue 8564040: Revert 110035 - Print Preview: Making margin selection sticky (part 2/2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
« no previous file with comments | « chrome/browser/ui/webui/print_preview_ui.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ui/webui/print_preview_ui.h" 5 #include "chrome/browser/ui/webui/print_preview_ui.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 preview_ui_addr_str_); 109 preview_ui_addr_str_);
110 } 110 }
111 111
112 void PrintPreviewUI::SetInitiatorTabURLAndTitle( 112 void PrintPreviewUI::SetInitiatorTabURLAndTitle(
113 const std::string& initiator_url, 113 const std::string& initiator_url,
114 const string16& job_title) { 114 const string16& job_title) {
115 initiator_url_ = initiator_url; 115 initiator_url_ = initiator_url;
116 initiator_tab_title_ = job_title; 116 initiator_tab_title_ = job_title;
117 } 117 }
118 118
119 void PrintPreviewUI::SetSourceIsModifiable(bool source_is_modifiable) {
120 source_is_modifiable_ = source_is_modifiable;
121 }
122
123 // static 119 // static
124 void PrintPreviewUI::GetCurrentPrintPreviewStatus( 120 void PrintPreviewUI::GetCurrentPrintPreviewStatus(
125 const std::string& preview_ui_addr, 121 const std::string& preview_ui_addr,
126 int request_id, 122 int request_id,
127 bool* cancel) { 123 bool* cancel) {
128 int current_id = -1; 124 int current_id = -1;
129 if (!g_print_preview_request_id_map.Get().Get(preview_ui_addr, &current_id)) { 125 if (!g_print_preview_request_id_map.Get().Get(preview_ui_addr, &current_id)) {
130 *cancel = true; 126 *cancel = true;
131 return; 127 return;
132 } 128 }
(...skipping 23 matching lines...) Expand all
156 } 152 }
157 153
158 void PrintPreviewUI::OnShowSystemDialog() { 154 void PrintPreviewUI::OnShowSystemDialog() {
159 CallJavascriptFunction("onSystemDialogLinkClicked"); 155 CallJavascriptFunction("onSystemDialogLinkClicked");
160 } 156 }
161 157
162 void PrintPreviewUI::OnDidGetPreviewPageCount( 158 void PrintPreviewUI::OnDidGetPreviewPageCount(
163 const PrintHostMsg_DidGetPreviewPageCount_Params& params) { 159 const PrintHostMsg_DidGetPreviewPageCount_Params& params) {
164 DCHECK_GT(params.page_count, 0); 160 DCHECK_GT(params.page_count, 0);
165 base::FundamentalValue count(params.page_count); 161 base::FundamentalValue count(params.page_count);
162 base::FundamentalValue modifiable(params.is_modifiable);
166 base::FundamentalValue request_id(params.preview_request_id); 163 base::FundamentalValue request_id(params.preview_request_id);
167 CallJavascriptFunction("onDidGetPreviewPageCount", count,request_id); 164 CallJavascriptFunction("onDidGetPreviewPageCount", count, modifiable,
165 request_id);
168 } 166 }
169 167
170 void PrintPreviewUI::OnDidGetDefaultPageLayout( 168 void PrintPreviewUI::OnDidGetDefaultPageLayout(
171 const PageSizeMargins& page_layout) { 169 const PageSizeMargins& page_layout) {
172 if (page_layout.margin_top < 0 || page_layout.margin_left < 0 || 170 if (page_layout.margin_top < 0 || page_layout.margin_left < 0 ||
173 page_layout.margin_bottom < 0 || page_layout.margin_right < 0 || 171 page_layout.margin_bottom < 0 || page_layout.margin_right < 0 ||
174 page_layout.content_width < 0 || page_layout.content_height < 0) { 172 page_layout.content_width < 0 || page_layout.content_height < 0) {
175 NOTREACHED(); 173 NOTREACHED();
176 return; 174 return;
177 } 175 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 CallJavascriptFunction("printPreviewFailed"); 236 CallJavascriptFunction("printPreviewFailed");
239 } 237 }
240 238
241 void PrintPreviewUI::OnInvalidPrinterSettings() { 239 void PrintPreviewUI::OnInvalidPrinterSettings() {
242 CallJavascriptFunction("invalidPrinterSettings"); 240 CallJavascriptFunction("invalidPrinterSettings");
243 } 241 }
244 242
245 PrintPreviewDataService* PrintPreviewUI::print_preview_data_service() { 243 PrintPreviewDataService* PrintPreviewUI::print_preview_data_service() {
246 return PrintPreviewDataService::GetInstance(); 244 return PrintPreviewDataService::GetInstance();
247 } 245 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/print_preview_ui.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698