| OLD | NEW |
| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 172 } |
| 173 | 173 |
| 174 void PrintPreviewUI::OnShowSystemDialog() { | 174 void PrintPreviewUI::OnShowSystemDialog() { |
| 175 CallJavascriptFunction("onSystemDialogLinkClicked"); | 175 CallJavascriptFunction("onSystemDialogLinkClicked"); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void PrintPreviewUI::OnDidGetPreviewPageCount( | 178 void PrintPreviewUI::OnDidGetPreviewPageCount( |
| 179 const PrintHostMsg_DidGetPreviewPageCount_Params& params) { | 179 const PrintHostMsg_DidGetPreviewPageCount_Params& params) { |
| 180 DCHECK_GT(params.page_count, 0); | 180 DCHECK_GT(params.page_count, 0); |
| 181 base::FundamentalValue count(params.page_count); | 181 base::FundamentalValue count(params.page_count); |
| 182 base::FundamentalValue has_page_size_style(params.has_page_size_style); |
| 182 base::FundamentalValue request_id(params.preview_request_id); | 183 base::FundamentalValue request_id(params.preview_request_id); |
| 183 CallJavascriptFunction("onDidGetPreviewPageCount", count, request_id); | 184 CallJavascriptFunction("onDidGetPreviewPageCount", count, request_id, |
| 185 has_page_size_style); |
| 184 } | 186 } |
| 185 | 187 |
| 186 void PrintPreviewUI::OnDidGetDefaultPageLayout( | 188 void PrintPreviewUI::OnDidGetDefaultPageLayout( |
| 187 const PageSizeMargins& page_layout) { | 189 const PageSizeMargins& page_layout) { |
| 188 if (page_layout.margin_top < 0 || page_layout.margin_left < 0 || | 190 if (page_layout.margin_top < 0 || page_layout.margin_left < 0 || |
| 189 page_layout.margin_bottom < 0 || page_layout.margin_right < 0 || | 191 page_layout.margin_bottom < 0 || page_layout.margin_right < 0 || |
| 190 page_layout.content_width < 0 || page_layout.content_height < 0) { | 192 page_layout.content_width < 0 || page_layout.content_height < 0) { |
| 191 NOTREACHED(); | 193 NOTREACHED(); |
| 192 return; | 194 return; |
| 193 } | 195 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 ConstrainedHtmlUIDelegate* delegate = GetConstrainedDelegate(); | 287 ConstrainedHtmlUIDelegate* delegate = GetConstrainedDelegate(); |
| 286 if (!delegate) | 288 if (!delegate) |
| 287 return; | 289 return; |
| 288 delegate->GetHtmlDialogUIDelegate()->OnDialogClosed(""); | 290 delegate->GetHtmlDialogUIDelegate()->OnDialogClosed(""); |
| 289 delegate->OnDialogCloseFromWebUI(); | 291 delegate->OnDialogCloseFromWebUI(); |
| 290 } | 292 } |
| 291 | 293 |
| 292 void PrintPreviewUI::OnReloadPrintersList() { | 294 void PrintPreviewUI::OnReloadPrintersList() { |
| 293 CallJavascriptFunction("reloadPrintersList"); | 295 CallJavascriptFunction("reloadPrintersList"); |
| 294 } | 296 } |
| OLD | NEW |