OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 RendererDidNavigateInPage(params, &(details->did_replace_entry)); | 532 RendererDidNavigateInPage(params, &(details->did_replace_entry)); |
533 break; | 533 break; |
534 case NavigationType::NEW_SUBFRAME: | 534 case NavigationType::NEW_SUBFRAME: |
535 RendererDidNavigateNewSubframe(params); | 535 RendererDidNavigateNewSubframe(params); |
536 break; | 536 break; |
537 case NavigationType::AUTO_SUBFRAME: | 537 case NavigationType::AUTO_SUBFRAME: |
538 if (!RendererDidNavigateAutoSubframe(params)) | 538 if (!RendererDidNavigateAutoSubframe(params)) |
539 return false; | 539 return false; |
540 break; | 540 break; |
541 case NavigationType::NAV_IGNORE: | 541 case NavigationType::NAV_IGNORE: |
542 // There is nothing we can do with this navigation, so we just return to | 542 // If a pending navigation was in progress, this canceled it. We should |
| 543 // discard it and make sure it is removed from the URL bar. After that, |
| 544 // there is nothing we can do with this navigation, so we just return to |
543 // the caller that nothing has happened. | 545 // the caller that nothing has happened. |
| 546 if (pending_entry_) { |
| 547 DiscardNonCommittedEntries(); |
| 548 extra_invalidate_flags |= TabContents::INVALIDATE_URL; |
| 549 tab_contents_->NotifyNavigationStateChanged(extra_invalidate_flags); |
| 550 } |
544 return false; | 551 return false; |
545 default: | 552 default: |
546 NOTREACHED(); | 553 NOTREACHED(); |
547 } | 554 } |
548 | 555 |
549 // All committed entries should have nonempty content state so WebKit doesn't | 556 // All committed entries should have nonempty content state so WebKit doesn't |
550 // get confused when we go back to them (see the function for details). | 557 // get confused when we go back to them (see the function for details). |
551 DCHECK(!params.content_state.empty()); | 558 DCHECK(!params.content_state.empty()); |
552 NavigationEntry* active_entry = GetActiveEntry(); | 559 NavigationEntry* active_entry = GetActiveEntry(); |
553 active_entry->set_content_state(params.content_state); | 560 active_entry->set_content_state(params.content_state); |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 size_t insert_index = 0; | 1193 size_t insert_index = 0; |
1187 for (int i = 0; i < max_index; i++) { | 1194 for (int i = 0; i < max_index; i++) { |
1188 // When cloning a tab, copy all entries except interstitial pages | 1195 // When cloning a tab, copy all entries except interstitial pages |
1189 if (source.entries_[i].get()->page_type() != INTERSTITIAL_PAGE) { | 1196 if (source.entries_[i].get()->page_type() != INTERSTITIAL_PAGE) { |
1190 entries_.insert(entries_.begin() + insert_index++, | 1197 entries_.insert(entries_.begin() + insert_index++, |
1191 linked_ptr<NavigationEntry>( | 1198 linked_ptr<NavigationEntry>( |
1192 new NavigationEntry(*source.entries_[i]))); | 1199 new NavigationEntry(*source.entries_[i]))); |
1193 } | 1200 } |
1194 } | 1201 } |
1195 } | 1202 } |
OLD | NEW |