Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: content/browser/web_contents/navigation_controller_impl.h

Issue 10871090: history.replaceState(..., location.href) clearing page-action icons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "build/build_config.h" 8 #include "build/build_config.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // Notifies us that we just became active. This is used by the WebContentsImpl 149 // Notifies us that we just became active. This is used by the WebContentsImpl
150 // so that we know to load URLs that were pending as "lazy" loads. 150 // so that we know to load URLs that were pending as "lazy" loads.
151 void SetActive(bool is_active); 151 void SetActive(bool is_active);
152 152
153 // Returns true if the given URL would be an in-page navigation (i.e. only 153 // Returns true if the given URL would be an in-page navigation (i.e. only
154 // the reference fragment is different) from the "last committed entry". We do 154 // the reference fragment is different) from the "last committed entry". We do
155 // not compare it against the "active entry" since the active entry can be 155 // not compare it against the "active entry" since the active entry can be
156 // pending and in page navigations only happen on committed pages. If there 156 // pending and in page navigations only happen on committed pages. If there
157 // is no last committed entry, then nothing will be in-page. 157 // is no last committed entry, then nothing will be in-page.
158 // 158 //
159 // Special note: if the URLs are the same, it does NOT count as an in-page 159 // Special note: if the URLs are the same, it does NOT automatically count as
160 // navigation. Neither does an input URL that has no ref, even if the rest is 160 // an in-page navigation. Neither does an input URL that has no ref, even if
161 // the same. This may seem weird, but when we're considering whether a 161 // the rest is the same. This may seem weird, but when we're considering
162 // navigation happened without loading anything, the same URL would be a 162 // whether a navigation happened without loading anything, the same URL could
163 // reload, while only a different ref would be in-page (pages can't clear 163 // be a reload, while only a different ref would be in-page (pages can't clear
164 // refs without reload, only change to "#" which we don't count as empty). 164 // refs without reload, only change to "#" which we don't count as empty).
165 bool IsURLInPageNavigation(const GURL& url) const; 165 bool IsURLInPageNavigation(const GURL& url) const {
166 return IsURLInPageNavigation(url, false);
Charlie Reis 2012/08/28 20:06:16 Isn't overloading usually frowned upon in Chrome?
Tom Sepez 2012/08/28 20:17:41 Yep, but it avoids having to write a comment about
167 }
168
169 // The situation is made murkier by history.replaceState(), which could
170 // provide the same URL as part of an in-page navigation, not a reload. So
171 // we need this form which lets this the (untrustworthy) renderer resolve the
Charlie Reis 2012/08/28 20:06:16 nit: which lets the
Tom Sepez 2012/08/28 20:17:41 Done.
172 // ambiguity, but only when the URLs are equal. This should be safe since the
Charlie Reis 2012/08/28 20:06:16 maybe: "URLs are equal (apart from refs)"?
Tom Sepez 2012/08/28 20:17:41 Current impl is strict equality.
173 // origin isn't changing.
174 bool IsURLInPageNavigation(const GURL& url, bool renderer_says_in_page) const;
166 175
167 // Sets the SessionStorageNamespace for the given |partition_id|. This is 176 // Sets the SessionStorageNamespace for the given |partition_id|. This is
168 // used during initialization of a new NavigationController to allow 177 // used during initialization of a new NavigationController to allow
169 // pre-population of the SessionStorageNamespace objects. Session restore, 178 // pre-population of the SessionStorageNamespace objects. Session restore,
170 // prerendering, and the implementaion of window.open() are the primary users 179 // prerendering, and the implementaion of window.open() are the primary users
171 // of this API. 180 // of this API.
172 // 181 //
173 // Calling this function when a SessionStorageNamespace has already been 182 // Calling this function when a SessionStorageNamespace has already been
174 // associated with a |partition_id| will CHECK() fail. 183 // associated with a |partition_id| will CHECK() fail.
175 void SetSessionStorageNamespace( 184 void SetSessionStorageNamespace(
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 static size_t max_entry_count_for_testing_; 353 static size_t max_entry_count_for_testing_;
345 354
346 // If a repost is pending, its type (RELOAD or RELOAD_IGNORING_CACHE), 355 // If a repost is pending, its type (RELOAD or RELOAD_IGNORING_CACHE),
347 // NO_RELOAD otherwise. 356 // NO_RELOAD otherwise.
348 ReloadType pending_reload_; 357 ReloadType pending_reload_;
349 358
350 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); 359 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl);
351 }; 360 };
352 361
353 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_ 362 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698