diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-28 20:04:07 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-28 20:04:07 +0000 |
commit | 8768b4555d2ce58da02a5a51894f455cc2dfb158 (patch) | |
tree | d966e1281feb75b88391945e200ec6851b144017 /chrome/browser/ui/views/location_bar | |
parent | 8c23a87bd4f1c7aa5b7426bc6e0ab4f959669cbf (diff) | |
download | chromium_src-8768b4555d2ce58da02a5a51894f455cc2dfb158.zip chromium_src-8768b4555d2ce58da02a5a51894f455cc2dfb158.tar.gz chromium_src-8768b4555d2ce58da02a5a51894f455cc2dfb158.tar.bz2 |
Makes instant suggest commit immediately. If folks like this, I can
rip out some more code.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6360022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73006 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/location_bar')
-rw-r--r-- | chrome/browser/ui/views/location_bar/location_bar_view.cc | 49 |
1 files changed, 7 insertions, 42 deletions
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index 8dc3a25..fd84c69 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc @@ -1123,49 +1123,14 @@ void LocationBarView::ShowFirstRunBubble(FirstRun::BubbleType bubble_type) { } void LocationBarView::SetSuggestedText(const string16& input) { - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kInstantAutocompleteImmediately)) { - // This method is internally invoked to reset suggest text, so we only do - // anything if the text isn't empty. - // TODO: if we keep autocomplete, make it so this isn't invoked with empty - // text. - if (!input.empty()) { - location_entry_->model()->FinalizeInstantQuery( - location_entry_->GetText(), input, false); - } - return; + // This method is internally invoked to reset suggest text, so we only do + // anything if the text isn't empty. + // TODO: if we keep autocomplete, make it so this isn't invoked with empty + // text. + if (!input.empty()) { + location_entry_->model()->FinalizeInstantQuery(location_entry_->GetText(), + input, false); } -#if defined(OS_WIN) - // Don't show the suggested text if inline autocomplete is prevented. - string16 text = location_entry_->model()->UseVerbatimInstant() ? - string16() : input; - if (!text.empty()) { - if (!suggested_text_view_) { - suggested_text_view_ = new SuggestedTextView(this); - suggested_text_view_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); - suggested_text_view_->SetColor( - GetColor(ToolbarModel::NONE, - LocationBarView::DEEMPHASIZED_TEXT)); - suggested_text_view_->SetText(UTF16ToWide(text)); - suggested_text_view_->SetFont(location_entry_->GetFont()); - AddChildView(suggested_text_view_); - } else if (suggested_text_view_->GetText() != UTF16ToWide(text)) { - suggested_text_view_->SetText(UTF16ToWide(text)); - } - if (!location_entry_->IsImeComposing()) - suggested_text_view_->StartAnimation(); - } else if (suggested_text_view_) { - delete suggested_text_view_; - suggested_text_view_ = NULL; - } else { - return; - } - - Layout(); - SchedulePaint(); -#else - location_entry_->SetInstantSuggestion(input); -#endif } std::wstring LocationBarView::GetInputString() const { |