| 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..c2114fa03b3cce7837f5b3dcddd5937cd5fab835 100644
|
| --- a/ios/web/web_state/ui/crw_web_controller.mm
|
| +++ b/ios/web/web_state/ui/crw_web_controller.mm
|
| @@ -3162,9 +3162,14 @@ registerLoadRequestForURL:(const GURL&)requestURL
|
| #pragma mark WebUI
|
|
|
| - (void)createWebUIForURL:(const GURL&)URL {
|
| + // |CreateWebUI| will do nothing if |URL| is not a WebUI URL and then
|
| + // |HasWebUI| will return false.
|
| _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 +4123,7 @@ registerLoadRequestForURL:(const GURL&)requestURL
|
| }
|
|
|
| - (void)loadHTML:(NSString*)HTML forURL:(const GURL&)URL {
|
| + DCHECK(HTML.length);
|
| // Remove the transient content view.
|
| [self clearTransientContentView];
|
|
|
|
|