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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/callback_old.h" | 13 #include "base/callback_old.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/string16.h" | 15 #include "base/string16.h" |
16 #include "content/common/page_transition_types.h" | 16 #include "content/common/page_transition_types.h" |
17 #include "ipc/ipc_channel.h" | 17 #include "ipc/ipc_channel.h" |
18 | 18 |
19 class WebUIMessageHandler; | 19 class WebUIMessageHandler; |
20 class GURL; | 20 class GURL; |
21 class Profile; | |
22 class RenderViewHost; | 21 class RenderViewHost; |
23 class TabContents; | 22 class TabContents; |
24 | 23 |
25 namespace base { | 24 namespace base { |
26 class DictionaryValue; | 25 class DictionaryValue; |
27 class ListValue; | 26 class ListValue; |
28 class Value; | 27 class Value; |
29 } | 28 } |
30 | 29 |
31 // A WebUI sets up the datasources and message handlers for a given HTML-based | 30 // A WebUI sets up the datasources and message handlers for a given HTML-based |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 const base::Value& arg2, | 131 const base::Value& arg2, |
133 const base::Value& arg3); | 132 const base::Value& arg3); |
134 void CallJavascriptFunction(const std::string& function_name, | 133 void CallJavascriptFunction(const std::string& function_name, |
135 const base::Value& arg1, | 134 const base::Value& arg1, |
136 const base::Value& arg2, | 135 const base::Value& arg2, |
137 const base::Value& arg3, | 136 const base::Value& arg3, |
138 const base::Value& arg4); | 137 const base::Value& arg4); |
139 void CallJavascriptFunction(const std::string& function_name, | 138 void CallJavascriptFunction(const std::string& function_name, |
140 const std::vector<const base::Value*>& args); | 139 const std::vector<const base::Value*>& args); |
141 | 140 |
142 // May be overridden by WebUI's which do not have a tab contents. | |
143 // TODO(estade): removing this Profile dependency is predicated on reworking | |
144 // TabContents's Profile ownership. | |
145 virtual Profile* GetProfile() const; | |
146 | |
147 // May be overridden by WebUI's which do not have a tab contents. | |
148 virtual RenderViewHost* GetRenderViewHost() const; | |
149 | |
150 TabContents* tab_contents() const { return tab_contents_; } | 141 TabContents* tab_contents() const { return tab_contents_; } |
151 | 142 |
152 // Returns true to indicate that the WebUI is performing a long running | 143 // Returns true to indicate that the WebUI is performing a long running |
153 // operation and wants the tab throbber to run. | 144 // operation and wants the tab throbber to run. |
154 virtual bool IsLoading() const; | 145 virtual bool IsLoading() const; |
155 | 146 |
156 // An opaque identifier used to identify a WebUI. This can only be compared to | 147 // An opaque identifier used to identify a WebUI. This can only be compared to |
157 // kNoWebUI or other WebUI types. See GetWebUIType. | 148 // kNoWebUI or other WebUI types. See GetWebUIType. |
158 typedef void* TypeID; | 149 typedef void* TypeID; |
159 | 150 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 // Extract a string value from a list Value. | 225 // Extract a string value from a list Value. |
235 string16 ExtractStringValue(const base::ListValue* value); | 226 string16 ExtractStringValue(const base::ListValue* value); |
236 | 227 |
237 WebUI* web_ui_; | 228 WebUI* web_ui_; |
238 | 229 |
239 private: | 230 private: |
240 DISALLOW_COPY_AND_ASSIGN(WebUIMessageHandler); | 231 DISALLOW_COPY_AND_ASSIGN(WebUIMessageHandler); |
241 }; | 232 }; |
242 | 233 |
243 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_H_ | 234 #endif // CONTENT_BROWSER_WEBUI_WEB_UI_H_ |
OLD | NEW |