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

Unified Diff: chrome/browser/views/constrained_window_impl.cc

Issue 8786: Fix default focused button in dialogs (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 | « no previous file | chrome/views/dialog_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/constrained_window_impl.cc
===================================================================
--- chrome/browser/views/constrained_window_impl.cc (revision 4259)
+++ chrome/browser/views/constrained_window_impl.cc (working copy)
@@ -868,8 +868,13 @@
// better find whether the inner window should get focus.
::SetFocus(constrained_contents_->GetContainerHWND());
} else {
- // Give our window the focus so we get keyboard messages.
- ::SetFocus(GetHWND());
+ views::View* view_to_focus = NULL;
+ if (window_delegate())
+ view_to_focus = window_delegate()->GetInitiallyFocusedView();
+ if (view_to_focus)
+ view_to_focus->RequestFocus();
+ else // Give our window the focus so we get keyboard messages.
+ ::SetFocus(GetHWND());
}
}
}
« no previous file with comments | « no previous file | chrome/views/dialog_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698