Chromium Code Reviews| Index: chrome/browser/ui/browser.cc |
| diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
| index bbebf24e6ea6474003b907a08f962a0699bfb246..f1e031751e3f9ba76dd60739c9decb886de0dd45 100644 |
| --- a/chrome/browser/ui/browser.cc |
| +++ b/chrome/browser/ui/browser.cc |
| @@ -4272,8 +4272,14 @@ void Browser::Observe(int type, |
| TabStripModel* model = tab_handler_->GetTabStripModel(); |
| for (int i = model->count() - 1; i >= 0; --i) { |
| TabContents* tc = model->GetTabContentsAt(i)->tab_contents(); |
| - if (tc->GetURL().SchemeIs(chrome::kExtensionScheme) && |
| - tc->GetURL().host() == extension->id()) { |
| + bool close_tab_contents = |
| + tc->GetURL().SchemeIs(chrome::kExtensionScheme) && |
| + tc->GetURL().host() == extension->id(); |
| + // We want to close all panels originated by the unloaded extension. |
| + close_tab_contents = close_tab_contents || |
| + ((web_app::GetExtensionIdFromApplicationName(app_name_) == |
|
jennb
2011/10/28 21:12:27
I would reverse the check to have type_ == TYPE_PA
jennb
2011/10/28 21:12:27
Will this work correctly if there is no app name?
prasadt
2011/10/28 21:53:28
Done.
prasadt
2011/10/28 21:53:28
Yes. GetExtensionIdFromApplicationName just return
|
| + extension->id()) && type_ == TYPE_PANEL); |
| + if (close_tab_contents) { |
| CloseTabContents(tc); |
| } |
| } |