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

Unified Diff: chrome/browser/extensions/extension_webnavigation_api.cc

Issue 7488011: Update the tracked URL of a frame if it changes during a navigation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_webnavigation_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_webnavigation_api.cc
diff --git a/chrome/browser/extensions/extension_webnavigation_api.cc b/chrome/browser/extensions/extension_webnavigation_api.cc
index 168944074689511d7d0c8db2553fd49070f4dd65..baa24d11bd01bd0a88c10d06be99f5315a657265 100644
--- a/chrome/browser/extensions/extension_webnavigation_api.cc
+++ b/chrome/browser/extensions/extension_webnavigation_api.cc
@@ -320,10 +320,21 @@ void ExtensionWebNavigationTabObserver::DidCommitProvisionalLoadForFrame(
PageTransition::Type transition_type) {
if (!navigation_state_.CanSendEvents(frame_id))
return;
+
+ bool is_reference_fragment_navigation =
+ IsReferenceFragmentNavigation(frame_id, url);
+
+ // Update the URL as it might have changed.
+ navigation_state_.TrackFrame(frame_id,
+ url,
+ is_main_frame,
+ false,
+ tab_contents());
+
// On reference fragment navigations, only a new navigation state is
// committed. We need to catch this case and generate a full sequence
// of events.
- if (IsReferenceFragmentNavigation(frame_id, url)) {
+ if (is_reference_fragment_navigation) {
NavigatedReferenceFragment(frame_id, is_main_frame, url, transition_type);
return;
}
@@ -424,12 +435,6 @@ void ExtensionWebNavigationTabObserver::NavigatedReferenceFragment(
bool is_main_frame,
const GURL& url,
PageTransition::Type transition_type) {
- navigation_state_.TrackFrame(frame_id,
- url,
- is_main_frame,
- false,
- tab_contents());
-
DispatchOnBeforeNavigate(tab_contents(),
frame_id,
is_main_frame,
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_webnavigation_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698