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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 10377066: aura: Close fullscreen RenderWidgetHostViewAura on blur. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 53084ff65d3b25886625e9a96ae83b25bbfd1bd5..a7752f28fd72434d4055b06caaa7310ff49a47fa 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -193,6 +193,7 @@ class RenderWidgetHostViewAura::ResizeLock :
RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host)
: host_(RenderWidgetHostImpl::From(host)),
ALLOW_THIS_IN_INITIALIZER_LIST(window_(new aura::Window(this))),
+ in_shutdown_(false),
is_fullscreen_(false),
popup_parent_host_view_(NULL),
popup_child_host_view_(NULL),
@@ -919,11 +920,16 @@ void RenderWidgetHostViewAura::OnBlur() {
host_->Blur();
ui::InputMethod* input_method = GetInputMethod();
- if (input_method) {
- if (input_method->GetTextInputClient() == this)
- input_method->SetFocusedTextInputClient(NULL);
- }
+ if (input_method && input_method->GetTextInputClient() == this)
+ input_method->SetFocusedTextInputClient(NULL);
host_->SetInputMethodActive(false);
+
+ // If we lose the focus while fullscreen, close the window; Pepper Flash won't
+ // do it for us (unlike NPAPI Flash).
+ if (is_fullscreen_ && !in_shutdown_) {
+ in_shutdown_ = true;
+ host_->Shutdown();
+ }
}
bool RenderWidgetHostViewAura::OnKeyEvent(aura::KeyEvent* event) {
@@ -933,6 +939,7 @@ bool RenderWidgetHostViewAura::OnKeyEvent(aura::KeyEvent* event) {
// We need to handle the Escape key for Pepper Flash.
if (is_fullscreen_ && event->key_code() == ui::VKEY_ESCAPE) {
+ in_shutdown_ = true;
piman 2012/05/09 20:19:22 drive-by: should we test !in_shutdown_ before this
Daniel Erat 2012/05/09 20:25:21 I don't think we return to the event loop before w
host_->Shutdown();
} else {
// We don't have to communicate with an input method here.
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698