Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/webui/crw_web_ui_manager.h" | 5 #import "ios/web/webui/crw_web_ui_manager.h" |
| 6 | 6 |
| 7 #include "base/mac/bind_objc_block.h" | 7 #include "base/mac/bind_objc_block.h" |
| 8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #import "base/strings/sys_string_conversions.h" | 10 #import "base/strings/sys_string_conversions.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 - (void)dealloc { | 81 - (void)dealloc { |
| 82 [self resetWebState]; | 82 [self resetWebState]; |
| 83 [super dealloc]; | 83 [super dealloc]; |
| 84 } | 84 } |
| 85 | 85 |
| 86 #pragma mark - CRWWebStateObserver Methods | 86 #pragma mark - CRWWebStateObserver Methods |
| 87 | 87 |
| 88 - (void)webState:(web::WebState*)webState | 88 - (void)webState:(web::WebState*)webState |
| 89 didStartProvisionalNavigationForURL:(const GURL&)URL { | 89 didStartProvisionalNavigationForURL:(const GURL&)URL { |
| 90 DCHECK(webState == _webState); | 90 DCHECK(webState == _webState); |
| 91 // If URL is not an application specific URL, ignore the navigation. | |
|
Eugene But (OOO till 7-30)
2015/11/23 17:31:42
Do we have other app-specific URLs which are not W
| |
| 92 if (!web::GetWebClient()->IsAppSpecificURL(URL)) | |
| 93 return; | |
| 94 | |
| 91 GURL navigationURL(URL); | 95 GURL navigationURL(URL); |
| 92 // Add request group ID to the URL, if not present. Request group ID may | 96 // Add request group ID to the URL, if not present. Request group ID may |
| 93 // already be added if restoring state to a WebUI page. | 97 // already be added if restoring state to a WebUI page. |
| 94 GURL requestURL = | 98 GURL requestURL = |
| 95 web::ExtractRequestGroupIDFromURL(net::NSURLWithGURL(URL)) | 99 web::ExtractRequestGroupIDFromURL(net::NSURLWithGURL(URL)) |
| 96 ? URL | 100 ? URL |
| 97 : net::GURLWithNSURL(web::AddRequestGroupIDToURL( | 101 : net::GURLWithNSURL(web::AddRequestGroupIDToURL( |
| 98 net::NSURLWithGURL(URL), _webState->GetRequestGroupID())); | 102 net::NSURLWithGURL(URL), _webState->GetRequestGroupID())); |
| 99 base::WeakNSObject<CRWWebUIManager> weakSelf(self); | 103 base::WeakNSObject<CRWWebUIManager> weakSelf(self); |
| 100 [self loadWebUIPageForURL:requestURL | 104 [self loadWebUIPageForURL:requestURL |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 | 208 |
| 205 - (scoped_ptr<web::URLFetcherBlockAdapter>) | 209 - (scoped_ptr<web::URLFetcherBlockAdapter>) |
| 206 fetcherForURL:(const GURL&)URL | 210 fetcherForURL:(const GURL&)URL |
| 207 completionHandler:(web::URLFetcherBlockAdapterCompletion)handler { | 211 completionHandler:(web::URLFetcherBlockAdapterCompletion)handler { |
| 208 return scoped_ptr<web::URLFetcherBlockAdapter>( | 212 return scoped_ptr<web::URLFetcherBlockAdapter>( |
| 209 new web::URLFetcherBlockAdapter( | 213 new web::URLFetcherBlockAdapter( |
| 210 URL, _webState->GetBrowserState()->GetRequestContext(), handler)); | 214 URL, _webState->GetBrowserState()->GetRequestContext(), handler)); |
| 211 } | 215 } |
| 212 | 216 |
| 213 @end | 217 @end |
| OLD | NEW |