| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 | 10 |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 // some events for our delegate. | 621 // some events for our delegate. |
| 622 WebViewImpl* webview = webframe_->GetWebViewImpl(); | 622 WebViewImpl* webview = webframe_->GetWebViewImpl(); |
| 623 WebViewDelegate* d = webview->delegate(); | 623 WebViewDelegate* d = webview->delegate(); |
| 624 if (d) | 624 if (d) |
| 625 d->DidStartLoading(webview); | 625 d->DidStartLoading(webview); |
| 626 | 626 |
| 627 WebDataSourceImpl* ds = webframe_->GetDataSourceImpl(); | 627 WebDataSourceImpl* ds = webframe_->GetDataSourceImpl(); |
| 628 DCHECK(ds) << "DataSource NULL when navigating to reference fragment"; | 628 DCHECK(ds) << "DataSource NULL when navigating to reference fragment"; |
| 629 if (ds) { | 629 if (ds) { |
| 630 GURL url = ds->request().url(); | 630 GURL url = ds->request().url(); |
| 631 GURL chain_end = ds->GetEndOfRedirectChain(); | 631 GURL chain_end; |
| 632 ds->ClearRedirectChain(); | 632 |
| 633 if (ds->HasRedirectChain()){ |
| 634 chain_end = ds->GetEndOfRedirectChain(); |
| 635 ds->ClearRedirectChain(); |
| 636 } |
| 637 |
| 633 | 638 |
| 634 // Figure out if this location change is because of a JS-initiated client | 639 // Figure out if this location change is because of a JS-initiated client |
| 635 // redirect (e.g onload/setTimeout document.location.href=). | 640 // redirect (e.g onload/setTimeout document.location.href=). |
| 636 // TODO(timsteele): (bugs 1085325, 1046841) We don't get proper redirect | 641 // TODO(timsteele): (bugs 1085325, 1046841) We don't get proper redirect |
| 637 // performed/cancelled notifications across anchor navigations, so the | 642 // performed/cancelled notifications across anchor navigations, so the |
| 638 // other redirect-tracking code in this class (see dispatch*ClientRedirect() | 643 // other redirect-tracking code in this class (see dispatch*ClientRedirect() |
| 639 // and dispatchDidStartProvisionalLoad) is insufficient to catch and | 644 // and dispatchDidStartProvisionalLoad) is insufficient to catch and |
| 640 // properly flag these transitions. Once a proper fix for this bug is | 645 // properly flag these transitions. Once a proper fix for this bug is |
| 641 // identified and applied the following block may no longer be required. | 646 // identified and applied the following block may no longer be required. |
| 642 bool was_client_redirect = | 647 bool was_client_redirect = |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1545 | 1550 |
| 1546 std::string offset_str = url.ExtractFileName(); | 1551 std::string offset_str = url.ExtractFileName(); |
| 1547 int offset; | 1552 int offset; |
| 1548 if (!StringToInt(offset_str, &offset)) | 1553 if (!StringToInt(offset_str, &offset)) |
| 1549 return; | 1554 return; |
| 1550 | 1555 |
| 1551 WebViewDelegate* d = webframe_->GetWebViewImpl()->delegate(); | 1556 WebViewDelegate* d = webframe_->GetWebViewImpl()->delegate(); |
| 1552 if (d) | 1557 if (d) |
| 1553 d->NavigateBackForwardSoon(offset); | 1558 d->NavigateBackForwardSoon(offset); |
| 1554 } | 1559 } |
| OLD | NEW |