OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 if (session_service) | 1107 if (session_service) |
1108 session_service->TabClosing(old_contents); | 1108 session_service->TabClosing(old_contents); |
1109 TabInsertedAt(new_contents, | 1109 TabInsertedAt(new_contents, |
1110 index, | 1110 index, |
1111 (index == tab_strip_model_->active_index())); | 1111 (index == tab_strip_model_->active_index())); |
1112 | 1112 |
1113 int entry_count = new_contents->GetController().GetEntryCount(); | 1113 int entry_count = new_contents->GetController().GetEntryCount(); |
1114 if (entry_count > 0) { | 1114 if (entry_count > 0) { |
1115 // Send out notification so that observers are updated appropriately. | 1115 // Send out notification so that observers are updated appropriately. |
1116 new_contents->GetController().NotifyEntryChanged( | 1116 new_contents->GetController().NotifyEntryChanged( |
1117 new_contents->GetController().GetEntryAtIndex(entry_count - 1), | 1117 new_contents->GetController().GetEntryAtIndex(entry_count - 1)); |
1118 entry_count - 1); | |
1119 } | 1118 } |
1120 | 1119 |
1121 if (session_service) { | 1120 if (session_service) { |
1122 // The new_contents may end up with a different navigation stack. Force | 1121 // The new_contents may end up with a different navigation stack. Force |
1123 // the session service to update itself. | 1122 // the session service to update itself. |
1124 session_service->TabRestored(new_contents, | 1123 session_service->TabRestored(new_contents, |
1125 tab_strip_model_->IsTabPinned(index)); | 1124 tab_strip_model_->IsTabPinned(index)); |
1126 } | 1125 } |
1127 } | 1126 } |
1128 | 1127 |
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2603 if (contents && !allow_js_access) { | 2602 if (contents && !allow_js_access) { |
2604 contents->web_contents()->GetController().LoadURL( | 2603 contents->web_contents()->GetController().LoadURL( |
2605 target_url, | 2604 target_url, |
2606 content::Referrer(), | 2605 content::Referrer(), |
2607 ui::PAGE_TRANSITION_LINK, | 2606 ui::PAGE_TRANSITION_LINK, |
2608 std::string()); // No extra headers. | 2607 std::string()); // No extra headers. |
2609 } | 2608 } |
2610 | 2609 |
2611 return contents != NULL; | 2610 return contents != NULL; |
2612 } | 2611 } |
OLD | NEW |