| 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 CONTENT_BROWSER_WEBUI_WEB_UI_H_ | 5 #ifndef CONTENT_BROWSER_WEBUI_WEB_UI_H_ |
| 6 #define CONTENT_BROWSER_WEBUI_WEB_UI_H_ | 6 #define CONTENT_BROWSER_WEBUI_WEB_UI_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 const std::vector<const Value*>& args); | 137 const std::vector<const Value*>& args); |
| 138 | 138 |
| 139 // May be overridden by WebUI's which do not have a tab contents. | 139 // May be overridden by WebUI's which do not have a tab contents. |
| 140 virtual Profile* GetProfile() const; | 140 virtual Profile* GetProfile() const; |
| 141 | 141 |
| 142 // May be overridden by WebUI's which do not have a tab contents. | 142 // May be overridden by WebUI's which do not have a tab contents. |
| 143 virtual RenderViewHost* GetRenderViewHost() const; | 143 virtual RenderViewHost* GetRenderViewHost() const; |
| 144 | 144 |
| 145 TabContents* tab_contents() const { return tab_contents_; } | 145 TabContents* tab_contents() const { return tab_contents_; } |
| 146 | 146 |
| 147 // An opaque identifier used to identify a WebUI. This can only be compared to | |
| 148 // kNoWebUI or other WebUI types. See GetWebUIType. | |
| 149 typedef void* TypeID; | |
| 150 | |
| 151 // A special WebUI type that signifies that a given page would not use the | |
| 152 // Web UI system. | |
| 153 static const TypeID kNoWebUI; | |
| 154 | |
| 155 protected: | 147 protected: |
| 156 void AddMessageHandler(WebUIMessageHandler* handler); | 148 void AddMessageHandler(WebUIMessageHandler* handler); |
| 157 | 149 |
| 158 // Execute a string of raw Javascript on the page. Overridable for | 150 // Execute a string of raw Javascript on the page. Overridable for |
| 159 // testing purposes. | 151 // testing purposes. |
| 160 virtual void ExecuteJavascript(const string16& javascript); | 152 virtual void ExecuteJavascript(const string16& javascript); |
| 161 | 153 |
| 162 // Options that may be overridden by individual Web UI implementations. The | 154 // Options that may be overridden by individual Web UI implementations. The |
| 163 // bool options default to false. See the public getters for more information. | 155 // bool options default to false. See the public getters for more information. |
| 164 bool hide_favicon_; | 156 bool hide_favicon_; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // Extract a string value from a list Value. | 208 // Extract a string value from a list Value. |
| 217 string16 ExtractStringValue(const ListValue* value); | 209 string16 ExtractStringValue(const ListValue* value); |
| 218 | 210 |
| 219 WebUI* web_ui_; | 211 WebUI* web_ui_; |
| 220 | 212 |
| 221 private: | 213 private: |
| 222 DISALLOW_COPY_AND_ASSIGN(WebUIMessageHandler); | 214 DISALLOW_COPY_AND_ASSIGN(WebUIMessageHandler); |
| 223 }; | 215 }; |
| 224 | 216 |
| 225 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_H_ | 217 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_H_ |
| OLD | NEW |