diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 19:54:15 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 19:54:15 +0000 |
commit | e8a9a7472f544a839cbc47b8279d3ce99b0cf0a0 (patch) | |
tree | 8d784135c8791292a9413904f6b4dedbee89ab3a /chrome/browser/views/location_bar_view.cc | |
parent | 1e4a731e18cc375d537776576d379d4349c0b86c (diff) | |
download | chromium_src-e8a9a7472f544a839cbc47b8279d3ce99b0cf0a0.zip chromium_src-e8a9a7472f544a839cbc47b8279d3ce99b0cf0a0.tar.gz chromium_src-e8a9a7472f544a839cbc47b8279d3ce99b0cf0a0.tar.bz2 |
Refactoring some of the NativeViewHost and NativeControl focus management so their consumers don't have to explicitly set the focused view.
BUG=None
TEST=Run all tests. Make sure focus is stored/restored properly in Chrome.
Review URL: http://codereview.chromium.org/214029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27113 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/location_bar_view.cc')
-rw-r--r-- | chrome/browser/views/location_bar_view.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index 4becb2f..0bff973 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -157,6 +157,8 @@ void LocationBarView::Init() { location_entry_view_->SetID(VIEW_ID_AUTOCOMPLETE); AddChildView(location_entry_view_); location_entry_view_->set_focus_view(this); + location_entry_view_->set_focus_native_view(location_entry_-> + GetFocusNativeView()); location_entry_view_->Attach( #if defined(OS_WIN) location_entry_->m_hWnd @@ -290,8 +292,9 @@ void LocationBarView::InvalidatePageActions() { } void LocationBarView::Focus() { - // Focus the location entry native view. - location_entry_->SetFocus(); + // Forward the focus to the NativeViewHost that will focus the right + // native-view. + location_entry_view_->Focus(); } void LocationBarView::SetProfile(Profile* profile) { @@ -417,15 +420,6 @@ void LocationBarView::OnChanged() { DoLayout(false); } -void LocationBarView::OnSetFocus() { - views::FocusManager* focus_manager = GetFocusManager(); - if (!focus_manager) { - NOTREACHED(); - return; - } - focus_manager->SetFocusedView(this); -} - SkBitmap LocationBarView::GetFavIcon() const { DCHECK(delegate_); DCHECK(delegate_->GetTabContents()); |