| 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/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "chrome/browser/autocomplete/keyword_extensions_delegate.h" | 13 #include "chrome/browser/autocomplete/keyword_extensions_delegate.h" |
| 14 #include "components/metrics/proto/omnibox_input_type.pb.h" | 14 #include "components/metrics/proto/omnibox_input_type.pb.h" |
| 15 #include "components/omnibox/autocomplete_match.h" | 15 #include "components/omnibox/autocomplete_match.h" |
| 16 #include "components/omnibox/autocomplete_provider_listener.h" | 16 #include "components/omnibox/autocomplete_provider_listener.h" |
| 17 #include "components/search_engines/template_url.h" | 17 #include "components/search_engines/template_url.h" |
| 18 #include "components/search_engines/template_url_service.h" | 18 #include "components/search_engines/template_url_service.h" |
| 19 #include "grit/generated_resources.h" | 19 #include "grit/components_strings.h" |
| 20 #include "net/base/escape.h" | 20 #include "net/base/escape.h" |
| 21 #include "net/base/net_util.h" | 21 #include "net/base/net_util.h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 // Helper functor for Start(), for sorting keyword matches by quality. | 26 // Helper functor for Start(), for sorting keyword matches by quality. |
| 27 class CompareQuality { | 27 class CompareQuality { |
| 28 public: | 28 public: |
| 29 // A keyword is of higher quality when a greater fraction of it has been | 29 // A keyword is of higher quality when a greater fraction of it has been |
| (...skipping 432 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 |