| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_DOM_UI_HTML_DIALOG_UI_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_HTML_DIALOG_UI_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_HTML_DIALOG_UI_H_ | 6 #define CHROME_BROWSER_DOM_UI_HTML_DIALOG_UI_H_ |
| 7 | 7 |
| 8 #include <vector> |
| 9 |
| 8 #include "chrome/browser/dom_ui/dom_ui.h" | 10 #include "chrome/browser/dom_ui/dom_ui.h" |
| 9 #include "chrome/common/property_bag.h" | 11 #include "chrome/common/property_bag.h" |
| 10 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 11 | 13 |
| 12 namespace gfx { | 14 namespace gfx { |
| 13 class Size; | 15 class Size; |
| 14 } | 16 } |
| 15 | 17 |
| 16 // Implement this class to receive notifications. | 18 // Implement this class to receive notifications. |
| 17 class HtmlDialogUIDelegate { | 19 class HtmlDialogUIDelegate { |
| 18 public: | 20 public: |
| 19 // Returns true if the contents needs to be run in a modal dialog. | 21 // Returns true if the contents needs to be run in a modal dialog. |
| 20 virtual bool IsDialogModal() const = 0; | 22 virtual bool IsDialogModal() const = 0; |
| 21 | 23 |
| 22 // Returns the title of the dialog. | 24 // Returns the title of the dialog. |
| 23 virtual std::wstring GetDialogTitle() const = 0; | 25 virtual std::wstring GetDialogTitle() const = 0; |
| 24 | 26 |
| 25 // Get the HTML file path for the content to load in the dialog. | 27 // Get the HTML file path for the content to load in the dialog. |
| 26 virtual GURL GetDialogContentURL() const = 0; | 28 virtual GURL GetDialogContentURL() const = 0; |
| 27 | 29 |
| 30 // Get DOMMessageHandler objects to handle messages from the HTML/JS page. |
| 31 // The handlers are used to send and receive messages from the page while it |
| 32 // is still open. Ownership of each handler is taken over by the DOMUI |
| 33 // hosting the page. |
| 34 virtual void GetDOMMessageHandlers( |
| 35 std::vector<DOMMessageHandler*>* handlers) const = 0; |
| 36 |
| 28 // Get the size of the dialog. | 37 // Get the size of the dialog. |
| 29 virtual void GetDialogSize(gfx::Size* size) const = 0; | 38 virtual void GetDialogSize(gfx::Size* size) const = 0; |
| 30 | 39 |
| 31 // Gets the JSON string input to use when showing the dialog. | 40 // Gets the JSON string input to use when showing the dialog. |
| 32 virtual std::string GetDialogArgs() const = 0; | 41 virtual std::string GetDialogArgs() const = 0; |
| 33 | 42 |
| 34 // A callback to notify the delegate that the dialog closed. | 43 // A callback to notify the delegate that the dialog closed. |
| 35 virtual void OnDialogClosed(const std::string& json_retval) = 0; | 44 virtual void OnDialogClosed(const std::string& json_retval) = 0; |
| 36 | 45 |
| 37 protected: | 46 protected: |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // DOMUI overrides. | 82 // DOMUI overrides. |
| 74 virtual void RenderViewCreated(RenderViewHost* render_view_host); | 83 virtual void RenderViewCreated(RenderViewHost* render_view_host); |
| 75 | 84 |
| 76 // JS message handler. | 85 // JS message handler. |
| 77 void OnDialogClosed(const Value* content); | 86 void OnDialogClosed(const Value* content); |
| 78 | 87 |
| 79 DISALLOW_COPY_AND_ASSIGN(HtmlDialogUI); | 88 DISALLOW_COPY_AND_ASSIGN(HtmlDialogUI); |
| 80 }; | 89 }; |
| 81 | 90 |
| 82 #endif // CHROME_BROWSER_DOM_UI_HTML_DIALOG_UI_H_ | 91 #endif // CHROME_BROWSER_DOM_UI_HTML_DIALOG_UI_H_ |
| OLD | NEW |