Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ |
| 6 #define CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 // not compare it against the "active entry" since the active entry can be | 147 // not compare it against the "active entry" since the active entry can be |
| 148 // pending and in page navigations only happen on committed pages. If there | 148 // pending and in page navigations only happen on committed pages. If there |
| 149 // is no last committed entry, then nothing will be in-page. | 149 // is no last committed entry, then nothing will be in-page. |
| 150 // | 150 // |
| 151 // Special note: if the URLs are the same, it does NOT automatically count as | 151 // Special note: if the URLs are the same, it does NOT automatically count as |
| 152 // an in-page navigation. Neither does an input URL that has no ref, even if | 152 // an in-page navigation. Neither does an input URL that has no ref, even if |
| 153 // the rest is the same. This may seem weird, but when we're considering | 153 // the rest is the same. This may seem weird, but when we're considering |
| 154 // whether a navigation happened without loading anything, the same URL could | 154 // whether a navigation happened without loading anything, the same URL could |
| 155 // be a reload, while only a different ref would be in-page (pages can't clear | 155 // be a reload, while only a different ref would be in-page (pages can't clear |
| 156 // refs without reload, only change to "#" which we don't count as empty). | 156 // refs without reload, only change to "#" which we don't count as empty). |
| 157 bool IsURLInPageNavigation(const GURL& url) const { | 157 bool IsURLInPageNavigation(const GURL& url, |
| 158 return IsURLInPageNavigation(url, false); | 158 content::NavigationType navigation_type) const { |
|
Charlie Reis
2013/08/06 18:48:08
We can leave this as a one-argument function that
| |
| 159 return IsURLInPageNavigation(url, false, navigation_type); | |
| 159 } | 160 } |
| 160 | 161 |
| 161 // The situation is made murkier by history.replaceState(), which could | 162 // The situation is made murkier by history.replaceState(), which could |
| 162 // provide the same URL as part of an in-page navigation, not a reload. So | 163 // provide the same URL as part of an in-page navigation, not a reload. So |
| 163 // we need this form which lets the (untrustworthy) renderer resolve the | 164 // we need this form which lets the (untrustworthy) renderer resolve the |
| 164 // ambiguity, but only when the URLs are equal. This should be safe since the | 165 // ambiguity, but only when the URLs are equal. This should be safe since the |
| 165 // origin isn't changing. | 166 // origin isn't changing. |
| 166 bool IsURLInPageNavigation(const GURL& url, bool renderer_says_in_page) const; | 167 bool IsURLInPageNavigation(const GURL& url, bool renderer_says_in_page, |
| 168 content::NavigationType navigation_type) const; | |
|
Charlie Reis
2013/08/06 18:48:08
Style nit: if all arguments can't fit on the same
| |
| 167 | 169 |
| 168 // Sets the SessionStorageNamespace for the given |partition_id|. This is | 170 // Sets the SessionStorageNamespace for the given |partition_id|. This is |
| 169 // used during initialization of a new NavigationController to allow | 171 // used during initialization of a new NavigationController to allow |
| 170 // pre-population of the SessionStorageNamespace objects. Session restore, | 172 // pre-population of the SessionStorageNamespace objects. Session restore, |
| 171 // prerendering, and the implementaion of window.open() are the primary users | 173 // prerendering, and the implementaion of window.open() are the primary users |
| 172 // of this API. | 174 // of this API. |
| 173 // | 175 // |
| 174 // Calling this function when a SessionStorageNamespace has already been | 176 // Calling this function when a SessionStorageNamespace has already been |
| 175 // associated with a |partition_id| will CHECK() fail. | 177 // associated with a |partition_id| will CHECK() fail. |
| 176 void SetSessionStorageNamespace( | 178 void SetSessionStorageNamespace( |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 TimeSmoother time_smoother_; | 399 TimeSmoother time_smoother_; |
| 398 | 400 |
| 399 scoped_ptr<WebContentsScreenshotManager> screenshot_manager_; | 401 scoped_ptr<WebContentsScreenshotManager> screenshot_manager_; |
| 400 | 402 |
| 401 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); | 403 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); |
| 402 }; | 404 }; |
| 403 | 405 |
| 404 } // namespace content | 406 } // namespace content |
| 405 | 407 |
| 406 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ | 408 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ |
| OLD | NEW |