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

Unified Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 10388219: Fix keyboard shortcuts not working if a sad tab is focused. (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_aura.cc
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index 23227c88e471e8d3c76a8ee2bc8c705c1fa3f942..2345456f94772a2f5b116cd856488a2f26a7d446 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -301,6 +301,10 @@ void WebContentsViewAura::SetPageTitle(const string16& title) {
void WebContentsViewAura::OnTabCrashed(base::TerminationStatus status,
int error_code) {
view_ = NULL;
+ // Set the focus to the parent because neither the view window nor this
+ // window can handle key events.
+ if (window_->HasFocus() && window_->parent())
+ window_->parent()->Focus();
}
void WebContentsViewAura::SizeContents(const gfx::Size& size) {
@@ -569,7 +573,9 @@ ui::GestureStatus WebContentsViewAura::OnGestureEvent(
}
bool WebContentsViewAura::CanFocus() {
- return true;
+ // Do not take the focus if |view_| is gone because neither the view window
+ // nor this window can handle key events.
+ return view_ != NULL;
}
void WebContentsViewAura::OnCaptureLost() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698