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

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

Issue 10910034: Attempt 2 at: Fixes crash that occured because NativeViewHostAura::Detach was not (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: da fix Created 8 years, 4 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/ui/views/constrained_window_views.cc ('k') | ui/views/controls/native/native_view_host.h » ('j') | 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 d70875ca83e33c1cc793d98d160ac69202c34529..7130feccda896557be15de267772c07d2f41abf8 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -338,7 +338,11 @@ void RenderWidgetHostViewAura::MovePluginWindows(
}
void RenderWidgetHostViewAura::Focus() {
- window_->Focus();
+ // Make sure we have a FocusManager before attempting to Focus(). In some
+ // situations we may not yet be in a valid Window hierarchy (such as reloading
+ // after out of memory discared the tab).
+ if (window_->GetFocusManager())
+ window_->Focus();
}
void RenderWidgetHostViewAura::Blur() {
« no previous file with comments | « chrome/browser/ui/views/constrained_window_views.cc ('k') | ui/views/controls/native/native_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698