diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-30 18:47:53 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-30 18:47:53 +0000 |
commit | 7975e68dbf02663c3ffbb96106e8ddb509a6f332 (patch) | |
tree | ad58271c22db3a7956434de0bb2387dbf4ffd185 | |
parent | bcc94a375c5fd8385473dbaabb3df75151aae17b (diff) | |
download | chromium_src-7975e68dbf02663c3ffbb96106e8ddb509a6f332.zip chromium_src-7975e68dbf02663c3ffbb96106e8ddb509a6f332.tar.gz chromium_src-7975e68dbf02663c3ffbb96106e8ddb509a6f332.tar.bz2 |
The NativeButton HWND would not be created yet when we were setting the initial focus in the first run bubble view.
This CL makes sure to set the focus when everything is set-up.
BUG=9387
TEST=Run chrome to show the first run bubble (you can use the --first-run parameter). When Chrome comes-up, it shows the "Search from here" info bubble. The focus should be on the "Keep Google..." button.
Review URL: http://codereview.chromium.org/55019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12790 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/views/first_run_bubble.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/views/first_run_bubble.cc b/chrome/browser/views/first_run_bubble.cc index 6f06973..31c4432 100644 --- a/chrome/browser/views/first_run_bubble.cc +++ b/chrome/browser/views/first_run_bubble.cc @@ -99,6 +99,10 @@ class FirstRunBubbleView : public views::View, AddChildView(change_button_); } + void BubbleShown() { + keep_button_->RequestFocus(); + } + // Overridden from ButtonListener. virtual void ButtonPressed(views::Button* sender) { bubble_window_->Close(); @@ -153,11 +157,6 @@ class FirstRunBubbleView : public views::View, pref_size.width(), pref_size.height()); } - virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child) { - if (keep_button_) - keep_button_->RequestFocus(); - } - // Overridden from views::View. virtual gfx::Size GetPreferredSize() { return gfx::Size(views::Window::GetLocalizedContentsSize( @@ -237,6 +236,7 @@ FirstRunBubble* FirstRunBubble::Show(Profile* profile, HWND parent_hwnd, views::FocusManager* focus_manager = views::FocusManager::GetFocusManager(window->GetNativeView()); focus_manager->AddFocusChangeListener(view); + view->BubbleShown(); return window; } |