summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-09 21:31:56 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-09 21:31:56 +0000
commit28f180ecca4fda508a0f7b6c512051012d2036df (patch)
tree9aa18476ff2f85d6641dbaef0e1471ea2ca0ea6a
parent0ea674db243dd0dbc3a6e7e85e5509474fd09752 (diff)
downloadchromium_src-28f180ecca4fda508a0f7b6c512051012d2036df.zip
chromium_src-28f180ecca4fda508a0f7b6c512051012d2036df.tar.gz
chromium_src-28f180ecca4fda508a0f7b6c512051012d2036df.tar.bz2
The window class now set the initial focus after the window is made visible. The SetInitialFocus method needs to be changed to still work.
BUG=2519 TEST=Open Chrome, the location bar has focus, type something the drop down menu shows. Press ESC, the drop down menu should go. Review URL: http://codereview.chromium.org/7030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3130 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/views/window.cc15
1 files changed, 2 insertions, 13 deletions
diff --git a/chrome/views/window.cc b/chrome/views/window.cc
index 685545b..87c8f57 100644
--- a/chrome/views/window.cc
+++ b/chrome/views/window.cc
@@ -504,21 +504,10 @@ void Window::SetInitialFocus() {
if (!focus_on_creation_)
return;
- bool focus_set = false;
ChromeViews::View* v = window_delegate_->GetInitiallyFocusedView();
if (v) {
- focus_set = true;
- // In order to make that view the initially focused one, we make it the
- // focused view on the focus manager and we store the focused view.
- // When the window is activated, the focus manager will restore the
- // stored focused view.
- FocusManager* focus_manager = FocusManager::GetFocusManager(GetHWND());
- DCHECK(focus_manager);
- focus_manager->SetFocusedView(v);
- focus_manager->StoreFocusedView();
- }
-
- if (!focus_set && focus_on_creation_) {
+ v->RequestFocus();
+ } else {
// The window does not get keyboard messages unless we focus it, not sure
// why.
SetFocus(GetHWND());