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

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: Replace RunAllPending in loop with waiting for notifications. 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
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 00d726e365e8d5b5dffe42d9c2f0f4243db1d44a..d6c8b3d0cd2f728cd8e81ee6876f3c3c5bde3424 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -4284,8 +4284,16 @@ 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();
+ if (!close_tab_contents) {
Dmitry Titov 2011/10/25 20:29:15 nit: could it be more readable like this: close_ta
prasadt 2011/10/28 18:23:19 Done.
+ // We want to close all panels originated by the unloaded extension.
+ close_tab_contents =
+ (web_app::GetExtensionIdFromApplicationName(app_name_) ==
+ extension->id()) && type_ == TYPE_PANEL;
+ }
+ if (close_tab_contents) {
CloseTabContents(tc);
}
}
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_browsertest.cc » ('j') | chrome/browser/ui/panels/panel_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698