Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #import "ios/web/web_state/ui/crw_web_controller.h" | 5 #import "ios/web/web_state/ui/crw_web_controller.h" |
| 6 | 6 |
| 7 #import <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
| 8 | 8 |
| 9 #import <objc/runtime.h> | 9 #import <objc/runtime.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 2344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2355 // The page should be closed if it was initiated by the DOM and there has been | 2355 // The page should be closed if it was initiated by the DOM and there has been |
| 2356 // no user interaction with the page since the web view was created, or if | 2356 // no user interaction with the page since the web view was created, or if |
| 2357 // the page has no navigation items, as occurs when an App Store link is | 2357 // the page has no navigation items, as occurs when an App Store link is |
| 2358 // opened from another application. | 2358 // opened from another application. |
| 2359 BOOL rendererInitiatedWithoutInteraction = | 2359 BOOL rendererInitiatedWithoutInteraction = |
| 2360 self.sessionController.openedByDOM && !_userInteractedWithWebController; | 2360 self.sessionController.openedByDOM && !_userInteractedWithWebController; |
| 2361 BOOL noNavigationItems = !(self.navigationManagerImpl->GetItemCount()); | 2361 BOOL noNavigationItems = !(self.navigationManagerImpl->GetItemCount()); |
| 2362 return rendererInitiatedWithoutInteraction || noNavigationItems; | 2362 return rendererInitiatedWithoutInteraction || noNavigationItems; |
| 2363 } | 2363 } |
| 2364 | 2364 |
| 2365 - (BOOL)useDesktopUserAgent { | 2365 - (BOOL)useDesktopUserAgent { |
|
kkhorimoto
2017/02/22 01:08:40
This property is only used once in |-webViewWithCo
liaoyuke
2017/02/22 01:37:43
Done.
| |
| 2366 web::NavigationItem* item = [self currentNavItem]; | 2366 return [self navigationManagerImpl]->GetUseDesktopUserAgent(); |
| 2367 return item && item->IsOverridingUserAgent(); | |
| 2368 } | 2367 } |
| 2369 | 2368 |
| 2370 - (web::MojoFacade*)mojoFacade { | 2369 - (web::MojoFacade*)mojoFacade { |
| 2371 if (!_mojoFacade) { | 2370 if (!_mojoFacade) { |
| 2372 service_manager::mojom::InterfaceProvider* interfaceProvider = | 2371 service_manager::mojom::InterfaceProvider* interfaceProvider = |
| 2373 _webStateImpl->GetMojoInterfaceRegistry(); | 2372 _webStateImpl->GetMojoInterfaceRegistry(); |
| 2374 _mojoFacade.reset(new web::MojoFacade(interfaceProvider, self)); | 2373 _mojoFacade.reset(new web::MojoFacade(interfaceProvider, self)); |
| 2375 } | 2374 } |
| 2376 return _mojoFacade.get(); | 2375 return _mojoFacade.get(); |
| 2377 } | 2376 } |
| (...skipping 2940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5318 - (void)simulateLoadRequestWithURL:(const GURL&)URL { | 5317 - (void)simulateLoadRequestWithURL:(const GURL&)URL { |
| 5319 _lastRegisteredRequestURL = URL; | 5318 _lastRegisteredRequestURL = URL; |
| 5320 _loadPhase = web::LOAD_REQUESTED; | 5319 _loadPhase = web::LOAD_REQUESTED; |
| 5321 } | 5320 } |
| 5322 | 5321 |
| 5323 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { | 5322 - (NSString*)refererFromNavigationAction:(WKNavigationAction*)action { |
| 5324 return [action.request valueForHTTPHeaderField:@"Referer"]; | 5323 return [action.request valueForHTTPHeaderField:@"Referer"]; |
| 5325 } | 5324 } |
| 5326 | 5325 |
| 5327 @end | 5326 @end |
| OLD | NEW |