| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // the renderer process - do we want a progress throbber shown? | 92 // the renderer process - do we want a progress throbber shown? |
| 93 // Probably..), and packing up the PDF and job parameters and sending | 93 // Probably..), and packing up the PDF and job parameters and sending |
| 94 // them to the cloud. | 94 // them to the cloud. |
| 95 class CloudPrintFlowHandler : public content::WebUIMessageHandler, | 95 class CloudPrintFlowHandler : public content::WebUIMessageHandler, |
| 96 public content::NotificationObserver { | 96 public content::NotificationObserver { |
| 97 public: | 97 public: |
| 98 CloudPrintFlowHandler(const base::RefCountedMemory* data, | 98 CloudPrintFlowHandler(const base::RefCountedMemory* data, |
| 99 const base::string16& print_job_title, | 99 const base::string16& print_job_title, |
| 100 const base::string16& print_ticket, | 100 const base::string16& print_ticket, |
| 101 const std::string& file_type); | 101 const std::string& file_type); |
| 102 virtual ~CloudPrintFlowHandler(); | 102 ~CloudPrintFlowHandler() override; |
| 103 | 103 |
| 104 // WebUIMessageHandler implementation. | 104 // WebUIMessageHandler implementation. |
| 105 virtual void RegisterMessages() override; | 105 void RegisterMessages() override; |
| 106 | 106 |
| 107 // content::NotificationObserver implementation. | 107 // content::NotificationObserver implementation. |
| 108 virtual void Observe(int type, | 108 void Observe(int type, |
| 109 const content::NotificationSource& source, | 109 const content::NotificationSource& source, |
| 110 const content::NotificationDetails& details) override; | 110 const content::NotificationDetails& details) override; |
| 111 | 111 |
| 112 // Callbacks from the page. | 112 // Callbacks from the page. |
| 113 void HandleShowDebugger(const base::ListValue* args); | 113 void HandleShowDebugger(const base::ListValue* args); |
| 114 void HandleSendPrintData(const base::ListValue* args); | 114 void HandleSendPrintData(const base::ListValue* args); |
| 115 void HandleSetPageParameters(const base::ListValue* args); | 115 void HandleSetPageParameters(const base::ListValue* args); |
| 116 | 116 |
| 117 virtual void SetDialogDelegate(CloudPrintWebDialogDelegate *delegate); | 117 virtual void SetDialogDelegate(CloudPrintWebDialogDelegate *delegate); |
| 118 void StoreDialogClientSize() const; | 118 void StoreDialogClientSize() const; |
| 119 | 119 |
| 120 private: | 120 private: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 145 // is closed. | 145 // is closed. |
| 146 class CloudPrintWebDialogDelegate : public ui::WebDialogDelegate { | 146 class CloudPrintWebDialogDelegate : public ui::WebDialogDelegate { |
| 147 public: | 147 public: |
| 148 CloudPrintWebDialogDelegate(content::BrowserContext* browser_context, | 148 CloudPrintWebDialogDelegate(content::BrowserContext* browser_context, |
| 149 gfx::NativeWindow modal_parent, | 149 gfx::NativeWindow modal_parent, |
| 150 const base::RefCountedMemory* data, | 150 const base::RefCountedMemory* data, |
| 151 const std::string& json_arguments, | 151 const std::string& json_arguments, |
| 152 const base::string16& print_job_title, | 152 const base::string16& print_job_title, |
| 153 const base::string16& print_ticket, | 153 const base::string16& print_ticket, |
| 154 const std::string& file_type); | 154 const std::string& file_type); |
| 155 virtual ~CloudPrintWebDialogDelegate(); | 155 ~CloudPrintWebDialogDelegate() override; |
| 156 | 156 |
| 157 // ui::WebDialogDelegate implementation: | 157 // ui::WebDialogDelegate implementation: |
| 158 virtual ui::ModalType GetDialogModalType() const override; | 158 ui::ModalType GetDialogModalType() const override; |
| 159 virtual base::string16 GetDialogTitle() const override; | 159 base::string16 GetDialogTitle() const override; |
| 160 virtual GURL GetDialogContentURL() const override; | 160 GURL GetDialogContentURL() const override; |
| 161 virtual void GetWebUIMessageHandlers( | 161 void GetWebUIMessageHandlers( |
| 162 std::vector<content::WebUIMessageHandler*>* handlers) const override; | 162 std::vector<content::WebUIMessageHandler*>* handlers) const override; |
| 163 virtual void GetDialogSize(gfx::Size* size) const override; | 163 void GetDialogSize(gfx::Size* size) const override; |
| 164 virtual std::string GetDialogArgs() const override; | 164 std::string GetDialogArgs() const override; |
| 165 virtual void OnDialogClosed(const std::string& json_retval) override; | 165 void OnDialogClosed(const std::string& json_retval) override; |
| 166 virtual void OnCloseContents(content::WebContents* source, | 166 void OnCloseContents(content::WebContents* source, |
| 167 bool* out_close_dialog) override; | 167 bool* out_close_dialog) override; |
| 168 virtual bool ShouldShowDialogTitle() const override; | 168 bool ShouldShowDialogTitle() const override; |
| 169 virtual bool HandleContextMenu( | 169 bool HandleContextMenu(const content::ContextMenuParams& params) override; |
| 170 const content::ContextMenuParams& params) override; | |
| 171 | 170 |
| 172 private: | 171 private: |
| 173 friend class ::CloudPrintWebDialogDelegateTest; | 172 friend class ::CloudPrintWebDialogDelegateTest; |
| 174 | 173 |
| 175 // For unit testing. | 174 // For unit testing. |
| 176 CloudPrintWebDialogDelegate(CloudPrintFlowHandler* flow_handler, | 175 CloudPrintWebDialogDelegate(CloudPrintFlowHandler* flow_handler, |
| 177 const std::string& json_arguments); | 176 const std::string& json_arguments); |
| 178 void Init(content::BrowserContext* browser_context, | 177 void Init(content::BrowserContext* browser_context, |
| 179 const std::string& json_arguments); | 178 const std::string& json_arguments); |
| 180 | 179 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 192 void CreateDialogForFileImpl(content::BrowserContext* browser_context, | 191 void CreateDialogForFileImpl(content::BrowserContext* browser_context, |
| 193 gfx::NativeWindow modal_parent, | 192 gfx::NativeWindow modal_parent, |
| 194 const base::FilePath& path_to_file, | 193 const base::FilePath& path_to_file, |
| 195 const base::string16& print_job_title, | 194 const base::string16& print_job_title, |
| 196 const base::string16& print_ticket, | 195 const base::string16& print_ticket, |
| 197 const std::string& file_type); | 196 const std::string& file_type); |
| 198 | 197 |
| 199 } // namespace internal_cloud_print_helpers | 198 } // namespace internal_cloud_print_helpers |
| 200 | 199 |
| 201 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ | 200 #endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_INTERNAL_H_ |
| OLD | NEW |