OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/web_contents/aura/overscroll_navigation_overlay.h" | 5 #include "content/browser/web_contents/aura/overscroll_navigation_overlay.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 namespace content { | 29 namespace content { |
30 namespace { | 30 namespace { |
31 | 31 |
32 // Returns true if the entry's URL or any of the URLs in entry's redirect chain | 32 // Returns true if the entry's URL or any of the URLs in entry's redirect chain |
33 // match |url|. | 33 // match |url|. |
34 bool DoesEntryMatchURL(NavigationEntry* entry, const GURL& url) { | 34 bool DoesEntryMatchURL(NavigationEntry* entry, const GURL& url) { |
35 if (!entry) | 35 if (!entry) |
36 return false; | 36 return false; |
37 if (entry->GetURL() == url) | 37 if (entry->GetURL() == url) |
38 return true; | 38 return true; |
39 const std::vector<GURL>& redirect_chain = entry->GetRedirectChain(); | 39 const std::vector<GURL>& redirect_chain = entry->GetMainFrameRedirectChain(); |
40 for (std::vector<GURL>::const_iterator it = redirect_chain.begin(); | 40 for (std::vector<GURL>::const_iterator it = redirect_chain.begin(); |
41 it != redirect_chain.end(); | 41 it != redirect_chain.end(); |
42 it++) { | 42 it++) { |
43 if (*it == url) | 43 if (*it == url) |
44 return true; | 44 return true; |
45 } | 45 } |
46 return false; | 46 return false; |
47 } | 47 } |
48 | 48 |
49 } // namespace | 49 } // namespace |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 282 |
283 void OverscrollNavigationOverlay::DidStopLoading() { | 283 void OverscrollNavigationOverlay::DidStopLoading() { |
284 // Don't compare URLs in this case - it's possible they won't match if | 284 // Don't compare URLs in this case - it's possible they won't match if |
285 // a gesture-nav initiated navigation was interrupted by some other in-site | 285 // a gesture-nav initiated navigation was interrupted by some other in-site |
286 // navigation (e.g., from a script, or from a bookmark). | 286 // navigation (e.g., from a script, or from a bookmark). |
287 loading_complete_ = true; | 287 loading_complete_ = true; |
288 StopObservingIfDone(); | 288 StopObservingIfDone(); |
289 } | 289 } |
290 | 290 |
291 } // namespace content | 291 } // namespace content |
OLD | NEW |