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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 }; | 131 }; |
132 | 132 |
133 // State machine used to run the printing dialog. This class is used | 133 // State machine used to run the printing dialog. This class is used |
134 // to open and run the html dialog and deletes itself when the dialog | 134 // to open and run the html dialog and deletes itself when the dialog |
135 // is closed. | 135 // is closed. |
136 class CloudPrintHtmlDialogDelegate : public HtmlDialogUIDelegate { | 136 class CloudPrintHtmlDialogDelegate : public HtmlDialogUIDelegate { |
137 public: | 137 public: |
138 CloudPrintHtmlDialogDelegate(const FilePath& path_to_pdf, | 138 CloudPrintHtmlDialogDelegate(const FilePath& path_to_pdf, |
139 int width, int height, | 139 int width, int height, |
140 const std::string& json_arguments, | 140 const std::string& json_arguments, |
141 const string16& print_job_title); | 141 const string16& print_job_title, |
| 142 bool modal); |
142 virtual ~CloudPrintHtmlDialogDelegate(); | 143 virtual ~CloudPrintHtmlDialogDelegate(); |
143 | 144 |
144 // HTMLDialogUIDelegate implementation: | 145 // HTMLDialogUIDelegate implementation: |
145 virtual bool IsDialogModal() const; | 146 virtual bool IsDialogModal() const; |
146 virtual std::wstring GetDialogTitle() const; | 147 virtual std::wstring GetDialogTitle() const; |
147 virtual GURL GetDialogContentURL() const; | 148 virtual GURL GetDialogContentURL() const; |
148 virtual void GetDOMMessageHandlers( | 149 virtual void GetDOMMessageHandlers( |
149 std::vector<DOMMessageHandler*>* handlers) const; | 150 std::vector<DOMMessageHandler*>* handlers) const; |
150 virtual void GetDialogSize(gfx::Size* size) const; | 151 virtual void GetDialogSize(gfx::Size* size) const; |
151 virtual std::string GetDialogArgs() const; | 152 virtual std::string GetDialogArgs() const; |
152 virtual void OnDialogClosed(const std::string& json_retval); | 153 virtual void OnDialogClosed(const std::string& json_retval); |
153 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog); | 154 virtual void OnCloseContents(TabContents* source, bool* out_close_dialog); |
154 virtual bool ShouldShowDialogTitle() const; | 155 virtual bool ShouldShowDialogTitle() const; |
155 | 156 |
156 private: | 157 private: |
157 friend class ::CloudPrintHtmlDialogDelegateTest; | 158 friend class ::CloudPrintHtmlDialogDelegateTest; |
158 | 159 |
159 CloudPrintHtmlDialogDelegate(CloudPrintFlowHandler* flow_handler, | 160 CloudPrintHtmlDialogDelegate(CloudPrintFlowHandler* flow_handler, |
160 int width, int height, | 161 int width, int height, |
161 const std::string& json_arguments); | 162 const std::string& json_arguments, |
| 163 bool modal); |
162 void Init(int width, int height, const std::string& json_arguments); | 164 void Init(int width, int height, const std::string& json_arguments); |
163 | 165 |
164 CloudPrintFlowHandler* flow_handler_; | 166 CloudPrintFlowHandler* flow_handler_; |
| 167 bool modal_; |
165 mutable bool owns_flow_handler_; | 168 mutable bool owns_flow_handler_; |
166 | 169 |
167 // The parameters needed to display a modal HTML dialog. | 170 // The parameters needed to display a modal HTML dialog. |
168 HtmlDialogUI::HtmlDialogParams params_; | 171 HtmlDialogUI::HtmlDialogParams params_; |
169 | 172 |
170 DISALLOW_COPY_AND_ASSIGN(CloudPrintHtmlDialogDelegate); | 173 DISALLOW_COPY_AND_ASSIGN(CloudPrintHtmlDialogDelegate); |
171 }; | 174 }; |
172 | 175 |
173 } // namespace internal_cloud_print_helpers | 176 } // namespace internal_cloud_print_helpers |
174 | 177 |
175 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ | 178 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ |
OLD | NEW |