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