Index: trunk/src/apps/shell_window.cc |
=================================================================== |
--- trunk/src/apps/shell_window.cc (revision 215781) |
+++ trunk/src/apps/shell_window.cc (working copy) |
@@ -280,15 +280,9 @@ |
} |
void ShellWindow::OnNativeClose() { |
- if (extension_) { |
- // If |extension_| is NULL here, it is because the extension has been |
- // unloaded. In this case, the window will have already been removed from |
- // the ShellWindowRegistry, and the app can not be informed of the window |
- // closing as it has gone. |
- extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this); |
- if (shell_window_contents_) |
- shell_window_contents_->NativeWindowClosed(); |
- } |
+ extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this); |
+ if (shell_window_contents_) |
+ shell_window_contents_->NativeWindowClosed(); |
delete this; |
} |
@@ -453,7 +447,7 @@ |
} |
void ShellWindow::CloseContents(WebContents* contents) { |
- Close(); |
+ native_app_window_->Close(); |
} |
bool ShellWindow::ShouldSuppressDialogs() { |
@@ -532,16 +526,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"; |
@@ -567,11 +557,6 @@ |
return native_app_window_.get(); |
} |
-void ShellWindow::Close() { |
- extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this); |
- native_app_window_->Close(); |
-} |
- |
void ShellWindow::AddMessageToDevToolsConsole(ConsoleMessageLevel level, |
const std::string& message) { |
content::RenderViewHost* rvh = web_contents()->GetRenderViewHost(); |