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 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/ref_counted_memory.h" | 13 #include "base/memory/ref_counted_memory.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "chrome/browser/printing/print_preview_data_service.h" | 15 #include "chrome/browser/printing/print_preview_data_service.h" |
16 #include "chrome/browser/ui/webui/constrained_html_ui.h" | 16 #include "chrome/browser/ui/webui/constrained_html_ui.h" |
17 | 17 |
18 class PrintPreviewDataService; | 18 class PrintPreviewDataService; |
19 class PrintPreviewHandler; | 19 class PrintPreviewHandler; |
20 struct PrintHostMsg_DidGetPreviewPageCount_Params; | 20 struct PrintHostMsg_DidGetPreviewPageCount_Params; |
21 | 21 |
| 22 namespace gfx { |
| 23 class Rect; |
| 24 } |
| 25 |
22 namespace printing { | 26 namespace printing { |
23 struct PageSizeMargins; | 27 struct PageSizeMargins; |
24 } | 28 } |
25 | 29 |
26 class PrintPreviewUI : public ConstrainedHtmlUI { | 30 class PrintPreviewUI : public ConstrainedHtmlUI { |
27 public: | 31 public: |
28 explicit PrintPreviewUI(content::WebUI* web_ui); | 32 explicit PrintPreviewUI(content::WebUI* web_ui); |
29 virtual ~PrintPreviewUI(); | 33 virtual ~PrintPreviewUI(); |
30 | 34 |
31 // Gets the print preview |data|. |index| is zero-based, and can be | 35 // Gets the print preview |data|. |index| is zero-based, and can be |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void OnShowSystemDialog(); | 78 void OnShowSystemDialog(); |
75 | 79 |
76 // Notifies the Web UI about the page count of the request preview. | 80 // Notifies the Web UI about the page count of the request preview. |
77 void OnDidGetPreviewPageCount( | 81 void OnDidGetPreviewPageCount( |
78 const PrintHostMsg_DidGetPreviewPageCount_Params& params); | 82 const PrintHostMsg_DidGetPreviewPageCount_Params& params); |
79 | 83 |
80 // Notifies the Web UI of the default page layout according to the currently | 84 // Notifies the Web UI of the default page layout according to the currently |
81 // selected printer and page size. | 85 // selected printer and page size. |
82 void OnDidGetDefaultPageLayout( | 86 void OnDidGetDefaultPageLayout( |
83 const printing::PageSizeMargins& page_layout, | 87 const printing::PageSizeMargins& page_layout, |
| 88 const gfx::Rect& printable_area, |
84 bool has_custom_page_size_style); | 89 bool has_custom_page_size_style); |
85 | 90 |
86 // Notifies the Web UI that the 0-based page |page_number| has been rendered. | 91 // Notifies the Web UI that the 0-based page |page_number| has been rendered. |
87 // |preview_request_id| indicates wich request resulted in this response. | 92 // |preview_request_id| indicates wich request resulted in this response. |
88 void OnDidPreviewPage(int page_number, int preview_request_id); | 93 void OnDidPreviewPage(int page_number, int preview_request_id); |
89 | 94 |
90 // Notifies the Web UI renderer that preview data is available. | 95 // Notifies the Web UI renderer that preview data is available. |
91 // |expected_pages_count| specifies the total number of pages. | 96 // |expected_pages_count| specifies the total number of pages. |
92 // |preview_request_id| indicates which request resulted in this response. | 97 // |preview_request_id| indicates which request resulted in this response. |
93 void OnPreviewDataIsAvailable(int expected_pages_count, | 98 void OnPreviewDataIsAvailable(int expected_pages_count, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // Keeps track of whether OnClosePrintPreviewTab() has been called or not. | 174 // Keeps track of whether OnClosePrintPreviewTab() has been called or not. |
170 bool tab_closed_; | 175 bool tab_closed_; |
171 | 176 |
172 // True if the user visited the page directly, false if it's a live UI. | 177 // True if the user visited the page directly, false if it's a live UI. |
173 bool is_dummy_; | 178 bool is_dummy_; |
174 | 179 |
175 DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI); | 180 DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI); |
176 }; | 181 }; |
177 | 182 |
178 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ | 183 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_PRINT_PREVIEW_UI_H_ |
OLD | NEW |