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

Unified Diff: chrome/browser/extensions/extension_host.cc

Issue 7830046: Allow window.close() in background pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/DCHECK/CHECK/ Created 9 years, 3 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/extensions/extension_host.cc
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index 7a92f6ad9812b6abb3a7bbb5fd36017f938315a9..a2c73713b575a22b8e623d80f80163e4ae871aef 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -481,6 +481,7 @@ void ExtensionHost::OnDialogClosed(IPC::Message* reply_msg,
void ExtensionHost::Close(RenderViewHost* render_view_host) {
if (extension_host_type_ == ViewType::EXTENSION_POPUP ||
extension_host_type_ == ViewType::EXTENSION_DIALOG ||
+ extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE ||
extension_host_type_ == ViewType::EXTENSION_INFOBAR) {
NotificationService::current()->Notify(
chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
@@ -517,6 +518,7 @@ WebPreferences ExtensionHost::GetWebkitPrefs() {
if (extension_host_type_ == ViewType::EXTENSION_POPUP ||
extension_host_type_ == ViewType::EXTENSION_DIALOG ||
+ extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE ||
extension_host_type_ == ViewType::EXTENSION_INFOBAR)
webkit_prefs.allow_scripts_to_close_windows = true;
« no previous file with comments | « chrome/browser/extensions/browser_action_apitest.cc ('k') | chrome/browser/extensions/extension_process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698