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

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

Issue 2245203002: Clean up defensive TabManager handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 4 months 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
« no previous file with comments | « chrome/browser/memory/tab_manager_observer_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 // focused object, which should happen before we update the toolbar below, 1041 // focused object, which should happen before we update the toolbar below,
1042 // since the omnibox expects the correct element to already be focused when it 1042 // since the omnibox expects the correct element to already be focused when it
1043 // is updated. 1043 // is updated.
1044 window_->OnActiveTabChanged(old_contents, new_contents, index, reason); 1044 window_->OnActiveTabChanged(old_contents, new_contents, index, reason);
1045 1045
1046 exclusive_access_manager_->OnTabDetachedFromView(old_contents); 1046 exclusive_access_manager_->OnTabDetachedFromView(old_contents);
1047 1047
1048 // Discarded tabs always get reloaded. 1048 // Discarded tabs always get reloaded.
1049 // TODO(georgesak): Validate the usefulness of this. And if needed then move 1049 // TODO(georgesak): Validate the usefulness of this. And if needed then move
1050 // to TabManager. 1050 // to TabManager.
1051 if (g_browser_process->GetTabManager() && 1051 if (g_browser_process->GetTabManager()->IsTabDiscarded(new_contents))
1052 g_browser_process->GetTabManager()->IsTabDiscarded(new_contents))
1053 chrome::Reload(this, CURRENT_TAB); 1052 chrome::Reload(this, CURRENT_TAB);
1054 1053
1055 // If we have any update pending, do it now. 1054 // If we have any update pending, do it now.
1056 if (chrome_updater_factory_.HasWeakPtrs() && old_contents) 1055 if (chrome_updater_factory_.HasWeakPtrs() && old_contents)
1057 ProcessPendingUIUpdates(); 1056 ProcessPendingUIUpdates();
1058 1057
1059 // Propagate the profile to the location bar. 1058 // Propagate the profile to the location bar.
1060 UpdateToolbar((reason & CHANGE_REASON_REPLACED) == 0); 1059 UpdateToolbar((reason & CHANGE_REASON_REPLACED) == 0);
1061 1060
1062 if (search::IsInstantExtendedAPIEnabled()) 1061 if (search::IsInstantExtendedAPIEnabled())
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after
2601 if (contents && !allow_js_access) { 2600 if (contents && !allow_js_access) {
2602 contents->web_contents()->GetController().LoadURL( 2601 contents->web_contents()->GetController().LoadURL(
2603 target_url, 2602 target_url,
2604 content::Referrer(), 2603 content::Referrer(),
2605 ui::PAGE_TRANSITION_LINK, 2604 ui::PAGE_TRANSITION_LINK,
2606 std::string()); // No extra headers. 2605 std::string()); // No extra headers.
2607 } 2606 }
2608 2607
2609 return contents != NULL; 2608 return contents != NULL;
2610 } 2609 }
OLDNEW
« no previous file with comments | « chrome/browser/memory/tab_manager_observer_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698