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

Side by Side Diff: ios/web/interstitials/html_web_interstitial_impl.mm

Issue 1799843002: Removing StaticFileWebView vending methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GetBS() Created 4 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 | ios/web/net/crw_url_verifying_protocol_handler.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #import "ios/web/interstitials/html_web_interstitial_impl.h" 5 #import "ios/web/interstitials/html_web_interstitial_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 CRWContentView* HtmlWebInterstitialImpl::GetContentView() const { 92 CRWContentView* HtmlWebInterstitialImpl::GetContentView() const {
93 return content_view_.get(); 93 return content_view_.get();
94 } 94 }
95 95
96 void HtmlWebInterstitialImpl::PrepareForDisplay() { 96 void HtmlWebInterstitialImpl::PrepareForDisplay() {
97 if (!content_view_) { 97 if (!content_view_) {
98 web_view_controller_delegate_.reset( 98 web_view_controller_delegate_.reset(
99 [[CRWWebInterstitialImplCRWSimpleWebViewDelegate alloc] 99 [[CRWWebInterstitialImplCRWSimpleWebViewDelegate alloc]
100 initWithInterstitial:this]); 100 initWithInterstitial:this]);
101 web_view_controller_.reset(web::CreateSimpleWebViewController( 101 web_view_controller_.reset(web::CreateSimpleWebViewController(
102 CGRectZero, GetWebStateImpl()->GetBrowserState(), 102 CGRectZero, GetWebStateImpl()->GetBrowserState()));
103 GetWebStateImpl()->GetWebViewType()));
104 [web_view_controller_ setDelegate:web_view_controller_delegate_]; 103 [web_view_controller_ setDelegate:web_view_controller_delegate_];
105 [[web_view_controller_ view] 104 [[web_view_controller_ view]
106 setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | 105 setAutoresizingMask:(UIViewAutoresizingFlexibleWidth |
107 UIViewAutoresizingFlexibleHeight)]; 106 UIViewAutoresizingFlexibleHeight)];
108 NSString* html = base::SysUTF8ToNSString(delegate_->GetHtmlContents()); 107 NSString* html = base::SysUTF8ToNSString(delegate_->GetHtmlContents());
109 [web_view_controller_ loadHTMLString:html 108 [web_view_controller_ loadHTMLString:html
110 baseURL:net::NSURLWithGURL(GetUrl())]; 109 baseURL:net::NSURLWithGURL(GetUrl())];
111 content_view_.reset([[CRWWebViewContentView alloc] 110 content_view_.reset([[CRWWebViewContentView alloc]
112 initWithWebView:[web_view_controller_ view] 111 initWithWebView:[web_view_controller_ view]
113 scrollView:[web_view_controller_ scrollView]]); 112 scrollView:[web_view_controller_ scrollView]]);
114 } 113 }
115 } 114 }
116 115
117 WebInterstitialDelegate* HtmlWebInterstitialImpl::GetDelegate() const { 116 WebInterstitialDelegate* HtmlWebInterstitialImpl::GetDelegate() const {
118 return delegate_.get(); 117 return delegate_.get();
119 } 118 }
120 119
121 void HtmlWebInterstitialImpl::EvaluateJavaScript( 120 void HtmlWebInterstitialImpl::EvaluateJavaScript(
122 NSString* script, 121 NSString* script,
123 JavaScriptCompletion completionHandler) { 122 JavaScriptCompletion completionHandler) {
124 [web_view_controller_ evaluateJavaScript:script 123 [web_view_controller_ evaluateJavaScript:script
125 stringResultHandler:completionHandler]; 124 stringResultHandler:completionHandler];
126 } 125 }
127 126
128 } // namespace web 127 } // namespace web
OLDNEW
« no previous file with comments | « no previous file | ios/web/net/crw_url_verifying_protocol_handler.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698