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

Unified Diff: chrome/browser/devtools/global_confirm_info_bar.cc

Issue 2354673004: Add TabStripModel as a parameter of some functions in TabStripModelObserver (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/devtools/global_confirm_info_bar.cc
diff --git a/chrome/browser/devtools/global_confirm_info_bar.cc b/chrome/browser/devtools/global_confirm_info_bar.cc
index d25d08e904df81587d5684aa37fd39ff9b4816e0..edec564710890e80698142f7c2c9830439d2aace 100644
--- a/chrome/browser/devtools/global_confirm_info_bar.cc
+++ b/chrome/browser/devtools/global_confirm_info_bar.cc
@@ -160,7 +160,11 @@ GlobalConfirmInfoBar::~GlobalConfirmInfoBar() {
}
}
-void GlobalConfirmInfoBar::TabInsertedAt(content::WebContents* web_contents,
+// Do not use |tab_strip_model| as it may be null from the call in
+// TabChangedAt(). If it is ever needed later, the solution is to add a pointer
+// to the TabStripModel as a parameter of TabStripModelObserver::TabChangedAt().
+void GlobalConfirmInfoBar::TabInsertedAt(TabStripModel* tab_strip_model,
sky 2016/09/19 22:52:58 Good comment, but this is still rather rather erro
Patrick Monette 2016/09/20 17:46:54 Done. Can you double check that the code in TabCha
+ content::WebContents* web_contents,
int index,
bool foreground) {
InfoBarService* infobar_service =
@@ -189,7 +193,7 @@ void GlobalConfirmInfoBar::TabChangedAt(content::WebContents* web_contents,
InfoBarService::FromWebContents(web_contents);
auto it = proxies_.find(infobar_service);
if (it == proxies_.end())
- TabInsertedAt(web_contents, index, false);
+ TabInsertedAt(nullptr, web_contents, index, false);
}
void GlobalConfirmInfoBar::OnInfoBarRemoved(infobars::InfoBar* info_bar,

Powered by Google App Engine
This is Rietveld 408576698