OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 // not compare it against the "active entry" since the active entry can be | 152 // not compare it against the "active entry" since the active entry can be |
153 // pending and in page navigations only happen on committed pages. If there | 153 // pending and in page navigations only happen on committed pages. If there |
154 // is no last committed entry, then nothing will be in-page. | 154 // is no last committed entry, then nothing will be in-page. |
155 // | 155 // |
156 // Special note: if the URLs are the same, it does NOT automatically count as | 156 // Special note: if the URLs are the same, it does NOT automatically count as |
157 // an in-page navigation. Neither does an input URL that has no ref, even if | 157 // an in-page navigation. Neither does an input URL that has no ref, even if |
158 // the rest is the same. This may seem weird, but when we're considering | 158 // the rest is the same. This may seem weird, but when we're considering |
159 // whether a navigation happened without loading anything, the same URL could | 159 // whether a navigation happened without loading anything, the same URL could |
160 // be a reload, while only a different ref would be in-page (pages can't clear | 160 // be a reload, while only a different ref would be in-page (pages can't clear |
161 // refs without reload, only change to "#" which we don't count as empty). | 161 // refs without reload, only change to "#" which we don't count as empty). |
162 bool IsURLInPageNavigation(const GURL& url) const { | 162 // |
163 return IsURLInPageNavigation(url, false, NAVIGATION_TYPE_UNKNOWN); | |
164 } | |
165 | |
166 // The situation is made murkier by history.replaceState(), which could | 163 // The situation is made murkier by history.replaceState(), which could |
167 // provide the same URL as part of an in-page navigation, not a reload. So | 164 // provide the same URL as part of an in-page navigation, not a reload. So |
168 // we need this form which lets the (untrustworthy) renderer resolve the | 165 // we need to let the (untrustworthy) renderer resolve the ambiguity, but |
169 // ambiguity, but only when the URLs are equal. This should be safe since the | 166 // only when the URLs are on the same origin. |
170 // origin isn't changing. | |
171 bool IsURLInPageNavigation( | 167 bool IsURLInPageNavigation( |
172 const GURL& url, | 168 const GURL& url, |
173 bool renderer_says_in_page, | 169 bool renderer_says_in_page, |
174 NavigationType navigation_type) const; | 170 NavigationType navigation_type) const; |
175 | 171 |
176 // Sets the SessionStorageNamespace for the given |partition_id|. This is | 172 // Sets the SessionStorageNamespace for the given |partition_id|. This is |
177 // used during initialization of a new NavigationController to allow | 173 // used during initialization of a new NavigationController to allow |
178 // pre-population of the SessionStorageNamespace objects. Session restore, | 174 // pre-population of the SessionStorageNamespace objects. Session restore, |
179 // prerendering, and the implementaion of window.open() are the primary users | 175 // prerendering, and the implementaion of window.open() are the primary users |
180 // of this API. | 176 // of this API. |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 TimeSmoother time_smoother_; | 413 TimeSmoother time_smoother_; |
418 | 414 |
419 scoped_ptr<NavigationEntryScreenshotManager> screenshot_manager_; | 415 scoped_ptr<NavigationEntryScreenshotManager> screenshot_manager_; |
420 | 416 |
421 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); | 417 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); |
422 }; | 418 }; |
423 | 419 |
424 } // namespace content | 420 } // namespace content |
425 | 421 |
426 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ | 422 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ |
OLD | NEW |