Index: chrome/browser/ui/views/find_bar_view.cc |
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc |
index 2920f2a95d137ebc9a1c37ca66968f6d944a76eb..edcf56cf98b9acd57c23124acb8ffbee87228709 100644 |
--- a/chrome/browser/ui/views/find_bar_view.cc |
+++ b/chrome/browser/ui/views/find_bar_view.cc |
@@ -26,6 +26,7 @@ |
#include "views/background.h" |
#include "views/controls/button/image_button.h" |
#include "views/controls/label.h" |
+#include "views/focus/focus_manager.h" |
#include "views/widget/widget.h" |
// The amount of whitespace to have before the find button. |
@@ -223,7 +224,13 @@ void FindBarView::UpdateForResult(const FindNotificationDetails& result, |
} |
void FindBarView::SetFocusAndSelection(bool select_all) { |
+ DCHECK(find_text_); |
Finnur
2010/11/15 14:49:12
This is redundant and just adds cruft to debug bui
altimofeev
2010/11/15 15:36:19
Done.
|
find_text_->RequestFocus(); |
+ // Storing is needed here because view that has focus before wrench menu |
+ // activation will be activated just after wrench menu is closed. FindBar |
+ // has it's own focus tracker, so it will focus correct view on close. |
Finnur
2010/11/15 14:49:12
nit: I count four instances of the word 'the' bein
altimofeev
2010/11/15 15:36:19
Thanks, will try to improve my grammar.
|
+ DCHECK(find_text_->GetFocusManager()); |
Finnur
2010/11/15 14:49:12
Same here (don't need the DCHECK)
altimofeev
2010/11/15 15:36:19
Done.
|
+ find_text_->GetFocusManager()->StoreFocusedView(); |
Finnur
2010/11/15 14:49:12
Make sure the following use case works (I think yo
altimofeev
2010/11/15 15:36:19
I have tried your use case. The focus behaves as i
|
if (select_all && !find_text_->text().empty()) |
find_text_->SelectAll(); |
} |