| 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/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 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 | 1004 |
| 1005 void NavigationController::NavigateToPendingEntry(bool reload) { | 1005 void NavigationController::NavigateToPendingEntry(bool reload) { |
| 1006 TabContents* from_contents = active_contents_; | 1006 TabContents* from_contents = active_contents_; |
| 1007 | 1007 |
| 1008 // For session history navigations only the pending_entry_index_ is set. | 1008 // For session history navigations only the pending_entry_index_ is set. |
| 1009 if (!pending_entry_) { | 1009 if (!pending_entry_) { |
| 1010 DCHECK(pending_entry_index_ != -1); | 1010 DCHECK(pending_entry_index_ != -1); |
| 1011 pending_entry_ = entries_[pending_entry_index_].get(); | 1011 pending_entry_ = entries_[pending_entry_index_].get(); |
| 1012 } | 1012 } |
| 1013 | 1013 |
| 1014 // Reset the security states as any SSL error may have been resolved since we | |
| 1015 // last visited that page. | |
| 1016 pending_entry_->ssl() = NavigationEntry::SSLStatus(); | |
| 1017 | |
| 1018 if (from_contents && from_contents->type() != pending_entry_->tab_type()) | 1014 if (from_contents && from_contents->type() != pending_entry_->tab_type()) |
| 1019 from_contents->set_is_active(false); | 1015 from_contents->set_is_active(false); |
| 1020 | 1016 |
| 1021 TabContents* contents = GetTabContentsCreateIfNecessary(*pending_entry_); | 1017 TabContents* contents = GetTabContentsCreateIfNecessary(*pending_entry_); |
| 1022 | 1018 |
| 1023 contents->set_is_active(true); | 1019 contents->set_is_active(true); |
| 1024 active_contents_ = contents; | 1020 active_contents_ = contents; |
| 1025 | 1021 |
| 1026 if (from_contents && from_contents != contents && from_contents->delegate()) | 1022 if (from_contents && from_contents != contents && from_contents->delegate()) |
| 1027 from_contents->delegate()->ReplaceContents(from_contents, contents); | 1023 from_contents->delegate()->ReplaceContents(from_contents, contents); |
| 1028 | 1024 |
| 1029 NavigationEntry temp_entry(*pending_entry_); | 1025 NavigationEntry temp_entry(*pending_entry_); |
| 1030 if (!contents->NavigateToPendingEntry(reload)) | 1026 if (!contents->NavigateToPendingEntry(reload)) |
| 1031 DiscardNonCommittedEntries(); | 1027 DiscardNonCommittedEntries(); |
| 1032 } | 1028 } |
| 1033 | 1029 |
| 1034 void NavigationController::NotifyNavigationEntryCommitted( | 1030 void NavigationController::NotifyNavigationEntryCommitted( |
| 1035 LoadCommittedDetails* details) { | 1031 LoadCommittedDetails* details) { |
| 1036 // TODO(pkasting): http://b/1113079 Probably these explicit notification paths | 1032 // TODO(pkasting): http://b/1113079 Probably these explicit notification paths |
| 1037 // should be removed, and interested parties should just listen for the | 1033 // should be removed, and interested parties should just listen for the |
| 1038 // notification below instead. | 1034 // notification below instead. |
| 1039 ssl_manager_.NavigationStateChanged(); | |
| 1040 active_contents_->NotifyNavigationStateChanged( | 1035 active_contents_->NotifyNavigationStateChanged( |
| 1041 TabContents::INVALIDATE_EVERYTHING); | 1036 TabContents::INVALIDATE_EVERYTHING); |
| 1042 | 1037 |
| 1043 details->entry = GetActiveEntry(); | 1038 details->entry = GetActiveEntry(); |
| 1044 NotificationService::current()->Notify( | 1039 NotificationService::current()->Notify( |
| 1045 NotificationType::NAV_ENTRY_COMMITTED, | 1040 NotificationType::NAV_ENTRY_COMMITTED, |
| 1046 Source<NavigationController>(this), | 1041 Source<NavigationController>(this), |
| 1047 Details<LoadCommittedDetails>(details)); | 1042 Details<LoadCommittedDetails>(details)); |
| 1048 } | 1043 } |
| 1049 | 1044 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1228 return i; | 1223 return i; |
| 1229 } | 1224 } |
| 1230 return -1; | 1225 return -1; |
| 1231 } | 1226 } |
| 1232 | 1227 |
| 1233 NavigationEntry* NavigationController::GetTransientEntry() const { | 1228 NavigationEntry* NavigationController::GetTransientEntry() const { |
| 1234 if (transient_entry_index_ == -1) | 1229 if (transient_entry_index_ == -1) |
| 1235 return NULL; | 1230 return NULL; |
| 1236 return entries_[transient_entry_index_].get(); | 1231 return entries_[transient_entry_index_].get(); |
| 1237 } | 1232 } |
| OLD | NEW |