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 #ifndef CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 5 #ifndef CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
6 #define CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 6 #define CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 }; | 111 }; |
112 | 112 |
113 // RenderViewObserver implementation. | 113 // RenderViewObserver implementation. |
114 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 114 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
115 virtual void PrintPage(blink::WebLocalFrame* frame, | 115 virtual void PrintPage(blink::WebLocalFrame* frame, |
116 bool user_initiated) OVERRIDE; | 116 bool user_initiated) OVERRIDE; |
117 virtual void DidStartLoading() OVERRIDE; | 117 virtual void DidStartLoading() OVERRIDE; |
118 virtual void DidStopLoading() OVERRIDE; | 118 virtual void DidStopLoading() OVERRIDE; |
119 | 119 |
120 // Message handlers --------------------------------------------------------- | 120 // Message handlers --------------------------------------------------------- |
121 #if !defined(OS_WIN) | |
122 void OnPrintPages(); | 121 void OnPrintPages(); |
123 void OnPrintForSystemDialog(); | 122 void OnPrintForSystemDialog(); |
124 #endif // !OS_WIN | |
125 void OnInitiatePrintPreview(bool selection_only); | 123 void OnInitiatePrintPreview(bool selection_only); |
126 void OnPrintPreview(const base::DictionaryValue& settings); | 124 void OnPrintPreview(const base::DictionaryValue& settings); |
127 void OnPrintForPrintPreview(const base::DictionaryValue& job_settings); | 125 void OnPrintForPrintPreview(const base::DictionaryValue& job_settings); |
128 void OnPrintingDone(bool success); | 126 void OnPrintingDone(bool success); |
129 | 127 |
130 // Get |page_size| and |content_area| information from | 128 // Get |page_size| and |content_area| information from |
131 // |page_layout_in_points|. | 129 // |page_layout_in_points|. |
132 void GetPageSizeAndContentAreaFromPageLayout( | 130 void GetPageSizeAndContentAreaFromPageLayout( |
133 const PageSizeMargins& page_layout_in_points, | 131 const PageSizeMargins& page_layout_in_points, |
134 gfx::Size* page_size, | 132 gfx::Size* page_size, |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 // hangs because RequestPrintPreview is called before DidStopLoading() is | 436 // hangs because RequestPrintPreview is called before DidStopLoading() is |
439 // called. This is a store for the RequestPrintPreview() call and its | 437 // called. This is a store for the RequestPrintPreview() call and its |
440 // parameters so that it can be invoked after DidStopLoading. | 438 // parameters so that it can be invoked after DidStopLoading. |
441 base::Closure on_stop_loading_closure_; | 439 base::Closure on_stop_loading_closure_; |
442 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 440 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
443 }; | 441 }; |
444 | 442 |
445 } // namespace printing | 443 } // namespace printing |
446 | 444 |
447 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 445 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
OLD | NEW |