| OLD | NEW |
| 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_number_conversions.h" // Temporary | 9 #include "base/string_number_conversions.h" // Temporary |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 // Discard any current transient entry, we can only have one at a time. | 490 // Discard any current transient entry, we can only have one at a time. |
| 491 int index = 0; | 491 int index = 0; |
| 492 if (last_committed_entry_index_ != -1) | 492 if (last_committed_entry_index_ != -1) |
| 493 index = last_committed_entry_index_ + 1; | 493 index = last_committed_entry_index_ + 1; |
| 494 DiscardTransientEntry(); | 494 DiscardTransientEntry(); |
| 495 entries_.insert(entries_.begin() + index, linked_ptr<NavigationEntry>(entry)); | 495 entries_.insert(entries_.begin() + index, linked_ptr<NavigationEntry>(entry)); |
| 496 transient_entry_index_ = index; | 496 transient_entry_index_ = index; |
| 497 tab_contents_->NotifyNavigationStateChanged(kInvalidateAll); | 497 tab_contents_->NotifyNavigationStateChanged(kInvalidateAll); |
| 498 } | 498 } |
| 499 | 499 |
| 500 void NavigationController::TransferURL( |
| 501 const GURL& url, |
| 502 const GURL& referrer, |
| 503 content::PageTransition transition, |
| 504 const std::string& extra_headers, |
| 505 const GlobalRequestID& transferred_global_request_id, |
| 506 bool is_renderer_initiated) { |
| 507 // The user initiated a load, we don't need to reload anymore. |
| 508 needs_reload_ = false; |
| 509 |
| 510 NavigationEntry* entry = CreateNavigationEntry(url, referrer, transition, |
| 511 is_renderer_initiated, |
| 512 extra_headers, |
| 513 browser_context_); |
| 514 entry->set_transferred_global_request_id(transferred_global_request_id); |
| 515 |
| 516 LoadEntry(entry); |
| 517 } |
| 518 |
| 500 void NavigationController::LoadURL( | 519 void NavigationController::LoadURL( |
| 501 const GURL& url, | 520 const GURL& url, |
| 502 const GURL& referrer, | 521 const GURL& referrer, |
| 503 content::PageTransition transition, | 522 content::PageTransition transition, |
| 504 const std::string& extra_headers) { | 523 const std::string& extra_headers) { |
| 505 // The user initiated a load, we don't need to reload anymore. | 524 // The user initiated a load, we don't need to reload anymore. |
| 506 needs_reload_ = false; | 525 needs_reload_ = false; |
| 507 | 526 |
| 508 NavigationEntry* entry = CreateNavigationEntry(url, referrer, transition, | 527 NavigationEntry* entry = CreateNavigationEntry(url, referrer, transition, |
| 509 false, | 528 false, |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 for (int i = 0; i < max_index; i++) { | 1281 for (int i = 0; i < max_index; i++) { |
| 1263 // When cloning a tab, copy all entries except interstitial pages | 1282 // When cloning a tab, copy all entries except interstitial pages |
| 1264 if (source.entries_[i].get()->page_type() != | 1283 if (source.entries_[i].get()->page_type() != |
| 1265 content::PAGE_TYPE_INTERSTITIAL) { | 1284 content::PAGE_TYPE_INTERSTITIAL) { |
| 1266 entries_.insert(entries_.begin() + insert_index++, | 1285 entries_.insert(entries_.begin() + insert_index++, |
| 1267 linked_ptr<NavigationEntry>( | 1286 linked_ptr<NavigationEntry>( |
| 1268 new NavigationEntry(*source.entries_[i]))); | 1287 new NavigationEntry(*source.entries_[i]))); |
| 1269 } | 1288 } |
| 1270 } | 1289 } |
| 1271 } | 1290 } |
| OLD | NEW |