| 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/renderer/printing/print_web_view_helper.h" | 5 #include "chrome/renderer/printing/print_web_view_helper.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 void PrepareFrameAndViewForPrint::RestoreSize() { | 746 void PrepareFrameAndViewForPrint::RestoreSize() { |
| 747 if (frame()) { | 747 if (frame()) { |
| 748 blink::WebView* web_view = frame_.GetFrame()->view(); | 748 blink::WebView* web_view = frame_.GetFrame()->view(); |
| 749 web_view->resize(prev_view_size_); | 749 web_view->resize(prev_view_size_); |
| 750 if (blink::WebFrame* web_frame = web_view->mainFrame()) | 750 if (blink::WebFrame* web_frame = web_view->mainFrame()) |
| 751 web_frame->setScrollOffset(prev_scroll_offset_); | 751 web_frame->setScrollOffset(prev_scroll_offset_); |
| 752 } | 752 } |
| 753 } | 753 } |
| 754 | 754 |
| 755 void PrepareFrameAndViewForPrint::FinishPrinting() { | 755 void PrepareFrameAndViewForPrint::FinishPrinting() { |
| 756 blink::WebFrame* frame = frame_.GetFrame(); | 756 blink::WebLocalFrame* frame = frame_.GetFrame(); |
| 757 if (frame) { | 757 if (frame) { |
| 758 blink::WebView* web_view = frame->view(); | 758 blink::WebView* web_view = frame->view(); |
| 759 if (is_printing_started_) { | 759 if (is_printing_started_) { |
| 760 is_printing_started_ = false; | 760 is_printing_started_ = false; |
| 761 frame->printEnd(); | 761 frame->printEnd(); |
| 762 if (!owns_web_view_) { | 762 if (!owns_web_view_) { |
| 763 web_view->settings()->setShouldPrintBackgrounds(false); | 763 web_view->settings()->setShouldPrintBackgrounds(false); |
| 764 RestoreSize(); | 764 RestoreSize(); |
| 765 } | 765 } |
| 766 } | 766 } |
| (...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1964 } | 1964 } |
| 1965 | 1965 |
| 1966 void PrintWebViewHelper::SetPrintPagesParams( | 1966 void PrintWebViewHelper::SetPrintPagesParams( |
| 1967 const PrintMsg_PrintPages_Params& settings) { | 1967 const PrintMsg_PrintPages_Params& settings) { |
| 1968 print_pages_params_.reset(new PrintMsg_PrintPages_Params(settings)); | 1968 print_pages_params_.reset(new PrintMsg_PrintPages_Params(settings)); |
| 1969 Send(new PrintHostMsg_DidGetDocumentCookie(routing_id(), | 1969 Send(new PrintHostMsg_DidGetDocumentCookie(routing_id(), |
| 1970 settings.params.document_cookie)); | 1970 settings.params.document_cookie)); |
| 1971 } | 1971 } |
| 1972 | 1972 |
| 1973 } // namespace printing | 1973 } // namespace printing |
| OLD | NEW |