Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 1427613002: [TabManager] Move remaining discard logic from TabStripModel to TabManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 // focused object, which should happen before we update the toolbar below, 1046 // focused object, which should happen before we update the toolbar below,
1047 // since the omnibox expects the correct element to already be focused when it 1047 // since the omnibox expects the correct element to already be focused when it
1048 // is updated. 1048 // is updated.
1049 window_->OnActiveTabChanged(old_contents, new_contents, index, reason); 1049 window_->OnActiveTabChanged(old_contents, new_contents, index, reason);
1050 1050
1051 exclusive_access_manager_->OnTabDetachedFromView(old_contents); 1051 exclusive_access_manager_->OnTabDetachedFromView(old_contents);
1052 1052
1053 // Discarded tabs always get reloaded. 1053 // Discarded tabs always get reloaded.
1054 // TODO(georgesak): Validate the usefulness of this. And if needed then move 1054 // TODO(georgesak): Validate the usefulness of this. And if needed then move
1055 // to TabManager. 1055 // to TabManager.
1056 if (memory::TabManager::WebContentsData::IsDiscarded(new_contents)) 1056 if (g_browser_process->GetTabManager()->IsTabDiscarded(new_contents))
1057 chrome::Reload(this, CURRENT_TAB); 1057 chrome::Reload(this, CURRENT_TAB);
1058 1058
1059 // If we have any update pending, do it now. 1059 // If we have any update pending, do it now.
1060 if (chrome_updater_factory_.HasWeakPtrs() && old_contents) 1060 if (chrome_updater_factory_.HasWeakPtrs() && old_contents)
1061 ProcessPendingUIUpdates(); 1061 ProcessPendingUIUpdates();
1062 1062
1063 // Propagate the profile to the location bar. 1063 // Propagate the profile to the location bar.
1064 UpdateToolbar((reason & CHANGE_REASON_REPLACED) == 0); 1064 UpdateToolbar((reason & CHANGE_REASON_REPLACED) == 0);
1065 1065
1066 if (search::IsInstantExtendedAPIEnabled()) 1066 if (search::IsInstantExtendedAPIEnabled())
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after
2701 if (contents && !allow_js_access) { 2701 if (contents && !allow_js_access) {
2702 contents->web_contents()->GetController().LoadURL( 2702 contents->web_contents()->GetController().LoadURL(
2703 target_url, 2703 target_url,
2704 content::Referrer(), 2704 content::Referrer(),
2705 ui::PAGE_TRANSITION_LINK, 2705 ui::PAGE_TRANSITION_LINK,
2706 std::string()); // No extra headers. 2706 std::string()); // No extra headers.
2707 } 2707 }
2708 2708
2709 return contents != NULL; 2709 return contents != NULL;
2710 } 2710 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698