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

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

Issue 10537154: A working implementation of AQS (Assisted Query Stats). (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Addressed comments and added more docs. Created 8 years, 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/keyword_provider.h" 5 #include "chrome/browser/autocomplete/keyword_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 match->contents.length(), ACMatchClassification::NONE, 389 match->contents.length(), ACMatchClassification::NONE,
390 &match->contents_class); 390 &match->contents_class);
391 } 391 }
392 } else { 392 } else {
393 // Create destination URL by escaping user input and substituting into 393 // Create destination URL by escaping user input and substituting into
394 // keyword template URL. The escaping here handles whitespace in user 394 // keyword template URL. The escaping here handles whitespace in user
395 // input, but we rely on later canonicalization functions to do more 395 // input, but we rely on later canonicalization functions to do more
396 // fixup to make the URL valid if necessary. 396 // fixup to make the URL valid if necessary.
397 DCHECK(element_ref.SupportsReplacement()); 397 DCHECK(element_ref.SupportsReplacement());
398 match->destination_url = GURL(element_ref.ReplaceSearchTerms( 398 match->destination_url = GURL(element_ref.ReplaceSearchTerms(
399 remaining_input, TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16())); 399 TemplateURLRef::SearchTermsArgs(remaining_input)));
400 std::vector<size_t> content_param_offsets; 400 std::vector<size_t> content_param_offsets;
401 match->contents.assign(l10n_util::GetStringFUTF16(message_id, 401 match->contents.assign(l10n_util::GetStringFUTF16(message_id,
402 element->short_name(), 402 element->short_name(),
403 remaining_input, 403 remaining_input,
404 &content_param_offsets)); 404 &content_param_offsets));
405 if (content_param_offsets.size() == 2) { 405 if (content_param_offsets.size() == 2) {
406 AutocompleteMatch::ClassifyLocationInString(content_param_offsets[1], 406 AutocompleteMatch::ClassifyLocationInString(content_param_offsets[1],
407 remaining_input.length(), match->contents.length(), 407 remaining_input.length(), match->contents.length(),
408 ACMatchClassification::NONE, &match->contents_class); 408 ACMatchClassification::NONE, &match->contents_class);
409 } else { 409 } else {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 } 579 }
580 580
581 void KeywordProvider::MaybeEndExtensionKeywordMode() { 581 void KeywordProvider::MaybeEndExtensionKeywordMode() {
582 if (!current_keyword_extension_id_.empty()) { 582 if (!current_keyword_extension_id_.empty()) {
583 extensions::ExtensionOmniboxEventRouter::OnInputCancelled( 583 extensions::ExtensionOmniboxEventRouter::OnInputCancelled(
584 profile_, current_keyword_extension_id_); 584 profile_, current_keyword_extension_id_);
585 585
586 current_keyword_extension_id_.clear(); 586 current_keyword_extension_id_.clear();
587 } 587 }
588 } 588 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_unittest.cc ('k') | chrome/browser/autocomplete/search_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698