Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: ios/web/web_state/ui/crw_debug_web_view.h

Issue 1048613002: Upstream ios/web/web_state/ui support classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clang format Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/web_state/ui/crw_context_menu_provider.mm ('k') | ios/web/web_state/ui/crw_debug_web_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..872d18fe903c24c848c591cce8518af040046748
--- /dev/null
+++ b/ios/web/web_state/ui/crw_debug_web_view.h
@@ -0,0 +1,61 @@
+// 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
+ 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
+ forFrame:(WebFrame*)frame;
+
+@end
+
+#endif // !defined(NDEBUG)
+#endif // IOS_WEB_WEB_STATE_UI_CRW_DEBUG_WEB_VIEW_H_
« no previous file with comments | « ios/web/web_state/ui/crw_context_menu_provider.mm ('k') | ios/web/web_state/ui/crw_debug_web_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698