| 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_UI_WEBUI_HTML_DIALOG_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_HTML_DIALOG_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_HTML_DIALOG_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_HTML_DIALOG_UI_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // Implement this class to receive notifications. | 35 // Implement this class to receive notifications. |
| 36 class HtmlDialogUIDelegate { | 36 class HtmlDialogUIDelegate { |
| 37 public: | 37 public: |
| 38 // Returns true if the contents needs to be run in a modal dialog. | 38 // Returns true if the contents needs to be run in a modal dialog. |
| 39 virtual ui::ModalType GetDialogModalType() const = 0; | 39 virtual ui::ModalType GetDialogModalType() const = 0; |
| 40 | 40 |
| 41 // Returns the title of the dialog. | 41 // Returns the title of the dialog. |
| 42 virtual string16 GetDialogTitle() const = 0; | 42 virtual string16 GetDialogTitle() const = 0; |
| 43 | 43 |
| 44 // Returns the dialog's name identifier. Used to identify this dialog for | |
| 45 // state restoration. | |
| 46 virtual std::string GetDialogName() const; | |
| 47 | |
| 48 // Get the HTML file path for the content to load in the dialog. | 44 // Get the HTML file path for the content to load in the dialog. |
| 49 virtual GURL GetDialogContentURL() const = 0; | 45 virtual GURL GetDialogContentURL() const = 0; |
| 50 | 46 |
| 51 // Get WebUIMessageHandler objects to handle messages from the HTML/JS page. | 47 // Get WebUIMessageHandler objects to handle messages from the HTML/JS page. |
| 52 // The handlers are used to send and receive messages from the page while it | 48 // The handlers are used to send and receive messages from the page while it |
| 53 // is still open. Ownership of each handler is taken over by the WebUI | 49 // is still open. Ownership of each handler is taken over by the WebUI |
| 54 // hosting the page. | 50 // hosting the page. |
| 55 virtual void GetWebUIMessageHandlers( | 51 virtual void GetWebUIMessageHandlers( |
| 56 std::vector<content::WebUIMessageHandler*>* handlers) const = 0; | 52 std::vector<content::WebUIMessageHandler*>* handlers) const = 0; |
| 57 | 53 |
| 58 // Get the size of the dialog. | 54 // Get the size of the dialog. |
| 59 virtual void GetDialogSize(gfx::Size* size) const = 0; | 55 virtual void GetDialogSize(gfx::Size* size) const = 0; |
| 60 | 56 |
| 61 // Get the size of the dialog. | |
| 62 virtual void GetMinimumDialogSize(gfx::Size* size) const; | |
| 63 | |
| 64 // Gets the JSON string input to use when showing the dialog. | 57 // Gets the JSON string input to use when showing the dialog. |
| 65 virtual std::string GetDialogArgs() const = 0; | 58 virtual std::string GetDialogArgs() const = 0; |
| 66 | 59 |
| 67 // A callback to notify the delegate that |source|'s loading state has | 60 // A callback to notify the delegate that |source|'s loading state has |
| 68 // changed. | 61 // changed. |
| 69 virtual void OnLoadingStateChanged(content::WebContents* source) {} | 62 virtual void OnLoadingStateChanged(content::WebContents* source) {} |
| 70 | 63 |
| 71 // A callback to notify the delegate that the dialog closed. | 64 // A callback to notify the delegate that the dialog closed. |
| 72 // IMPORTANT: Implementations should delete |this| here (unless they've | 65 // IMPORTANT: Implementations should delete |this| here (unless they've |
| 73 // arranged for the delegate to be deleted in some other way, e.g. by | 66 // arranged for the delegate to be deleted in some other way, e.g. by |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // Intended to be the place to collect the settings and lockdowns | 159 // Intended to be the place to collect the settings and lockdowns |
| 167 // necessary for running external UI components securely (e.g., the | 160 // necessary for running external UI components securely (e.g., the |
| 168 // cloud print dialog). | 161 // cloud print dialog). |
| 169 class ExternalHtmlDialogUI : public HtmlDialogUI { | 162 class ExternalHtmlDialogUI : public HtmlDialogUI { |
| 170 public: | 163 public: |
| 171 explicit ExternalHtmlDialogUI(content::WebUI* web_ui); | 164 explicit ExternalHtmlDialogUI(content::WebUI* web_ui); |
| 172 virtual ~ExternalHtmlDialogUI(); | 165 virtual ~ExternalHtmlDialogUI(); |
| 173 }; | 166 }; |
| 174 | 167 |
| 175 #endif // CHROME_BROWSER_UI_WEBUI_HTML_DIALOG_UI_H_ | 168 #endif // CHROME_BROWSER_UI_WEBUI_HTML_DIALOG_UI_H_ |
| OLD | NEW |