| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/tab_contents/navigation_controller.h" | 5 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 pending_entry_->ssl() = NavigationEntry::SSLStatus(); | 1003 pending_entry_->ssl() = NavigationEntry::SSLStatus(); |
| 1004 | 1004 |
| 1005 if (from_contents && from_contents->type() != pending_entry_->tab_type()) | 1005 if (from_contents && from_contents->type() != pending_entry_->tab_type()) |
| 1006 from_contents->set_is_active(false); | 1006 from_contents->set_is_active(false); |
| 1007 | 1007 |
| 1008 TabContents* contents = GetTabContentsCreateIfNecessary(*pending_entry_); | 1008 TabContents* contents = GetTabContentsCreateIfNecessary(*pending_entry_); |
| 1009 | 1009 |
| 1010 contents->set_is_active(true); | 1010 contents->set_is_active(true); |
| 1011 active_contents_ = contents; | 1011 active_contents_ = contents; |
| 1012 | 1012 |
| 1013 if (from_contents && from_contents != contents) { | 1013 if (from_contents && from_contents != contents && from_contents->delegate()) |
| 1014 if (from_contents->delegate()) | 1014 from_contents->delegate()->ReplaceContents(from_contents, contents); |
| 1015 from_contents->delegate()->ReplaceContents(from_contents, contents); | |
| 1016 | |
| 1017 if (from_contents->type() != contents->type()) { | |
| 1018 // The entry we just discarded needed a different TabContents type. We no | |
| 1019 // longer need it but we can't destroy it just yet because the TabContents | |
| 1020 // is very likely involved in the current stack. | |
| 1021 ScheduleTabContentsCollection(from_contents->type()); | |
| 1022 } | |
| 1023 } | |
| 1024 | 1015 |
| 1025 NavigationEntry temp_entry(*pending_entry_); | 1016 NavigationEntry temp_entry(*pending_entry_); |
| 1026 if (!contents->NavigateToPendingEntry(reload)) | 1017 if (!contents->NavigateToPendingEntry(reload)) |
| 1027 DiscardNonCommittedEntries(); | 1018 DiscardNonCommittedEntries(); |
| 1028 } | 1019 } |
| 1029 | 1020 |
| 1030 void NavigationController::NotifyNavigationEntryCommitted( | 1021 void NavigationController::NotifyNavigationEntryCommitted( |
| 1031 LoadCommittedDetails* details) { | 1022 LoadCommittedDetails* details) { |
| 1032 // TODO(pkasting): http://b/1113079 Probably these explicit notification paths | 1023 // TODO(pkasting): http://b/1113079 Probably these explicit notification paths |
| 1033 // should be removed, and interested parties should just listen for the | 1024 // should be removed, and interested parties should just listen for the |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1224 return i; | 1215 return i; |
| 1225 } | 1216 } |
| 1226 return -1; | 1217 return -1; |
| 1227 } | 1218 } |
| 1228 | 1219 |
| 1229 NavigationEntry* NavigationController::GetTransientEntry() const { | 1220 NavigationEntry* NavigationController::GetTransientEntry() const { |
| 1230 if (transient_entry_index_ == -1) | 1221 if (transient_entry_index_ == -1) |
| 1231 return NULL; | 1222 return NULL; |
| 1232 return entries_[transient_entry_index_].get(); | 1223 return entries_[transient_entry_index_].get(); |
| 1233 } | 1224 } |
| OLD | NEW |