| OLD | NEW |
| 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/keyword_provider.h" | 5 #include "components/omnibox/keyword_provider.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 // CleanUserInputKeyword() to return the amount of adjustment it's made to | 396 // CleanUserInputKeyword() to return the amount of adjustment it's made to |
| 397 // the user's input. Because right now inexact keyword matches can't score | 397 // the user's input. Because right now inexact keyword matches can't score |
| 398 // more highly than a "what you typed" match from one of the other providers, | 398 // more highly than a "what you typed" match from one of the other providers, |
| 399 // we just don't bother to do this, and leave inline autocompletion off. | 399 // we just don't bother to do this, and leave inline autocompletion off. |
| 400 | 400 |
| 401 // Create destination URL and popup entry content by substituting user input | 401 // Create destination URL and popup entry content by substituting user input |
| 402 // into keyword templates. | 402 // into keyword templates. |
| 403 FillInURLAndContents(remaining_input, template_url, &match); | 403 FillInURLAndContents(remaining_input, template_url, &match); |
| 404 | 404 |
| 405 match.keyword = keyword; | 405 match.keyword = keyword; |
| 406 match.transition = content::PAGE_TRANSITION_KEYWORD; | 406 match.transition = ui::PAGE_TRANSITION_KEYWORD; |
| 407 | 407 |
| 408 return match; | 408 return match; |
| 409 } | 409 } |
| 410 | 410 |
| 411 void KeywordProvider::FillInURLAndContents( | 411 void KeywordProvider::FillInURLAndContents( |
| 412 const base::string16& remaining_input, | 412 const base::string16& remaining_input, |
| 413 const TemplateURL* element, | 413 const TemplateURL* element, |
| 414 AutocompleteMatch* match) const { | 414 AutocompleteMatch* match) const { |
| 415 DCHECK(!element->short_name().empty()); | 415 DCHECK(!element->short_name().empty()); |
| 416 const TemplateURLRef& element_ref = element->url_ref(); | 416 const TemplateURLRef& element_ref = element->url_ref(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 ACMatchClassification::NONE, &match->contents_class); | 462 ACMatchClassification::NONE, &match->contents_class); |
| 463 } | 463 } |
| 464 } | 464 } |
| 465 | 465 |
| 466 TemplateURLService* KeywordProvider::GetTemplateURLService() const { | 466 TemplateURLService* KeywordProvider::GetTemplateURLService() const { |
| 467 // Make sure the model is loaded. This is cheap and quickly bails out if | 467 // Make sure the model is loaded. This is cheap and quickly bails out if |
| 468 // the model is already loaded. | 468 // the model is already loaded. |
| 469 model_->Load(); | 469 model_->Load(); |
| 470 return model_; | 470 return model_; |
| 471 } | 471 } |
| OLD | NEW |