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_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_UI_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_UI_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 void OnPreviewDataIsAvailable(int expected_pages_count, | 37 void OnPreviewDataIsAvailable(int expected_pages_count, |
38 const string16& job_title, | 38 const string16& job_title, |
39 bool modifiable); | 39 bool modifiable); |
40 | 40 |
41 // Notify the Web UI that initiator tab is closed, so we can disable all | 41 // Notify the Web UI that initiator tab is closed, so we can disable all |
42 // the controls that need the initiator tab for generating the preview data. | 42 // the controls that need the initiator tab for generating the preview data. |
43 // |initiator_tab_url| is passed in order to display a more accurate error | 43 // |initiator_tab_url| is passed in order to display a more accurate error |
44 // message. | 44 // message. |
45 void OnInitiatorTabClosed(const std::string& initiator_tab_url); | 45 void OnInitiatorTabClosed(const std::string& initiator_tab_url); |
46 | 46 |
| 47 void setTabHiddenForPrint() { |
| 48 is_tab_hidden_for_print_ = true; |
| 49 } |
| 50 |
| 51 // Returns true if the current tab is hidden for printing. |
| 52 bool isHidden() { |
| 53 return is_tab_hidden_for_print_; |
| 54 } |
| 55 |
47 private: | 56 private: |
48 // Helper function | 57 // Helper function |
49 PrintPreviewDataService* print_preview_data_service(); | 58 PrintPreviewDataService* print_preview_data_service(); |
50 | 59 |
51 base::TimeTicks initial_preview_start_time_; | 60 base::TimeTicks initial_preview_start_time_; |
52 | 61 |
53 // Store the PrintPreviewUI address string. | 62 // Store the PrintPreviewUI address string. |
54 std::string preview_ui_addr_str_; | 63 std::string preview_ui_addr_str_; |
55 | 64 |
| 65 // True when the current tab is hidden for printing. |
| 66 bool is_tab_hidden_for_print_; |
| 67 |
56 DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI); | 68 DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI); |
57 }; | 69 }; |
58 | 70 |
59 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_UI_H_ | 71 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_UI_H_ |
OLD | NEW |