Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: chrome/browser/autocomplete/search_provider.cc

Issue 9419043: Revert 122412 - Enabled pressing TAB to traverse through the Omnibox results (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/autocomplete/search_provider.h" 5 #include "chrome/browser/autocomplete/search_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 // values preserve that property. Otherwise, if the user starts editing a 867 // values preserve that property. Otherwise, if the user starts editing a
868 // suggestion, non-Search results will suddenly appear. 868 // suggestion, non-Search results will suddenly appear.
869 size_t search_start = 0; 869 size_t search_start = 0;
870 if (input_.type() == AutocompleteInput::FORCED_QUERY) { 870 if (input_.type() == AutocompleteInput::FORCED_QUERY) {
871 match.fill_into_edit.assign(ASCIIToUTF16("?")); 871 match.fill_into_edit.assign(ASCIIToUTF16("?"));
872 ++search_start; 872 ++search_start;
873 } 873 }
874 if (is_keyword) { 874 if (is_keyword) {
875 match.fill_into_edit.append( 875 match.fill_into_edit.append(
876 providers_.keyword_provider().keyword() + char16(' ')); 876 providers_.keyword_provider().keyword() + char16(' '));
877 877 search_start += providers_.keyword_provider().keyword().size() + 1;
878 match.keyword = providers_.keyword_provider().keyword();
879 search_start += match.keyword.size() + 1;
880 } 878 }
881 match.fill_into_edit.append(query_string); 879 match.fill_into_edit.append(query_string);
882 // Not all suggestions start with the original input. 880 // Not all suggestions start with the original input.
883 if (!prevent_inline_autocomplete && 881 if (!prevent_inline_autocomplete &&
884 !match.fill_into_edit.compare(search_start, input_text.length(), 882 !match.fill_into_edit.compare(search_start, input_text.length(),
885 input_text)) 883 input_text))
886 match.inline_autocomplete_offset = search_start + input_text.length(); 884 match.inline_autocomplete_offset = search_start + input_text.length();
887 885
888 const TemplateURLRef* const search_url = provider.url(); 886 const TemplateURLRef* const search_url = provider.url();
889 DCHECK(search_url->SupportsReplacement()); 887 DCHECK(search_url->SupportsReplacement());
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 943
946 return match; 944 return match;
947 } 945 }
948 946
949 void SearchProvider::UpdateDone() { 947 void SearchProvider::UpdateDone() {
950 // We're done when there are no more suggest queries pending (this is set to 1 948 // We're done when there are no more suggest queries pending (this is set to 1
951 // when the timer is started) and we're not waiting on instant. 949 // when the timer is started) and we're not waiting on instant.
952 done_ = ((suggest_results_pending_ == 0) && 950 done_ = ((suggest_results_pending_ == 0) &&
953 (instant_finalized_ || !InstantController::IsEnabled(profile_))); 951 (instant_finalized_ || !InstantController::IsEnabled(profile_)));
954 } 952 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/keyword_provider_unittest.cc ('k') | chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698