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

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

Issue 257056: Resubmit http://codereview.chromium.org/243096 with gcc compile error (Closed)
Patch Set: testing Created 11 years, 2 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
« no previous file with comments | « chrome/browser/extensions/extension_host.h ('k') | chrome/browser/views/browser_bubble_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_host.cc
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index 3baa9084e1feb99330be679ef6ffed520abef691..766a12e73994dba703ebb156a1116bb9848eead8 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -31,9 +31,8 @@
#include "chrome/common/view_types.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.h"
-
#include "grit/browser_resources.h"
-
+#include "views/widget/widget.h"
#include "webkit/glue/context_menu.h"
using WebKit::WebDragOperation;
@@ -339,10 +338,26 @@ void ExtensionHost::RunJavaScriptMessage(const std::wstring& message,
render_view_host()->JavaScriptMessageBoxClosed(reply_msg, true, L"");
}
+void ExtensionHost::Close(RenderViewHost* render_view_host) {
+ if (extension_host_type_ == ViewType::EXTENSION_POPUP) {
+#if defined(TOOLKIT_VIEWS)
+ // TODO(erikkay) This is a bit of a hack. By hiding the widget, we trigger
+ // a deactivation which will then bubble into ExtensionPopup and actually
+ // close the popup. Perhaps we should have a more explicit delegate to
+ // ExtensionHost.
+ view_->GetWidget()->Hide();
+#endif
+ }
+}
+
WebPreferences ExtensionHost::GetWebkitPrefs() {
PrefService* prefs = render_view_host()->process()->profile()->GetPrefs();
const bool kIsDomUI = true;
- return RenderViewHostDelegateHelper::GetWebkitPrefs(prefs, kIsDomUI);
+ WebPreferences webkit_prefs =
+ RenderViewHostDelegateHelper::GetWebkitPrefs(prefs, kIsDomUI);
+ if (extension_host_type_ == ViewType::EXTENSION_POPUP)
+ webkit_prefs.allow_scripts_to_close_windows = true;
+ return webkit_prefs;
}
void ExtensionHost::ProcessDOMUIMessage(const std::string& message,
« no previous file with comments | « chrome/browser/extensions/extension_host.h ('k') | chrome/browser/views/browser_bubble_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698