| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/contextual_search/contextual_search_results_view
.h" | 5 #include "ios/chrome/browser/ui/contextual_search/contextual_search_results_view
.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #import "base/ios/weak_nsobject.h" | 9 #import "base/ios/weak_nsobject.h" |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 #pragma mark - CRWNativeContentProvider methods | 327 #pragma mark - CRWNativeContentProvider methods |
| 328 | 328 |
| 329 // Native pages should never be loaded this way. | 329 // Native pages should never be loaded this way. |
| 330 - (BOOL)hasControllerForURL:(const GURL&)url { | 330 - (BOOL)hasControllerForURL:(const GURL&)url { |
| 331 NOTREACHED(); | 331 NOTREACHED(); |
| 332 [self cancelLoad]; | 332 [self cancelLoad]; |
| 333 return NO; | 333 return NO; |
| 334 } | 334 } |
| 335 | 335 |
| 336 // Native pages should never be loaded this way. | 336 // Native pages should never be loaded this way. |
| 337 - (id<CRWNativeContent>)controllerForURL:(const GURL&)url { | 337 - (id<CRWNativeContent>)controllerForURL:(const GURL&)url |
| 338 webState:(web::WebState*)webState { |
| 338 NOTREACHED(); | 339 NOTREACHED(); |
| 339 [self cancelLoad]; | 340 [self cancelLoad]; |
| 340 return nil; | 341 return nil; |
| 341 } | 342 } |
| 342 | 343 |
| 343 - (id<CRWNativeContent>)controllerForURL:(const GURL&)url | 344 - (id<CRWNativeContent>)controllerForURL:(const GURL&)url |
| 344 withError:(NSError*)error | 345 withError:(NSError*)error |
| 345 isPost:(BOOL)isPost { | 346 isPost:(BOOL)isPost { |
| 346 // Display the error page in the contextual search tab. | 347 // Display the error page in the contextual search tab. |
| 347 _loadingError = YES; | 348 _loadingError = YES; |
| 348 [self displayTab]; | 349 [self displayTab]; |
| 349 | 350 |
| 350 [[_webViewProxy scrollViewProxy] setScrollEnabled:NO]; | 351 [[_webViewProxy scrollViewProxy] setScrollEnabled:NO]; |
| 351 id errorController = | 352 id errorController = |
| 352 [self.opener.webController.nativeProvider controllerForURL:url | 353 [self.opener.webController.nativeProvider controllerForURL:url |
| 353 withError:error | 354 withError:error |
| 354 isPost:isPost]; | 355 isPost:isPost]; |
| 355 | 356 |
| 356 if ([errorController respondsToSelector:@selector(setScrollEnabled:)]) { | 357 if ([errorController respondsToSelector:@selector(setScrollEnabled:)]) { |
| 357 [errorController setScrollEnabled:NO]; | 358 [errorController setScrollEnabled:NO]; |
| 358 } | 359 } |
| 359 return errorController; | 360 return errorController; |
| 360 } | 361 } |
| 361 | 362 |
| 362 @end | 363 @end |
| OLD | NEW |