OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ | 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ |
6 #define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ | 6 #define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // null. | 134 // null. |
135 virtual const NavigationManager* GetNavigationManager() const = 0; | 135 virtual const NavigationManager* GetNavigationManager() const = 0; |
136 virtual NavigationManager* GetNavigationManager() = 0; | 136 virtual NavigationManager* GetNavigationManager() = 0; |
137 | 137 |
138 // Gets the CRWJSInjectionReceiver associated with this WebState. | 138 // Gets the CRWJSInjectionReceiver associated with this WebState. |
139 virtual CRWJSInjectionReceiver* GetJSInjectionReceiver() const = 0; | 139 virtual CRWJSInjectionReceiver* GetJSInjectionReceiver() const = 0; |
140 | 140 |
141 // Runs JavaScript in the main frame's context. If a callback is provided, it | 141 // Runs JavaScript in the main frame's context. If a callback is provided, it |
142 // will be used to return the result, when the result is available or script | 142 // will be used to return the result, when the result is available or script |
143 // execution has failed due to an error. | 143 // execution has failed due to an error. |
144 // NOTE: Integer values will be returned as TYPE_DOUBLE because of underlying | 144 // NOTE: Integer values will be returned as Type::DOUBLE because of underlying |
145 // library limitation. | 145 // library limitation. |
146 typedef base::Callback<void(const base::Value*)> JavaScriptResultCallback; | 146 typedef base::Callback<void(const base::Value*)> JavaScriptResultCallback; |
147 virtual void ExecuteJavaScript(const base::string16& javascript) = 0; | 147 virtual void ExecuteJavaScript(const base::string16& javascript) = 0; |
148 virtual void ExecuteJavaScript(const base::string16& javascript, | 148 virtual void ExecuteJavaScript(const base::string16& javascript, |
149 const JavaScriptResultCallback& callback) = 0; | 149 const JavaScriptResultCallback& callback) = 0; |
150 | 150 |
151 // Gets the contents MIME type. | 151 // Gets the contents MIME type. |
152 virtual const std::string& GetContentsMimeType() const = 0; | 152 virtual const std::string& GetContentsMimeType() const = 0; |
153 | 153 |
154 // Gets the value of the "Content-Language" HTTP header. | 154 // Gets the value of the "Content-Language" HTTP header. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 268 |
269 // Returns a WeakPtr<WebState> to the current WebState. Must remain private | 269 // Returns a WeakPtr<WebState> to the current WebState. Must remain private |
270 // and only call must be in WebStateWeakPtrFactory. Please consult that class | 270 // and only call must be in WebStateWeakPtrFactory. Please consult that class |
271 // for more details. Remove as part of http://crbug.com/556736. | 271 // for more details. Remove as part of http://crbug.com/556736. |
272 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; | 272 virtual base::WeakPtr<WebState> AsWeakPtr() = 0; |
273 }; | 273 }; |
274 | 274 |
275 } // namespace web | 275 } // namespace web |
276 | 276 |
277 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ | 277 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_H_ |
OLD | NEW |