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(DISABLE_BASIC_PRINTING) |
121 void OnPrintPages(); | 122 void OnPrintPages(); |
122 void OnPrintForSystemDialog(); | 123 void OnPrintForSystemDialog(); |
| 124 #endif // !DISABLE_BASIC_PRINTING |
123 void OnInitiatePrintPreview(bool selection_only); | 125 void OnInitiatePrintPreview(bool selection_only); |
124 void OnPrintPreview(const base::DictionaryValue& settings); | 126 void OnPrintPreview(const base::DictionaryValue& settings); |
125 void OnPrintForPrintPreview(const base::DictionaryValue& job_settings); | 127 void OnPrintForPrintPreview(const base::DictionaryValue& job_settings); |
126 void OnPrintingDone(bool success); | 128 void OnPrintingDone(bool success); |
127 | 129 |
128 // Get |page_size| and |content_area| information from | 130 // Get |page_size| and |content_area| information from |
129 // |page_layout_in_points|. | 131 // |page_layout_in_points|. |
130 void GetPageSizeAndContentAreaFromPageLayout( | 132 void GetPageSizeAndContentAreaFromPageLayout( |
131 const PageSizeMargins& page_layout_in_points, | 133 const PageSizeMargins& page_layout_in_points, |
132 gfx::Size* page_size, | 134 gfx::Size* page_size, |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 // hangs because RequestPrintPreview is called before DidStopLoading() is | 438 // hangs because RequestPrintPreview is called before DidStopLoading() is |
437 // called. This is a store for the RequestPrintPreview() call and its | 439 // called. This is a store for the RequestPrintPreview() call and its |
438 // parameters so that it can be invoked after DidStopLoading. | 440 // parameters so that it can be invoked after DidStopLoading. |
439 base::Closure on_stop_loading_closure_; | 441 base::Closure on_stop_loading_closure_; |
440 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 442 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
441 }; | 443 }; |
442 | 444 |
443 } // namespace printing | 445 } // namespace printing |
444 | 446 |
445 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ | 447 #endif // CHROME_RENDERER_PRINTING_PRINT_WEB_VIEW_HELPER_H_ |
OLD | NEW |