OLD | NEW |
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/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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 // more highly than a "what you typed" match from one of the other providers, | 428 // more highly than a "what you typed" match from one of the other providers, |
429 // we just don't bother to do this, and leave inline autocompletion off. | 429 // we just don't bother to do this, and leave inline autocompletion off. |
430 result.inline_autocomplete_offset = string16::npos; | 430 result.inline_autocomplete_offset = string16::npos; |
431 | 431 |
432 // Create destination URL and popup entry content by substituting user input | 432 // Create destination URL and popup entry content by substituting user input |
433 // into keyword templates. | 433 // into keyword templates. |
434 FillInURLAndContents(profile_, remaining_input, element, &result); | 434 FillInURLAndContents(profile_, remaining_input, element, &result); |
435 | 435 |
436 if (supports_replacement) | 436 if (supports_replacement) |
437 result.template_url = element; | 437 result.template_url = element; |
438 result.transition = PageTransition::KEYWORD; | 438 result.transition = content::PAGE_TRANSITION_KEYWORD; |
439 | 439 |
440 return result; | 440 return result; |
441 } | 441 } |
442 | 442 |
443 void KeywordProvider::Observe(int type, | 443 void KeywordProvider::Observe(int type, |
444 const NotificationSource& source, | 444 const NotificationSource& source, |
445 const NotificationDetails& details) { | 445 const NotificationDetails& details) { |
446 TemplateURLService* model = | 446 TemplateURLService* model = |
447 profile_ ? TemplateURLServiceFactory::GetForProfile(profile_) : model_; | 447 profile_ ? TemplateURLServiceFactory::GetForProfile(profile_) : model_; |
448 const AutocompleteInput& input = extension_suggest_last_input_; | 448 const AutocompleteInput& input = extension_suggest_last_input_; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 } | 531 } |
532 | 532 |
533 void KeywordProvider::MaybeEndExtensionKeywordMode() { | 533 void KeywordProvider::MaybeEndExtensionKeywordMode() { |
534 if (!current_keyword_extension_id_.empty()) { | 534 if (!current_keyword_extension_id_.empty()) { |
535 ExtensionOmniboxEventRouter::OnInputCancelled( | 535 ExtensionOmniboxEventRouter::OnInputCancelled( |
536 profile_, current_keyword_extension_id_); | 536 profile_, current_keyword_extension_id_); |
537 | 537 |
538 current_keyword_extension_id_.clear(); | 538 current_keyword_extension_id_.clear(); |
539 } | 539 } |
540 } | 540 } |
OLD | NEW |