| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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> |
| 11 | 11 |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "chrome/browser/ui/webui/chrome_web_ui.h" | 13 #include "chrome/browser/ui/webui/chrome_web_ui.h" |
| 14 #include "content/common/property_bag.h" | |
| 15 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 16 | 15 |
| 16 struct ContextMenuParams; |
| 17 |
| 18 namespace base { |
| 19 class ListValue; |
| 20 template<class T> class PropertyAccessor; |
| 21 } |
| 22 |
| 17 namespace gfx { | 23 namespace gfx { |
| 18 class Size; | 24 class Size; |
| 19 } | 25 } |
| 20 | 26 |
| 21 struct ContextMenuParams; | |
| 22 | |
| 23 namespace base { | |
| 24 class ListValue; | |
| 25 } | |
| 26 | |
| 27 // Implement this class to receive notifications. | 27 // Implement this class to receive notifications. |
| 28 class HtmlDialogUIDelegate { | 28 class HtmlDialogUIDelegate { |
| 29 public: | 29 public: |
| 30 // Returns true if the contents needs to be run in a modal dialog. | 30 // Returns true if the contents needs to be run in a modal dialog. |
| 31 virtual bool IsDialogModal() const = 0; | 31 virtual bool IsDialogModal() const = 0; |
| 32 | 32 |
| 33 // Returns the title of the dialog. | 33 // Returns the title of the dialog. |
| 34 virtual string16 GetDialogTitle() const = 0; | 34 virtual string16 GetDialogTitle() const = 0; |
| 35 | 35 |
| 36 // Get the HTML file path for the content to load in the dialog. | 36 // Get the HTML file path for the content to load in the dialog. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 // When created, the property should already be set on the TabContents. | 99 // When created, the property should already be set on the TabContents. |
| 100 explicit HtmlDialogUI(TabContents* tab_contents); | 100 explicit HtmlDialogUI(TabContents* tab_contents); |
| 101 virtual ~HtmlDialogUI(); | 101 virtual ~HtmlDialogUI(); |
| 102 | 102 |
| 103 // Close the dialog, passing the specified arguments to the close handler. | 103 // Close the dialog, passing the specified arguments to the close handler. |
| 104 void CloseDialog(const base::ListValue* args); | 104 void CloseDialog(const base::ListValue* args); |
| 105 | 105 |
| 106 // Returns the PropertyBag accessor object used to write the delegate pointer | 106 // Returns the PropertyBag accessor object used to write the delegate pointer |
| 107 // into the TabContents (see class-level comment above). | 107 // into the TabContents (see class-level comment above). |
| 108 static PropertyAccessor<HtmlDialogUIDelegate*>& GetPropertyAccessor(); | 108 static base::PropertyAccessor<HtmlDialogUIDelegate*>& GetPropertyAccessor(); |
| 109 | 109 |
| 110 private: | 110 private: |
| 111 // WebUI | 111 // WebUI |
| 112 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; | 112 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; |
| 113 | 113 |
| 114 // JS message handler. | 114 // JS message handler. |
| 115 void OnDialogClosed(const base::ListValue* args); | 115 void OnDialogClosed(const base::ListValue* args); |
| 116 | 116 |
| 117 DISALLOW_COPY_AND_ASSIGN(HtmlDialogUI); | 117 DISALLOW_COPY_AND_ASSIGN(HtmlDialogUI); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 // Displays external URL contents inside a modal HTML dialog. | 120 // Displays external URL contents inside a modal HTML dialog. |
| 121 // | 121 // |
| 122 // Intended to be the place to collect the settings and lockdowns | 122 // Intended to be the place to collect the settings and lockdowns |
| 123 // necessary for running external UI conponents securely (e.g., the | 123 // necessary for running external UI conponents securely (e.g., the |
| 124 // cloud print dialog). | 124 // cloud print dialog). |
| 125 class ExternalHtmlDialogUI : public HtmlDialogUI { | 125 class ExternalHtmlDialogUI : public HtmlDialogUI { |
| 126 public: | 126 public: |
| 127 explicit ExternalHtmlDialogUI(TabContents* tab_contents); | 127 explicit ExternalHtmlDialogUI(TabContents* tab_contents); |
| 128 virtual ~ExternalHtmlDialogUI(); | 128 virtual ~ExternalHtmlDialogUI(); |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 #endif // CHROME_BROWSER_UI_WEBUI_HTML_DIALOG_UI_H_ | 131 #endif // CHROME_BROWSER_UI_WEBUI_HTML_DIALOG_UI_H_ |
| OLD | NEW |