| 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/printing/print_dialog_cloud.h" | 5 #include "chrome/browser/printing/print_dialog_cloud.h" |
| 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" | 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" |
| 7 | 7 |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 // working so that we can get the default values from there. Fix up | 400 // working so that we can get the default values from there. Fix up |
| 401 // PrintWebViewHelper to do the same. | 401 // PrintWebViewHelper to do the same. |
| 402 const int kDPI = 72; | 402 const int kDPI = 72; |
| 403 const int kWidth = static_cast<int>((8.5-0.25-0.25)*kDPI); | 403 const int kWidth = static_cast<int>((8.5-0.25-0.25)*kDPI); |
| 404 const int kHeight = static_cast<int>((11-0.25-0.56)*kDPI); | 404 const int kHeight = static_cast<int>((11-0.25-0.56)*kDPI); |
| 405 const double kMinPageShrink = 1.25; | 405 const double kMinPageShrink = 1.25; |
| 406 const double kMaxPageShrink = 2.0; | 406 const double kMaxPageShrink = 2.0; |
| 407 | 407 |
| 408 PrintMsg_Print_Params default_settings; | 408 PrintMsg_Print_Params default_settings; |
| 409 default_settings.content_size = gfx::Size(kWidth, kHeight); | 409 default_settings.content_size = gfx::Size(kWidth, kHeight); |
| 410 default_settings.printable_area = gfx::Rect(0, 0, kWidth, kHeight); |
| 410 default_settings.dpi = kDPI; | 411 default_settings.dpi = kDPI; |
| 411 default_settings.min_shrink = kMinPageShrink; | 412 default_settings.min_shrink = kMinPageShrink; |
| 412 default_settings.max_shrink = kMaxPageShrink; | 413 default_settings.max_shrink = kMaxPageShrink; |
| 413 default_settings.desired_dpi = kDPI; | 414 default_settings.desired_dpi = kDPI; |
| 414 default_settings.document_cookie = 0; | 415 default_settings.document_cookie = 0; |
| 415 default_settings.selection_only = false; | 416 default_settings.selection_only = false; |
| 416 default_settings.preview_request_id = 0; | 417 default_settings.preview_request_id = 0; |
| 417 default_settings.is_first_request = true; | 418 default_settings.is_first_request = true; |
| 419 default_settings.print_to_pdf = false; |
| 418 | 420 |
| 419 if (!GetPageSetupParameters(json, default_settings)) { | 421 if (!GetPageSetupParameters(json, default_settings)) { |
| 420 NOTREACHED(); | 422 NOTREACHED(); |
| 421 return; | 423 return; |
| 422 } | 424 } |
| 423 | 425 |
| 424 // TODO(scottbyer) - Here is where we would kick the originating | 426 // TODO(scottbyer) - Here is where we would kick the originating |
| 425 // renderer thread with these new parameters in order to get it to | 427 // renderer thread with these new parameters in order to get it to |
| 426 // re-generate the PDF data and hand it back to us. window.print() is | 428 // re-generate the PDF data and hand it back to us. window.print() is |
| 427 // currently synchronous, so there's a lot of work to do to get to | 429 // currently synchronous, so there's a lot of work to do to get to |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 file_type, | 721 file_type, |
| 720 false, | 722 false, |
| 721 delete_on_close); | 723 delete_on_close); |
| 722 return true; | 724 return true; |
| 723 } | 725 } |
| 724 } | 726 } |
| 725 return false; | 727 return false; |
| 726 } | 728 } |
| 727 | 729 |
| 728 } // end namespace | 730 } // end namespace |
| OLD | NEW |