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 CONTENT_PUBLIC_BROWSER_WEB_UI_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_UI_H_ |
6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // to call WebUIMessageHandler::CallJavascriptFunction, as that has | 98 // to call WebUIMessageHandler::CallJavascriptFunction, as that has |
99 // lifecycle controls to prevent calling JavaScript before the page is ready. | 99 // lifecycle controls to prevent calling JavaScript before the page is ready. |
100 // | 100 // |
101 // Call a Javascript function by sending its name and arguments down to | 101 // Call a Javascript function by sending its name and arguments down to |
102 // the renderer. This is asynchronous; there's no way to get the result | 102 // the renderer. This is asynchronous; there's no way to get the result |
103 // of the call, and should be thought of more like sending a message to | 103 // of the call, and should be thought of more like sending a message to |
104 // the page. | 104 // the page. |
105 // | 105 // |
106 // All function names in WebUI must consist of only ASCII characters. | 106 // All function names in WebUI must consist of only ASCII characters. |
107 // There are variants for calls with more arguments. | 107 // There are variants for calls with more arguments. |
108 virtual void CallJavascriptFunction(const std::string& function_name) = 0; | 108 virtual void CallJavascriptFunctionUnsafe( |
109 virtual void CallJavascriptFunction(const std::string& function_name, | 109 const std::string& function_name) = 0; |
110 const base::Value& arg) = 0; | 110 virtual void CallJavascriptFunctionUnsafe(const std::string& function_name, |
111 virtual void CallJavascriptFunction(const std::string& function_name, | 111 const base::Value& arg) = 0; |
112 const base::Value& arg1, | 112 virtual void CallJavascriptFunctionUnsafe(const std::string& function_name, |
113 const base::Value& arg2) = 0; | 113 const base::Value& arg1, |
114 virtual void CallJavascriptFunction(const std::string& function_name, | 114 const base::Value& arg2) = 0; |
115 const base::Value& arg1, | 115 virtual void CallJavascriptFunctionUnsafe(const std::string& function_name, |
116 const base::Value& arg2, | 116 const base::Value& arg1, |
117 const base::Value& arg3) = 0; | 117 const base::Value& arg2, |
118 virtual void CallJavascriptFunction(const std::string& function_name, | 118 const base::Value& arg3) = 0; |
119 const base::Value& arg1, | 119 virtual void CallJavascriptFunctionUnsafe(const std::string& function_name, |
120 const base::Value& arg2, | 120 const base::Value& arg1, |
121 const base::Value& arg3, | 121 const base::Value& arg2, |
122 const base::Value& arg4) = 0; | 122 const base::Value& arg3, |
123 virtual void CallJavascriptFunction( | 123 const base::Value& arg4) = 0; |
| 124 virtual void CallJavascriptFunctionUnsafe( |
124 const std::string& function_name, | 125 const std::string& function_name, |
125 const std::vector<const base::Value*>& args) = 0; | 126 const std::vector<const base::Value*>& args) = 0; |
126 }; | 127 }; |
127 | 128 |
128 } // namespace content | 129 } // namespace content |
129 | 130 |
130 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_H_ | 131 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_H_ |
OLD | NEW |