1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 #ifndef IOS_WEB_WEB_STATE_UI_CRW_DEBUG_WEB_VIEW_H_
5 #define IOS_WEB_WEB_STATE_UI_CRW_DEBUG_WEB_VIEW_H_
7 // This class is only available in debug mode. It uses private API.
10 #import <UIKit/UIKit.h>
12 // All part of webkit API, but it is private on iOS.
14 @
class WebScriptCallFrame
;
17 @protocol CRWDebugWebView_WebViewScriptDelegate
19 // Called when a javascript statement want to write on the console.
20 - (void)webView
:(WebView
*)webView addMessageToConsole
:(NSDictionary
*)dict
;
22 // Some source was parsed, establishing a "source ID" (>= 0) for future
24 - (void)webView
:(WebView
*)webView
25 didParseSource
:(NSString
*)source
26 baseLineNumber
:(NSUInteger
)lineNumber
29 forWebFrame
:(WebFrame
*)webFrame
;
31 // Called if a loaded javascript file fail to parse.
32 - (void)webView
:(WebView
*)webView
33 failedToParseSource
:(NSString
*)source
34 baseLineNumber
:(unsigned)lineNumber
36 withError
:(NSError
*)error
37 forWebFrame
:(WebFrame
*)webFrame
;
39 // Called if an exception is raised in Javascript.
40 - (void)webView
:(WebView
*)webView
41 exceptionWasRaised
:(WebScriptCallFrame
*)frame
44 forWebFrame
:(WebFrame
*)webFrame
;
48 // Simply use like a regular UIWebView. It just logs javascript information on
50 @interface CRWDebugWebView
: UIWebView
52 // Webview delegate API, which the superclass is. Used to set the script
53 // delegate on the same webview the superclass is delegate of.
54 - (void)webView
:(id
)sender
55 didClearWindowObject
:(id
)windowObject
56 forFrame
:(WebFrame
*)frame
;
60 #endif // !defined(NDEBUG)
61 #endif // IOS_WEB_WEB_STATE_UI_CRW_DEBUG_WEB_VIEW_H_