| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 // working so that we can get the default values from there. Fix up | 404 // working so that we can get the default values from there. Fix up |
| 405 // PrintWebViewHelper to do the same. | 405 // PrintWebViewHelper to do the same. |
| 406 const int kDPI = 72; | 406 const int kDPI = 72; |
| 407 const int kWidth = static_cast<int>((8.5-0.25-0.25)*kDPI); | 407 const int kWidth = static_cast<int>((8.5-0.25-0.25)*kDPI); |
| 408 const int kHeight = static_cast<int>((11-0.25-0.56)*kDPI); | 408 const int kHeight = static_cast<int>((11-0.25-0.56)*kDPI); |
| 409 const double kMinPageShrink = 1.25; | 409 const double kMinPageShrink = 1.25; |
| 410 const double kMaxPageShrink = 2.0; | 410 const double kMaxPageShrink = 2.0; |
| 411 | 411 |
| 412 PrintMsg_Print_Params default_settings; | 412 PrintMsg_Print_Params default_settings; |
| 413 default_settings.content_size = gfx::Size(kWidth, kHeight); | 413 default_settings.content_size = gfx::Size(kWidth, kHeight); |
| 414 default_settings.printable_area = gfx::Rect(0, 0, kWidth, kHeight); |
| 414 default_settings.dpi = kDPI; | 415 default_settings.dpi = kDPI; |
| 415 default_settings.min_shrink = kMinPageShrink; | 416 default_settings.min_shrink = kMinPageShrink; |
| 416 default_settings.max_shrink = kMaxPageShrink; | 417 default_settings.max_shrink = kMaxPageShrink; |
| 417 default_settings.desired_dpi = kDPI; | 418 default_settings.desired_dpi = kDPI; |
| 418 default_settings.document_cookie = 0; | 419 default_settings.document_cookie = 0; |
| 419 default_settings.selection_only = false; | 420 default_settings.selection_only = false; |
| 420 default_settings.preview_request_id = 0; | 421 default_settings.preview_request_id = 0; |
| 421 default_settings.is_first_request = true; | 422 default_settings.is_first_request = true; |
| 423 default_settings.print_to_pdf = false; |
| 422 | 424 |
| 423 if (!GetPageSetupParameters(json, default_settings)) { | 425 if (!GetPageSetupParameters(json, default_settings)) { |
| 424 NOTREACHED(); | 426 NOTREACHED(); |
| 425 return; | 427 return; |
| 426 } | 428 } |
| 427 | 429 |
| 428 // TODO(scottbyer) - Here is where we would kick the originating | 430 // TODO(scottbyer) - Here is where we would kick the originating |
| 429 // renderer thread with these new parameters in order to get it to | 431 // renderer thread with these new parameters in order to get it to |
| 430 // re-generate the PDF data and hand it back to us. window.print() is | 432 // re-generate the PDF data and hand it back to us. window.print() is |
| 431 // currently synchronous, so there's a lot of work to do to get to | 433 // currently synchronous, so there's a lot of work to do to get to |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 file_type, | 728 file_type, |
| 727 false, | 729 false, |
| 728 delete_on_close); | 730 delete_on_close); |
| 729 return true; | 731 return true; |
| 730 } | 732 } |
| 731 } | 733 } |
| 732 return false; | 734 return false; |
| 733 } | 735 } |
| 734 | 736 |
| 735 } // end namespace | 737 } // end namespace |
| OLD | NEW |