Chromium Code Reviews| Index: ios/web/web_state/ui/crw_debug_web_view.h |
| diff --git a/ios/web/web_state/ui/crw_debug_web_view.h b/ios/web/web_state/ui/crw_debug_web_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..48a174300191d08992e6572c93fe594e67a50795 |
| --- /dev/null |
| +++ b/ios/web/web_state/ui/crw_debug_web_view.h |
| @@ -0,0 +1,59 @@ |
| +// Copyright 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| +#ifndef IOS_WEB_WEB_STATE_UI_CRW_DEBUG_WEB_VIEW_H_ |
| +#define IOS_WEB_WEB_STATE_UI_CRW_DEBUG_WEB_VIEW_H_ |
| + |
| +// This class is only available in debug mode. It uses private API. |
| +#if !defined(NDEBUG) |
| + |
| +#import <UIKit/UIKit.h> |
| + |
| +// All part of webkit API, but it is private on iOS. |
| +@class WebFrame; |
| +@class WebScriptCallFrame; |
| +@class WebView; |
| + |
| +@protocol CRWDebugWebView_WebViewScriptDelegate |
| +@optional |
| +// Called when a javascript statement want to write on the console. |
| +- (void)webView:(WebView*)webView addMessageToConsole:(NSDictionary*)dict; |
| + |
| +// Some source was parsed, establishing a "source ID" (>= 0) for future |
| +// reference |
| +- (void)webView:(WebView *)webView didParseSource:(NSString*)source |
|
Eugene But (OOO till 7-30)
2015/03/30 05:03:58
NIT: No space before *
stuartmorgan
2015/03/30 14:17:57
Done. Also fixed the missing break before didParse
|
| + baseLineNumber:(NSUInteger)lineNumber |
| + fromURL:(NSURL*)url |
| + sourceId:(int)sid |
| + forWebFrame:(WebFrame*)webFrame; |
| + |
| +// Called if a loaded javascript file fail to parse. |
| +- (void)webView:(WebView*)webView |
| + failedToParseSource:(NSString*)source |
| + baseLineNumber:(unsigned)lineNumber |
| + fromURL:(NSURL*)url |
| + withError:(NSError*)error |
| + forWebFrame:(WebFrame*)webFrame; |
| + |
| +// Called if an exception is raised in Javascript. |
| +- (void)webView:(WebView*)webView |
| + exceptionWasRaised:(WebScriptCallFrame*)frame |
| + sourceId:(int)sid |
| + line:(int)lineno |
| + forWebFrame:(WebFrame*)webFrame; |
| + |
| +@end |
| + |
| +// Simply use like a regular UIWebView. It just logs javascript information on |
| +// the console. |
| +@interface CRWDebugWebView : UIWebView |
| + |
| +// Webview delegate API, which the superclass is. Used to set the script |
| +// delegate on the same webview the superclass is delegate of. |
| +- (void)webView:(id)sender didClearWindowObject:(id)windowObject |
|
Eugene But (OOO till 7-30)
2015/03/30 05:03:58
Optional NIT: align :
stuartmorgan
2015/03/30 14:17:57
Done, and also fixed the missing break.
|
| + forFrame:(WebFrame*)frame; |
| + |
| +@end |
| + |
| +#endif // !defined(NDEBUG) |
| +#endif // IOS_WEB_WEB_STATE_UI_CRW_DEBUG_WEB_VIEW_H_ |