| 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 "chrome/browser/autocomplete/base_search_provider.h" | 5 #include "chrome/browser/autocomplete/base_search_provider.h" |
| 6 | 6 |
| 7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
| 8 #include "base/i18n/icu_string_conversions.h" | 8 #include "base/i18n/icu_string_conversions.h" |
| 9 #include "base/json/json_string_value_serializer.h" | 9 #include "base/json/json_string_value_serializer.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/sync/profile_sync_service.h" | 24 #include "chrome/browser/sync/profile_sync_service.h" |
| 25 #include "chrome/browser/sync/profile_sync_service_factory.h" | 25 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 26 #include "chrome/common/net/url_fixer_upper.h" | 26 #include "chrome/common/net/url_fixer_upper.h" |
| 27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "components/sync_driver/sync_prefs.h" | 28 #include "components/sync_driver/sync_prefs.h" |
| 29 #include "content/public/common/url_constants.h" | 29 #include "content/public/common/url_constants.h" |
| 30 #include "net/base/escape.h" | 30 #include "net/base/escape.h" |
| 31 #include "net/base/net_util.h" | 31 #include "net/base/net_util.h" |
| 32 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 32 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 33 #include "net/http/http_response_headers.h" | 33 #include "net/http/http_response_headers.h" |
| 34 #include "net/url_request/url_fetcher.h" | |
| 35 #include "net/url_request/url_fetcher_delegate.h" | 34 #include "net/url_request/url_fetcher_delegate.h" |
| 36 #include "url/gurl.h" | 35 #include "url/gurl.h" |
| 37 | 36 |
| 38 namespace { | 37 namespace { |
| 39 | 38 |
| 40 AutocompleteMatchType::Type GetAutocompleteMatchType(const std::string& type) { | 39 AutocompleteMatchType::Type GetAutocompleteMatchType(const std::string& type) { |
| 41 if (type == "ENTITY") | 40 if (type == "ENTITY") |
| 42 return AutocompleteMatchType::SEARCH_SUGGEST_ENTITY; | 41 return AutocompleteMatchType::SEARCH_SUGGEST_ENTITY; |
| 43 if (type == "INFINITE") | 42 if (type == "INFINITE") |
| 44 return AutocompleteMatchType::SEARCH_SUGGEST_INFINITE; | 43 return AutocompleteMatchType::SEARCH_SUGGEST_INFINITE; |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 } | 898 } |
| 900 | 899 |
| 901 void BaseSearchProvider::OnDeletionComplete( | 900 void BaseSearchProvider::OnDeletionComplete( |
| 902 bool success, SuggestionDeletionHandler* handler) { | 901 bool success, SuggestionDeletionHandler* handler) { |
| 903 RecordDeletionResult(success); | 902 RecordDeletionResult(success); |
| 904 SuggestionDeletionHandlers::iterator it = std::find( | 903 SuggestionDeletionHandlers::iterator it = std::find( |
| 905 deletion_handlers_.begin(), deletion_handlers_.end(), handler); | 904 deletion_handlers_.begin(), deletion_handlers_.end(), handler); |
| 906 DCHECK(it != deletion_handlers_.end()); | 905 DCHECK(it != deletion_handlers_.end()); |
| 907 deletion_handlers_.erase(it); | 906 deletion_handlers_.erase(it); |
| 908 } | 907 } |
| OLD | NEW |