| 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/base_search_provider.h" | 5 #include "components/omnibox/base_search_provider.h" |
| 6 | 6 |
| 7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "components/metrics/proto/omnibox_event.pb.h" | 10 #include "components/metrics/proto/omnibox_event.pb.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 append_extra_query_params; | 261 append_extra_query_params; |
| 262 // This is the destination URL sans assisted query stats. This must be set | 262 // This is the destination URL sans assisted query stats. This must be set |
| 263 // so the AutocompleteController can properly de-dupe; the controller will | 263 // so the AutocompleteController can properly de-dupe; the controller will |
| 264 // eventually overwrite it before it reaches the user. | 264 // eventually overwrite it before it reaches the user. |
| 265 match.destination_url = | 265 match.destination_url = |
| 266 GURL(search_url.ReplaceSearchTerms(*match.search_terms_args.get(), | 266 GURL(search_url.ReplaceSearchTerms(*match.search_terms_args.get(), |
| 267 search_terms_data)); | 267 search_terms_data)); |
| 268 | 268 |
| 269 // Search results don't look like URLs. | 269 // Search results don't look like URLs. |
| 270 match.transition = suggestion.from_keyword_provider() ? | 270 match.transition = suggestion.from_keyword_provider() ? |
| 271 content::PAGE_TRANSITION_KEYWORD : content::PAGE_TRANSITION_GENERATED; | 271 ui::PAGE_TRANSITION_KEYWORD : ui::PAGE_TRANSITION_GENERATED; |
| 272 | 272 |
| 273 return match; | 273 return match; |
| 274 } | 274 } |
| 275 | 275 |
| 276 // static | 276 // static |
| 277 bool BaseSearchProvider::ZeroSuggestEnabled( | 277 bool BaseSearchProvider::ZeroSuggestEnabled( |
| 278 const GURL& suggest_url, | 278 const GURL& suggest_url, |
| 279 const TemplateURL* template_url, | 279 const TemplateURL* template_url, |
| 280 OmniboxEventProto::PageClassification page_classification, | 280 OmniboxEventProto::PageClassification page_classification, |
| 281 const SearchTermsData& search_terms_data, | 281 const SearchTermsData& search_terms_data, |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 } | 460 } |
| 461 | 461 |
| 462 void BaseSearchProvider::OnDeletionComplete( | 462 void BaseSearchProvider::OnDeletionComplete( |
| 463 bool success, SuggestionDeletionHandler* handler) { | 463 bool success, SuggestionDeletionHandler* handler) { |
| 464 RecordDeletionResult(success); | 464 RecordDeletionResult(success); |
| 465 SuggestionDeletionHandlers::iterator it = std::find( | 465 SuggestionDeletionHandlers::iterator it = std::find( |
| 466 deletion_handlers_.begin(), deletion_handlers_.end(), handler); | 466 deletion_handlers_.begin(), deletion_handlers_.end(), handler); |
| 467 DCHECK(it != deletion_handlers_.end()); | 467 DCHECK(it != deletion_handlers_.end()); |
| 468 deletion_handlers_.erase(it); | 468 deletion_handlers_.erase(it); |
| 469 } | 469 } |
| OLD | NEW |