Index: chrome/browser/ui/extensions/shell_window.cc |
=================================================================== |
--- chrome/browser/ui/extensions/shell_window.cc (revision 182229) |
+++ chrome/browser/ui/extensions/shell_window.cc (working copy) |
@@ -244,11 +244,6 @@ |
chrome::EndKeepAlive(); |
} |
-void ShellWindow::Close() { |
- extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this); |
- native_app_window_->Close(); |
-} |
- |
void ShellWindow::RequestMediaAccessPermission( |
content::WebContents* web_contents, |
const content::MediaStreamRequest& request, |
@@ -348,16 +343,9 @@ |
} |
void ShellWindow::OnNativeClose() { |
- // This method is shared between the path for the user clicking the close |
- // button and the path where a close is triggered by code (e.g. by the |
- // extension being unloaded). In the latter case, this RemoveShellWindow is |
- // superfluous, since it will already have been removed, but the call is |
- // idempotent so it's harmless the second time. |
extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this); |
- if (extension_) { |
- content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); |
- rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); |
- } |
+ content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); |
+ rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); |
delete this; |
} |
@@ -499,7 +487,7 @@ |
void ShellWindow::CloseContents(WebContents* contents) { |
DCHECK(contents == web_contents_); |
- Close(); |
+ native_app_window_->Close(); |
} |
bool ShellWindow::ShouldSuppressDialogs() { |
@@ -573,16 +561,12 @@ |
const extensions::Extension* unloaded_extension = |
content::Details<extensions::UnloadedExtensionInfo>( |
details)->extension; |
- if (extension_ == unloaded_extension) { |
- Close(); |
- // After this notification finishes processing, the Extension will be |
- // deleted, so we null out our reference to avoid bad access. |
- extension_ = NULL; |
- } |
+ if (extension_ == unloaded_extension) |
+ native_app_window_->Close(); |
break; |
} |
case chrome::NOTIFICATION_APP_TERMINATING: |
- Close(); |
+ native_app_window_->Close(); |
break; |
default: |
NOTREACHED() << "Received unexpected notification"; |