Chromium Code Reviews| 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, |