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

Side by Side Diff: components/omnibox/browser/base_search_provider.cc

Issue 2854423002: [omnibox] Use suggestion instead of input for base text (Closed)
Patch Set: Remove redundant class Created 3 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/omnibox/browser/base_search_provider.h" 5 #include "components/omnibox/browser/base_search_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 if (!template_url) 246 if (!template_url)
247 return match; 247 return match;
248 match.keyword = template_url->keyword(); 248 match.keyword = template_url->keyword();
249 match.contents = suggestion.match_contents(); 249 match.contents = suggestion.match_contents();
250 match.contents_class = suggestion.match_contents_class(); 250 match.contents_class = suggestion.match_contents_class();
251 match.answer_contents = suggestion.answer_contents(); 251 match.answer_contents = suggestion.answer_contents();
252 match.answer_type = suggestion.answer_type(); 252 match.answer_type = suggestion.answer_type();
253 match.answer = SuggestionAnswer::copy(suggestion.answer()); 253 match.answer = SuggestionAnswer::copy(suggestion.answer());
254 match.subtype_identifier = suggestion.subtype_identifier(); 254 match.subtype_identifier = suggestion.subtype_identifier();
255 if (suggestion.type() == AutocompleteMatchType::SEARCH_SUGGEST_TAIL) { 255 if (suggestion.type() == AutocompleteMatchType::SEARCH_SUGGEST_TAIL) {
256 match.RecordAdditionalInfo( 256 match.RecordAdditionalInfo(kACMatchPropertySuggestionText,
257 kACMatchPropertyInputText, base::UTF16ToUTF8(input.text())); 257 base::UTF16ToUTF8(suggestion.suggestion()));
258 match.RecordAdditionalInfo( 258 match.RecordAdditionalInfo(
259 kACMatchPropertyContentsPrefix, 259 kACMatchPropertyContentsPrefix,
260 base::UTF16ToUTF8(suggestion.match_contents_prefix())); 260 base::UTF16ToUTF8(suggestion.match_contents_prefix()));
261 match.RecordAdditionalInfo( 261 match.RecordAdditionalInfo(
262 kACMatchPropertyContentsStartIndex, 262 kACMatchPropertyContentsStartIndex,
263 static_cast<int>( 263 static_cast<int>(
264 suggestion.suggestion().length() - match.contents.length())); 264 suggestion.suggestion().length() - match.contents.length()));
265 } 265 }
266 266
267 if (!suggestion.annotation().empty()) { 267 if (!suggestion.annotation().empty()) {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 518
519 void BaseSearchProvider::OnDeletionComplete( 519 void BaseSearchProvider::OnDeletionComplete(
520 bool success, SuggestionDeletionHandler* handler) { 520 bool success, SuggestionDeletionHandler* handler) {
521 RecordDeletionResult(success); 521 RecordDeletionResult(success);
522 deletion_handlers_.erase(std::remove_if( 522 deletion_handlers_.erase(std::remove_if(
523 deletion_handlers_.begin(), deletion_handlers_.end(), 523 deletion_handlers_.begin(), deletion_handlers_.end(),
524 [handler](const std::unique_ptr<SuggestionDeletionHandler>& elem) { 524 [handler](const std::unique_ptr<SuggestionDeletionHandler>& elem) {
525 return elem.get() == handler; 525 return elem.get() == handler;
526 })); 526 }));
527 } 527 }
OLDNEW
« no previous file with comments | « components/omnibox/browser/autocomplete_match.h ('k') | components/omnibox/browser/base_search_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698