OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 4254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4265 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { | 4265 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { |
4266 if (window()->GetLocationBar()) | 4266 if (window()->GetLocationBar()) |
4267 window()->GetLocationBar()->UpdatePageActions(); | 4267 window()->GetLocationBar()->UpdatePageActions(); |
4268 | 4268 |
4269 // Close any tabs from the unloaded extension. | 4269 // Close any tabs from the unloaded extension. |
4270 const Extension* extension = | 4270 const Extension* extension = |
4271 content::Details<UnloadedExtensionInfo>(details)->extension; | 4271 content::Details<UnloadedExtensionInfo>(details)->extension; |
4272 TabStripModel* model = tab_handler_->GetTabStripModel(); | 4272 TabStripModel* model = tab_handler_->GetTabStripModel(); |
4273 for (int i = model->count() - 1; i >= 0; --i) { | 4273 for (int i = model->count() - 1; i >= 0; --i) { |
4274 TabContents* tc = model->GetTabContentsAt(i)->tab_contents(); | 4274 TabContents* tc = model->GetTabContentsAt(i)->tab_contents(); |
4275 if (tc->GetURL().SchemeIs(chrome::kExtensionScheme) && | 4275 bool close_tab_contents = |
4276 tc->GetURL().host() == extension->id()) { | 4276 tc->GetURL().SchemeIs(chrome::kExtensionScheme) && |
| 4277 tc->GetURL().host() == extension->id(); |
| 4278 // We want to close all panels originated by the unloaded extension. |
| 4279 close_tab_contents = close_tab_contents || (type_ == TYPE_PANEL && |
| 4280 (web_app::GetExtensionIdFromApplicationName(app_name_) == |
| 4281 extension->id())); |
| 4282 if (close_tab_contents) { |
4277 CloseTabContents(tc); | 4283 CloseTabContents(tc); |
4278 } | 4284 } |
4279 } | 4285 } |
4280 | 4286 |
4281 break; | 4287 break; |
4282 } | 4288 } |
4283 | 4289 |
4284 case chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: { | 4290 case chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: { |
4285 Profile* profile = content::Source<Profile>(source).ptr(); | 4291 Profile* profile = content::Source<Profile>(source).ptr(); |
4286 if (profile_->IsSameProfile(profile) && window()->GetLocationBar()) | 4292 if (profile_->IsSameProfile(profile) && window()->GetLocationBar()) |
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5510 } | 5516 } |
5511 | 5517 |
5512 void Browser::UpdateFullscreenExitBubbleContent() { | 5518 void Browser::UpdateFullscreenExitBubbleContent() { |
5513 GURL url; | 5519 GURL url; |
5514 if (fullscreened_tab_) | 5520 if (fullscreened_tab_) |
5515 url = fullscreened_tab_->tab_contents()->GetURL(); | 5521 url = fullscreened_tab_->tab_contents()->GetURL(); |
5516 | 5522 |
5517 window_->UpdateFullscreenExitBubbleContent( | 5523 window_->UpdateFullscreenExitBubbleContent( |
5518 url, GetFullscreenExitBubbleType()); | 5524 url, GetFullscreenExitBubbleType()); |
5519 } | 5525 } |
OLD | NEW |