| 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/autocomplete_match.h" | 13 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 14 #include "chrome/browser/autocomplete/autocomplete_provider_listener.h" | 14 #include "chrome/browser/autocomplete/autocomplete_provider_listener.h" |
| 15 #include "chrome/browser/autocomplete/keyword_extensions_delegate.h" | 15 #include "chrome/browser/autocomplete/keyword_extensions_delegate.h" |
| 16 #include "chrome/browser/chrome_notification_types.h" | 16 #include "chrome/browser/chrome_notification_types.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/search_engines/template_url_service.h" | |
| 19 #include "chrome/browser/search_engines/template_url_service_factory.h" | 18 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 20 #include "components/metrics/proto/omnibox_input_type.pb.h" | 19 #include "components/metrics/proto/omnibox_input_type.pb.h" |
| 21 #include "components/search_engines/template_url.h" | 20 #include "components/search_engines/template_url.h" |
| 21 #include "components/search_engines/template_url_service.h" |
| 22 #include "content/public/browser/notification_details.h" | 22 #include "content/public/browser/notification_details.h" |
| 23 #include "content/public/browser/notification_source.h" | 23 #include "content/public/browser/notification_source.h" |
| 24 #include "extensions/browser/extension_system.h" | 24 #include "extensions/browser/extension_system.h" |
| 25 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 26 #include "net/base/escape.h" | 26 #include "net/base/escape.h" |
| 27 #include "net/base/net_util.h" | 27 #include "net/base/net_util.h" |
| 28 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
| 29 | 29 |
| 30 #if defined(ENABLE_EXTENSIONS) | 30 #if defined(ENABLE_EXTENSIONS) |
| 31 #include "chrome/browser/autocomplete/keyword_extensions_delegate_impl.h" | 31 #include "chrome/browser/autocomplete/keyword_extensions_delegate_impl.h" |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 | 485 |
| 486 TemplateURLService* KeywordProvider::GetTemplateURLService() const { | 486 TemplateURLService* KeywordProvider::GetTemplateURLService() const { |
| 487 TemplateURLService* service = profile_ ? | 487 TemplateURLService* service = profile_ ? |
| 488 TemplateURLServiceFactory::GetForProfile(profile_) : model_; | 488 TemplateURLServiceFactory::GetForProfile(profile_) : model_; |
| 489 // Make sure the model is loaded. This is cheap and quickly bails out if | 489 // Make sure the model is loaded. This is cheap and quickly bails out if |
| 490 // the model is already loaded. | 490 // the model is already loaded. |
| 491 DCHECK(service); | 491 DCHECK(service); |
| 492 service->Load(); | 492 service->Load(); |
| 493 return service; | 493 return service; |
| 494 } | 494 } |
| OLD | NEW |