diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-23 03:29:11 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-23 03:29:11 +0000 |
commit | e80a42b2517ee31d28db08f60ff9322c3d704806 (patch) | |
tree | 349c86c71db465f322cac0dda6580fbe593cfa55 /chrome/browser/views | |
parent | 33551efc75fe523dfaa1f9a6d36696e431324fd0 (diff) | |
download | chromium_src-e80a42b2517ee31d28db08f60ff9322c3d704806.zip chromium_src-e80a42b2517ee31d28db08f60ff9322c3d704806.tar.gz chromium_src-e80a42b2517ee31d28db08f60ff9322c3d704806.tar.bz2 |
Makes right arrow in omnibox commit suggest results.
BUG=54833
TEST=none
Review URL: http://codereview.chromium.org/3493002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60255 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/location_bar/location_bar_view.cc | 13 | ||||
-rw-r--r-- | chrome/browser/views/location_bar/location_bar_view.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/views/location_bar/location_bar_view.cc b/chrome/browser/views/location_bar/location_bar_view.cc index 193408a..d6730ca 100644 --- a/chrome/browser/views/location_bar/location_bar_view.cc +++ b/chrome/browser/views/location_bar/location_bar_view.cc @@ -746,6 +746,19 @@ void LocationBarView::OnAutocompleteWillAccept() { update_match_preview_ = false; } +bool LocationBarView::OnCommitSuggestedText(const std::wstring& typed_text) { + MatchPreview* match_preview = delegate_->GetMatchPreview(); + if (!match_preview || !suggested_text_view_ || + suggested_text_view_->size().IsEmpty() || + suggested_text_view_->GetText().empty()) { + return false; + } + // TODO(sky): I may need to route this through MatchPreview so that we don't + // fetch suggestions for the new combined text. + location_entry_->SetUserText(typed_text + suggested_text_view_->GetText()); + return true; +} + void LocationBarView::OnPopupBoundsChanged(const gfx::Rect& bounds) { MatchPreview* match_preview = delegate_->GetMatchPreview(); if (match_preview) diff --git a/chrome/browser/views/location_bar/location_bar_view.h b/chrome/browser/views/location_bar/location_bar_view.h index dd01100..1daf264 100644 --- a/chrome/browser/views/location_bar/location_bar_view.h +++ b/chrome/browser/views/location_bar/location_bar_view.h @@ -178,6 +178,7 @@ class LocationBarView : public LocationBar, virtual void OnAutocompleteWillClosePopup(); virtual void OnAutocompleteLosingFocus(gfx::NativeView view_gaining_focus); virtual void OnAutocompleteWillAccept(); + virtual bool OnCommitSuggestedText(const std::wstring& typed_text); virtual void OnPopupBoundsChanged(const gfx::Rect& bounds); virtual void OnAutocompleteAccept(const GURL& url, WindowOpenDisposition disposition, |