Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Side by Side Diff: chrome/browser/ui/webui/print_preview_ui.h

Issue 7721001: PrintPreview: Make ctrl-shift-p start the native print flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 static void GetCurrentPrintPreviewStatus(const std::string& preview_ui_addr, 51 static void GetCurrentPrintPreviewStatus(const std::string& preview_ui_addr,
52 int request_id, 52 int request_id,
53 bool* cancel); 53 bool* cancel);
54 54
55 // Returns a string to uniquely identify this PrintPreviewUI. 55 // Returns a string to uniquely identify this PrintPreviewUI.
56 std::string GetPrintPreviewUIAddress() const; 56 std::string GetPrintPreviewUIAddress() const;
57 57
58 // Notifies the Web UI of a print preview request with |request_id|. 58 // Notifies the Web UI of a print preview request with |request_id|.
59 void OnPrintPreviewRequest(int request_id); 59 void OnPrintPreviewRequest(int request_id);
60 60
61 // Notifies the Web UI to show the system dialog.
62 void OnShowSystemDialog();
63
61 // Notifies the Web UI about the page count of the request preview. 64 // Notifies the Web UI about the page count of the request preview.
62 void OnDidGetPreviewPageCount( 65 void OnDidGetPreviewPageCount(
63 const PrintHostMsg_DidGetPreviewPageCount_Params& params); 66 const PrintHostMsg_DidGetPreviewPageCount_Params& params);
64 67
65 // Notifies the Web UI of the default page layout according to the currently 68 // Notifies the Web UI of the default page layout according to the currently
66 // selected printer and page size. 69 // selected printer and page size.
67 void OnDidGetDefaultPageLayout( 70 void OnDidGetDefaultPageLayout(
68 const printing::PageSizeMargins& page_layout); 71 const printing::PageSizeMargins& page_layout);
69 72
70 // Notifies the Web UI that the 0-based page |page_number| has been rendered. 73 // Notifies the Web UI that the 0-based page |page_number| has been rendered.
(...skipping 18 matching lines...) Expand all
89 // Notifies the Web UI that initiator tab is closed, so we can disable all the 92 // Notifies the Web UI that initiator tab is closed, so we can disable all the
90 // controls that need the initiator tab for generating the preview data. 93 // controls that need the initiator tab for generating the preview data.
91 void OnInitiatorTabClosed(); 94 void OnInitiatorTabClosed();
92 95
93 // Notifies the Web UI that the initiator tab has crashed. 96 // Notifies the Web UI that the initiator tab has crashed.
94 void OnInitiatorTabCrashed(); 97 void OnInitiatorTabCrashed();
95 98
96 // Notifies the Web UI renderer that file selection has been cancelled. 99 // Notifies the Web UI renderer that file selection has been cancelled.
97 void OnFileSelectionCancelled(); 100 void OnFileSelectionCancelled();
98 101
102 // Notifies the Web UI to cancel the pending preview request.
103 void OnCancelPendingPreviewRequest();
104
99 private: 105 private:
100 FRIEND_TEST_ALL_PREFIXES(PrintPreviewTabControllerUnitTest, 106 FRIEND_TEST_ALL_PREFIXES(PrintPreviewTabControllerUnitTest,
101 TitleAfterReload); 107 TitleAfterReload);
102 108
103 // Returns the Singleton instance of the PrintPreviewDataService. 109 // Returns the Singleton instance of the PrintPreviewDataService.
104 PrintPreviewDataService* print_preview_data_service(); 110 PrintPreviewDataService* print_preview_data_service();
105 111
106 base::TimeTicks initial_preview_start_time_; 112 base::TimeTicks initial_preview_start_time_;
107 113
108 // Store the PrintPreviewUI address string. 114 // Store the PrintPreviewUI address string.
109 std::string preview_ui_addr_str_; 115 std::string preview_ui_addr_str_;
110 116
111 // Weak pointer to the WebUI handler. 117 // Weak pointer to the WebUI handler.
112 PrintPreviewHandler* handler_; 118 PrintPreviewHandler* handler_;
113 119
114 // Store the |initiator_url| in order to display an accurate error message 120 // Store the |initiator_url| in order to display an accurate error message
115 // when the initiator tab is closed/crashed. 121 // when the initiator tab is closed/crashed.
116 std::string initiator_url_; 122 std::string initiator_url_;
117 123
118 // Store the initiator tab title, used for populating the print preview tab 124 // Store the initiator tab title, used for populating the print preview tab
119 // title. 125 // title.
120 string16 initiator_tab_title_; 126 string16 initiator_tab_title_;
121 127
122 DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI); 128 DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI);
123 }; 129 };
124 130
125 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_UI_H_ 131 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698