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 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 // Update the bookmark state, since the BrowserWindow may query it during | 974 // Update the bookmark state, since the BrowserWindow may query it during |
975 // OnActiveTabChanged() below. | 975 // OnActiveTabChanged() below. |
976 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_SWITCH); | 976 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_SWITCH); |
977 | 977 |
978 // Let the BrowserWindow do its handling. On e.g. views this changes the | 978 // Let the BrowserWindow do its handling. On e.g. views this changes the |
979 // focused object, which should happen before we update the toolbar below, | 979 // focused object, which should happen before we update the toolbar below, |
980 // since the omnibox expects the correct element to already be focused when it | 980 // since the omnibox expects the correct element to already be focused when it |
981 // is updated. | 981 // is updated. |
982 window_->OnActiveTabChanged(old_contents, new_contents, index, reason); | 982 window_->OnActiveTabChanged(old_contents, new_contents, index, reason); |
983 | 983 |
| 984 fullscreen_controller_->OnTabDetachedFromView(old_contents); |
| 985 |
984 // Discarded tabs always get reloaded. | 986 // Discarded tabs always get reloaded. |
985 if (tab_strip_model_->IsTabDiscarded(index)) { | 987 if (tab_strip_model_->IsTabDiscarded(index)) { |
986 LOG(WARNING) << "Reloading discarded tab at " << index; | 988 LOG(WARNING) << "Reloading discarded tab at " << index; |
987 static int reload_count = 0; | 989 static int reload_count = 0; |
988 UMA_HISTOGRAM_CUSTOM_COUNTS( | 990 UMA_HISTOGRAM_CUSTOM_COUNTS( |
989 "Tabs.Discard.ReloadCount", ++reload_count, 1, 1000, 50); | 991 "Tabs.Discard.ReloadCount", ++reload_count, 1, 1000, 50); |
990 chrome::Reload(this, CURRENT_TAB); | 992 chrome::Reload(this, CURRENT_TAB); |
991 } | 993 } |
992 | 994 |
993 // If we have any update pending, do it now. | 995 // If we have any update pending, do it now. |
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2292 if (contents && !allow_js_access) { | 2294 if (contents && !allow_js_access) { |
2293 contents->web_contents()->GetController().LoadURL( | 2295 contents->web_contents()->GetController().LoadURL( |
2294 target_url, | 2296 target_url, |
2295 content::Referrer(), | 2297 content::Referrer(), |
2296 content::PAGE_TRANSITION_LINK, | 2298 content::PAGE_TRANSITION_LINK, |
2297 std::string()); // No extra headers. | 2299 std::string()); // No extra headers. |
2298 } | 2300 } |
2299 | 2301 |
2300 return contents != NULL; | 2302 return contents != NULL; |
2301 } | 2303 } |
OLD | NEW |