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

Side by Side Diff: content/browser/tab_contents/navigation_controller.cc

Issue 6826015: Ensure URL is updated after a cross-site navigation is pre-empted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add unit test. Created 9 years, 8 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
« no previous file with comments | « no previous file | content/browser/tab_contents/navigation_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/tab_contents/navigation_controller.h" 5 #include "content/browser/tab_contents/navigation_controller.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 RendererDidNavigateInPage(params, &(details->did_replace_entry)); 526 RendererDidNavigateInPage(params, &(details->did_replace_entry));
527 break; 527 break;
528 case NavigationType::NEW_SUBFRAME: 528 case NavigationType::NEW_SUBFRAME:
529 RendererDidNavigateNewSubframe(params); 529 RendererDidNavigateNewSubframe(params);
530 break; 530 break;
531 case NavigationType::AUTO_SUBFRAME: 531 case NavigationType::AUTO_SUBFRAME:
532 if (!RendererDidNavigateAutoSubframe(params)) 532 if (!RendererDidNavigateAutoSubframe(params))
533 return false; 533 return false;
534 break; 534 break;
535 case NavigationType::NAV_IGNORE: 535 case NavigationType::NAV_IGNORE:
536 // There is nothing we can do with this navigation, so we just return to 536 // If a pending navigation was in progress, this canceled it. We should
537 // discard it and make sure it is removed from the URL bar. After that,
538 // there is nothing we can do with this navigation, so we just return to
537 // the caller that nothing has happened. 539 // the caller that nothing has happened.
540 if (pending_entry_) {
541 DiscardNonCommittedEntries();
542 extra_invalidate_flags |= TabContents::INVALIDATE_URL;
543 tab_contents_->NotifyNavigationStateChanged(extra_invalidate_flags);
544 }
538 return false; 545 return false;
539 default: 546 default:
540 NOTREACHED(); 547 NOTREACHED();
541 } 548 }
542 549
543 // All committed entries should have nonempty content state so WebKit doesn't 550 // All committed entries should have nonempty content state so WebKit doesn't
544 // get confused when we go back to them (see the function for details). 551 // get confused when we go back to them (see the function for details).
545 DCHECK(!params.content_state.empty()); 552 DCHECK(!params.content_state.empty());
546 NavigationEntry* active_entry = GetActiveEntry(); 553 NavigationEntry* active_entry = GetActiveEntry();
547 active_entry->set_content_state(params.content_state); 554 active_entry->set_content_state(params.content_state);
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 size_t insert_index = 0; 1217 size_t insert_index = 0;
1211 for (int i = 0; i < max_index; i++) { 1218 for (int i = 0; i < max_index; i++) {
1212 // When cloning a tab, copy all entries except interstitial pages 1219 // When cloning a tab, copy all entries except interstitial pages
1213 if (source.entries_[i].get()->page_type() != INTERSTITIAL_PAGE) { 1220 if (source.entries_[i].get()->page_type() != INTERSTITIAL_PAGE) {
1214 entries_.insert(entries_.begin() + insert_index++, 1221 entries_.insert(entries_.begin() + insert_index++,
1215 linked_ptr<NavigationEntry>( 1222 linked_ptr<NavigationEntry>(
1216 new NavigationEntry(*source.entries_[i]))); 1223 new NavigationEntry(*source.entries_[i])));
1217 } 1224 }
1218 } 1225 }
1219 } 1226 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/tab_contents/navigation_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698