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. |