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

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

Issue 12207155: Revert 182194 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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/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";
« no previous file with comments | « chrome/browser/ui/extensions/shell_window.h ('k') | chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698