OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "Chrome.h" | 7 #include "Chrome.h" |
8 #include "CString.h" | 8 #include "CString.h" |
9 #include "Document.h" | 9 #include "Document.h" |
10 #include "DocumentLoader.h" | 10 #include "DocumentLoader.h" |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 // Anchor fragment navigations are not normal loads, so we need to synthesize | 488 // Anchor fragment navigations are not normal loads, so we need to synthesize |
489 // some events for our delegate. | 489 // some events for our delegate. |
490 WebViewImpl* webview = webframe_->GetWebViewImpl(); | 490 WebViewImpl* webview = webframe_->GetWebViewImpl(); |
491 if (webview->client()) | 491 if (webview->client()) |
492 webview->client()->didStartLoading(); | 492 webview->client()->didStartLoading(); |
493 | 493 |
494 WebDataSourceImpl* ds = webframe_->GetDataSourceImpl(); | 494 WebDataSourceImpl* ds = webframe_->GetDataSourceImpl(); |
495 ASSERT(ds); // Should not be null when navigating to a reference fragment! | 495 ASSERT(ds); // Should not be null when navigating to a reference fragment! |
496 if (ds) { | 496 if (ds) { |
497 KURL url = webkit_glue::WebURLToKURL(ds->request().url()); | 497 KURL url = webkit_glue::WebURLToKURL(ds->request().url()); |
498 KURL chain_end = ds->endOfRedirectChain(); | 498 KURL chain_end; |
499 ds->clearRedirectChain(); | 499 if (ds->hasRedirectChain()) { |
| 500 chain_end = ds->endOfRedirectChain(); |
| 501 ds->clearRedirectChain(); |
| 502 } |
500 | 503 |
501 // Figure out if this location change is because of a JS-initiated client | 504 // Figure out if this location change is because of a JS-initiated client |
502 // redirect (e.g onload/setTimeout document.location.href=). | 505 // redirect (e.g onload/setTimeout document.location.href=). |
503 // TODO(timsteele): (bugs 1085325, 1046841) We don't get proper redirect | 506 // TODO(timsteele): (bugs 1085325, 1046841) We don't get proper redirect |
504 // performed/cancelled notifications across anchor navigations, so the | 507 // performed/cancelled notifications across anchor navigations, so the |
505 // other redirect-tracking code in this class (see dispatch*ClientRedirect() | 508 // other redirect-tracking code in this class (see dispatch*ClientRedirect() |
506 // and dispatchDidStartProvisionalLoad) is insufficient to catch and | 509 // and dispatchDidStartProvisionalLoad) is insufficient to catch and |
507 // properly flag these transitions. Once a proper fix for this bug is | 510 // properly flag these transitions. Once a proper fix for this bug is |
508 // identified and applied the following block may no longer be required. | 511 // identified and applied the following block may no longer be required. |
509 bool was_client_redirect = | 512 bool was_client_redirect = |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 WebViewImpl* webview = webframe_->GetWebViewImpl(); | 1330 WebViewImpl* webview = webframe_->GetWebViewImpl(); |
1328 if (webview->client()) | 1331 if (webview->client()) |
1329 webview->client()->navigateBackForwardSoon(offset); | 1332 webview->client()->navigateBackForwardSoon(offset); |
1330 } | 1333 } |
1331 | 1334 |
1332 PassOwnPtr<WebPluginLoadObserver> WebFrameLoaderClient::GetPluginLoadObserver()
{ | 1335 PassOwnPtr<WebPluginLoadObserver> WebFrameLoaderClient::GetPluginLoadObserver()
{ |
1333 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader( | 1336 WebDataSourceImpl* ds = WebDataSourceImpl::fromDocumentLoader( |
1334 webframe_->frame()->loader()->activeDocumentLoader()); | 1337 webframe_->frame()->loader()->activeDocumentLoader()); |
1335 return ds->releasePluginLoadObserver(); | 1338 return ds->releasePluginLoadObserver(); |
1336 } | 1339 } |
OLD | NEW |