OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ |
6 #define CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 void HandleSendPrintData(const ListValue* args); | 113 void HandleSendPrintData(const ListValue* args); |
114 void HandleSetPageParameters(const ListValue* args); | 114 void HandleSetPageParameters(const ListValue* args); |
115 | 115 |
116 // Call to get the debugger loaded on our hosted dialog page | 116 // Call to get the debugger loaded on our hosted dialog page |
117 // specifically. Since we're not in an official browser tab, only | 117 // specifically. Since we're not in an official browser tab, only |
118 // way to get the debugger going. | 118 // way to get the debugger going. |
119 void ShowDebugger(); | 119 void ShowDebugger(); |
120 | 120 |
121 virtual void SetDialogDelegate(CloudPrintHtmlDialogDelegate *delegate); | 121 virtual void SetDialogDelegate(CloudPrintHtmlDialogDelegate *delegate); |
122 void CancelAnyRunningTask(); | 122 void CancelAnyRunningTask(); |
| 123 void StoreDialogClientSize() const; |
123 | 124 |
124 private: | 125 private: |
125 // For unit testing. | 126 // For unit testing. |
126 virtual scoped_refptr<CloudPrintDataSender> CreateCloudPrintDataSender(); | 127 virtual scoped_refptr<CloudPrintDataSender> CreateCloudPrintDataSender(); |
127 | 128 |
128 CloudPrintHtmlDialogDelegate* dialog_delegate_; | 129 CloudPrintHtmlDialogDelegate* dialog_delegate_; |
129 NotificationRegistrar registrar_; | 130 NotificationRegistrar registrar_; |
130 FilePath path_to_pdf_; | 131 FilePath path_to_pdf_; |
131 string16 print_job_title_; | 132 string16 print_job_title_; |
132 scoped_refptr<CloudPrintDataSender> print_data_sender_; | 133 scoped_refptr<CloudPrintDataSender> print_data_sender_; |
(...skipping 16 matching lines...) Expand all Loading... |
149 // HTMLDialogUIDelegate implementation: | 150 // HTMLDialogUIDelegate implementation: |
150 virtual bool IsDialogModal() const; | 151 virtual bool IsDialogModal() const; |
151 virtual std::wstring GetDialogTitle() const; | 152 virtual std::wstring GetDialogTitle() const; |
152 virtual GURL GetDialogContentURL() const; | 153 virtual GURL GetDialogContentURL() const; |
153 virtual void GetDOMMessageHandlers( | 154 virtual void GetDOMMessageHandlers( |
154 std::vector<DOMMessageHandler*>* handlers) const; | 155 std::vector<DOMMessageHandler*>* handlers) const; |
155 virtual void GetDialogSize(gfx::Size* size) const; | 156 virtual void GetDialogSize(gfx::Size* size) const; |
156 virtual std::string GetDialogArgs() const; | 157 virtual std::string GetDialogArgs() const; |
157 virtual void OnDialogClosed(const std::string& json_retval); | 158 virtual void OnDialogClosed(const std::string& json_retval); |
158 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog); | 159 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog); |
| 160 virtual bool ShouldShowDialogTitle() const; |
159 | 161 |
160 private: | 162 private: |
161 friend class ::CloudPrintHtmlDialogDelegateTest; | 163 friend class ::CloudPrintHtmlDialogDelegateTest; |
162 | 164 |
163 CloudPrintHtmlDialogDelegate(CloudPrintFlowHandler* flow_handler, | 165 CloudPrintHtmlDialogDelegate(CloudPrintFlowHandler* flow_handler, |
164 int width, int height, | 166 int width, int height, |
165 const std::string& json_arguments); | 167 const std::string& json_arguments); |
166 void Init(int width, int height, const std::string& json_arguments); | 168 void Init(int width, int height, const std::string& json_arguments); |
167 | 169 |
168 CloudPrintFlowHandler* flow_handler_; | 170 CloudPrintFlowHandler* flow_handler_; |
169 mutable bool owns_flow_handler_; | 171 mutable bool owns_flow_handler_; |
170 | 172 |
171 // The parameters needed to display a modal HTML dialog. | 173 // The parameters needed to display a modal HTML dialog. |
172 HtmlDialogUI::HtmlDialogParams params_; | 174 HtmlDialogUI::HtmlDialogParams params_; |
173 | 175 |
174 DISALLOW_COPY_AND_ASSIGN(CloudPrintHtmlDialogDelegate); | 176 DISALLOW_COPY_AND_ASSIGN(CloudPrintHtmlDialogDelegate); |
175 }; | 177 }; |
176 | 178 |
177 } // namespace internal_cloud_print_helpers | 179 } // namespace internal_cloud_print_helpers |
178 | 180 |
179 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ | 181 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ |
OLD | NEW |