Chromium Code Reviews| 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 // Retuens the dialog's name identifier. Used to identify this dialog for | |
|
sky
2012/03/01 17:01:57
nit: retuens -> returns
yoshiki
2012/03/02 06:51:10
Done.
| |
| 45 // state restoration. | |
| 46 virtual std::string GetDialogName() const; | |
| 47 | |
| 44 // Get the HTML file path for the content to load in the dialog. | 48 // Get the HTML file path for the content to load in the dialog. |
| 45 virtual GURL GetDialogContentURL() const = 0; | 49 virtual GURL GetDialogContentURL() const = 0; |
| 46 | 50 |
| 47 // Get WebUIMessageHandler objects to handle messages from the HTML/JS page. | 51 // Get WebUIMessageHandler objects to handle messages from the HTML/JS page. |
| 48 // The handlers are used to send and receive messages from the page while it | 52 // The handlers are used to send and receive messages from the page while it |
| 49 // is still open. Ownership of each handler is taken over by the WebUI | 53 // is still open. Ownership of each handler is taken over by the WebUI |
| 50 // hosting the page. | 54 // hosting the page. |
| 51 virtual void GetWebUIMessageHandlers( | 55 virtual void GetWebUIMessageHandlers( |
| 52 std::vector<content::WebUIMessageHandler*>* handlers) const = 0; | 56 std::vector<content::WebUIMessageHandler*>* handlers) const = 0; |
| 53 | 57 |
| 54 // Get the size of the dialog. | 58 // Get the size of the dialog. |
| 55 virtual void GetDialogSize(gfx::Size* size) const = 0; | 59 virtual void GetDialogSize(gfx::Size* size) const = 0; |
| 56 | 60 |
| 61 // Get the size of the dialog. | |
| 62 virtual void GetMinimumDialogSize(gfx::Size* size) const; | |
| 63 | |
| 57 // Gets the JSON string input to use when showing the dialog. | 64 // Gets the JSON string input to use when showing the dialog. |
| 58 virtual std::string GetDialogArgs() const = 0; | 65 virtual std::string GetDialogArgs() const = 0; |
| 59 | 66 |
| 60 // A callback to notify the delegate that |source|'s loading state has | 67 // A callback to notify the delegate that |source|'s loading state has |
| 61 // changed. | 68 // changed. |
| 62 virtual void OnLoadingStateChanged(content::WebContents* source) {} | 69 virtual void OnLoadingStateChanged(content::WebContents* source) {} |
| 63 | 70 |
| 64 // A callback to notify the delegate that the dialog closed. | 71 // A callback to notify the delegate that the dialog closed. |
| 65 // IMPORTANT: Implementations should delete |this| here (unless they've | 72 // IMPORTANT: Implementations should delete |this| here (unless they've |
| 66 // arranged for the delegate to be deleted in some other way, e.g. by | 73 // arranged for the delegate to be deleted in some other way, e.g. by |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 // Intended to be the place to collect the settings and lockdowns | 165 // Intended to be the place to collect the settings and lockdowns |
| 159 // necessary for running external UI components securely (e.g., the | 166 // necessary for running external UI components securely (e.g., the |
| 160 // cloud print dialog). | 167 // cloud print dialog). |
| 161 class ExternalHtmlDialogUI : public HtmlDialogUI { | 168 class ExternalHtmlDialogUI : public HtmlDialogUI { |
| 162 public: | 169 public: |
| 163 explicit ExternalHtmlDialogUI(content::WebUI* web_ui); | 170 explicit ExternalHtmlDialogUI(content::WebUI* web_ui); |
| 164 virtual ~ExternalHtmlDialogUI(); | 171 virtual ~ExternalHtmlDialogUI(); |
| 165 }; | 172 }; |
| 166 | 173 |
| 167 #endif // CHROME_BROWSER_UI_WEBUI_HTML_DIALOG_UI_H_ | 174 #endif // CHROME_BROWSER_UI_WEBUI_HTML_DIALOG_UI_H_ |
| OLD | NEW |