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

Side by Side Diff: ios/chrome/browser/ui/static_content/static_html_view_controller.mm

Issue 2734843004: Use targetFrame to decide whether to allow load in static html view. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #include "ios/chrome/browser/ui/static_content/static_html_view_controller.h" 5 #include "ios/chrome/browser/ui/static_content/static_html_view_controller.h"
6 6
7 #import <WebKit/WebKit.h> 7 #import <WebKit/WebKit.h>
8 8
9 #include <stdlib.h> 9 #include <stdlib.h>
10 10
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 #pragma mark - 200 #pragma mark -
201 #pragma mark WKNavigationDelegate implementation 201 #pragma mark WKNavigationDelegate implementation
202 202
203 - (void)webView:(WKWebView*)webView 203 - (void)webView:(WKWebView*)webView
204 decidePolicyForNavigationAction:(WKNavigationAction*)navigationAction 204 decidePolicyForNavigationAction:(WKNavigationAction*)navigationAction
205 decisionHandler: 205 decisionHandler:
206 (void (^)(WKNavigationActionPolicy))decisionHandler { 206 (void (^)(WKNavigationActionPolicy))decisionHandler {
207 decisionHandler( 207 decisionHandler(
208 [self 208 [self
209 shouldStartLoadWithRequest:navigationAction.request 209 shouldStartLoadWithRequest:navigationAction.request
210 fromMainFrame:[navigationAction.sourceFrame isMainFrame]] 210 fromMainFrame:[navigationAction.targetFrame isMainFrame]]
211 ? WKNavigationActionPolicyAllow 211 ? WKNavigationActionPolicyAllow
212 : WKNavigationActionPolicyCancel); 212 : WKNavigationActionPolicyCancel);
213 } 213 }
214 214
215 #pragma mark - 215 #pragma mark -
216 #pragma mark CRWContextMenuDelegate implementation 216 #pragma mark CRWContextMenuDelegate implementation
217 217
218 - (BOOL)webView:(WKWebView*)webView 218 - (BOOL)webView:(WKWebView*)webView
219 handleContextMenu:(const web::ContextMenuParams&)params { 219 handleContextMenu:(const web::ContextMenuParams&)params {
220 if ([delegate_ 220 if ([delegate_
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 allowingReadAccessToURL:resourcesRootDirectory_]; 310 allowingReadAccessToURL:resourcesRootDirectory_];
311 } else { 311 } else {
312 NSURL* resourceURL = [self resourceURL]; 312 NSURL* resourceURL = [self resourceURL];
313 [generator_ generateHtml:^(NSString* HTML) { 313 [generator_ generateHtml:^(NSString* HTML) {
314 [webView loadHTMLString:HTML baseURL:resourceURL]; 314 [webView loadHTMLString:HTML baseURL:resourceURL];
315 }]; 315 }];
316 } 316 }
317 } 317 }
318 318
319 @end 319 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698