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

Unified Diff: chrome/browser/ui/browser.cc

Issue 8387010: Close all panels originated by the extension when extension unloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review feedback. Created 9 years, 2 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
« no previous file with comments | « chrome/browser/extensions/window_open_apitest.cc ('k') | chrome/browser/ui/panels/panel_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index bbebf24e6ea6474003b907a08f962a0699bfb246..da68913b06795b9f691ccd3b2b1f36417f321713 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 || (type_ == TYPE_PANEL &&
+ (web_app::GetExtensionIdFromApplicationName(app_name_) ==
+ extension->id()));
+ if (close_tab_contents) {
CloseTabContents(tc);
}
}
« no previous file with comments | « chrome/browser/extensions/window_open_apitest.cc ('k') | chrome/browser/ui/panels/panel_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698