| 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 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 | 1047 |
| 1048 // Let the BrowserWindow do its handling. On e.g. views this changes the | 1048 // Let the BrowserWindow do its handling. On e.g. views this changes the |
| 1049 // focused object, which should happen before we update the toolbar below, | 1049 // focused object, which should happen before we update the toolbar below, |
| 1050 // since the omnibox expects the correct element to already be focused when it | 1050 // since the omnibox expects the correct element to already be focused when it |
| 1051 // is updated. | 1051 // is updated. |
| 1052 window_->OnActiveTabChanged(old_contents, new_contents, index, reason); | 1052 window_->OnActiveTabChanged(old_contents, new_contents, index, reason); |
| 1053 | 1053 |
| 1054 exclusive_access_manager_->OnTabDetachedFromView(old_contents); | 1054 exclusive_access_manager_->OnTabDetachedFromView(old_contents); |
| 1055 | 1055 |
| 1056 // Discarded tabs always get reloaded. | 1056 // Discarded tabs always get reloaded. |
| 1057 if (TabDiscardState::IsDiscarded(new_contents)) { | 1057 if (TabDiscardState::IsDiscarded(new_contents)) |
| 1058 LOG(WARNING) << "Reloading discarded tab at " << index; | |
| 1059 static int reload_count = 0; | |
| 1060 UMA_HISTOGRAM_CUSTOM_COUNTS( | |
| 1061 "Tabs.Discard.ReloadCount", ++reload_count, 1, 1000, 50); | |
| 1062 chrome::Reload(this, CURRENT_TAB); | 1058 chrome::Reload(this, CURRENT_TAB); |
| 1063 } | |
| 1064 | 1059 |
| 1065 // If we have any update pending, do it now. | 1060 // If we have any update pending, do it now. |
| 1066 if (chrome_updater_factory_.HasWeakPtrs() && old_contents) | 1061 if (chrome_updater_factory_.HasWeakPtrs() && old_contents) |
| 1067 ProcessPendingUIUpdates(); | 1062 ProcessPendingUIUpdates(); |
| 1068 | 1063 |
| 1069 // Propagate the profile to the location bar. | 1064 // Propagate the profile to the location bar. |
| 1070 UpdateToolbar((reason & CHANGE_REASON_REPLACED) == 0); | 1065 UpdateToolbar((reason & CHANGE_REASON_REPLACED) == 0); |
| 1071 | 1066 |
| 1072 if (search::IsInstantExtendedAPIEnabled()) | 1067 if (search::IsInstantExtendedAPIEnabled()) |
| 1073 search_delegate_->OnTabActivated(new_contents); | 1068 search_delegate_->OnTabActivated(new_contents); |
| (...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2695 if (contents && !allow_js_access) { | 2690 if (contents && !allow_js_access) { |
| 2696 contents->web_contents()->GetController().LoadURL( | 2691 contents->web_contents()->GetController().LoadURL( |
| 2697 target_url, | 2692 target_url, |
| 2698 content::Referrer(), | 2693 content::Referrer(), |
| 2699 ui::PAGE_TRANSITION_LINK, | 2694 ui::PAGE_TRANSITION_LINK, |
| 2700 std::string()); // No extra headers. | 2695 std::string()); // No extra headers. |
| 2701 } | 2696 } |
| 2702 | 2697 |
| 2703 return contents != NULL; | 2698 return contents != NULL; |
| 2704 } | 2699 } |
| OLD | NEW |