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

Unified Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2646003002: [ios] Remove the openJavascript method from Tab. (Closed)
Patch Set: Review. Created 3 years, 11 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/chrome/browser/tabs/tab.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/browser_view_controller.mm
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index 2cc3d7b1a3e1efc3f37c274ad7b10aeb8ddccbf7..a9510f7d42cde6c73ca7e89c9500ccc719ec5746 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -3798,7 +3798,12 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
}
- (void)openJavascript:(NSString*)javascript {
- [[_model currentTab] openJavascript:javascript];
+ DCHECK(javascript);
+ javascript = [javascript stringByRemovingPercentEncoding];
+ web::WebState* webState = [[_model currentTab] webState];
+ if (webState) {
+ webState->ExecuteJavaScript(base::SysNSStringToUTF16(javascript));
+ }
}
#pragma mark - WebToolbarDelegate methods
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698