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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2888773003: Do not create CRWWebUIManager for non-WebUI URLs. (Closed)
Patch Set: Fixed tests; Updated comments; Created 3 years, 7 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/autofill/form_suggestion_controller_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index 8b17115ffff239e137ea52f7dc8c6d7228fe2a37..ad8548576fb6c009b2401a09d2474874e85e80de 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -3162,9 +3162,13 @@ registerLoadRequestForURL:(const GURL&)requestURL
#pragma mark WebUI
- (void)createWebUIForURL:(const GURL&)URL {
+ // |CreateWebUI| will do nothing if |URL| is not a WebUI URL.
michaeldo 2017/05/17 15:17:31 Can you add to this something like "but must be ca
Eugene But (OOO till 7-30) 2017/05/17 18:36:41 Updated comment.
_webStateImpl->CreateWebUI(URL);
- _webUIManager.reset(
- [[CRWWebUIManager alloc] initWithWebState:self.webStateImpl]);
+ bool isWebUIURL = _webStateImpl->HasWebUI();
+ if (isWebUIURL) {
+ _webUIManager.reset(
+ [[CRWWebUIManager alloc] initWithWebState:_webStateImpl]);
+ }
}
- (void)clearWebUI {
@@ -4118,6 +4122,7 @@ registerLoadRequestForURL:(const GURL&)requestURL
}
- (void)loadHTML:(NSString*)HTML forURL:(const GURL&)URL {
+ DCHECK(HTML.length);
michaeldo 2017/05/17 15:17:31 Should we add a note to the comment for this metho
Eugene But (OOO till 7-30) 2017/05/17 18:36:41 Done.
// Remove the transient content view.
[self clearTransientContentView];
« no previous file with comments | « ios/chrome/browser/autofill/form_suggestion_controller_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698