OLD | NEW |
---|---|
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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
388 AutocompleteMatch::ClassifyLocationInString(0, match->contents.length(), | 388 AutocompleteMatch::ClassifyLocationInString(0, match->contents.length(), |
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( |
Peter Kasting
2012/06/16 03:14:17
Nit: Can this now be wrapped after '=' instead?
Bart N
2012/06/16 23:38:10
Not after I moved Args inside URLRef.
| |
399 remaining_input, TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16())); | 399 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 Loading... | |
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 } |
OLD | NEW |