| 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/search_suggestion_parser.h" | 5 #include "components/omnibox/search_suggestion_parser.h" |
| 6 | 6 |
| 7 #include "base/i18n/icu_string_conversions.h" | 7 #include "base/i18n/icu_string_conversions.h" |
| 8 #include "base/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 SearchSuggestionParser::Result::Result(bool from_keyword_provider, | 44 SearchSuggestionParser::Result::Result(bool from_keyword_provider, |
| 45 int relevance, | 45 int relevance, |
| 46 bool relevance_from_server, | 46 bool relevance_from_server, |
| 47 AutocompleteMatchType::Type type, | 47 AutocompleteMatchType::Type type, |
| 48 const std::string& deletion_url) | 48 const std::string& deletion_url) |
| 49 : from_keyword_provider_(from_keyword_provider), | 49 : from_keyword_provider_(from_keyword_provider), |
| 50 type_(type), | 50 type_(type), |
| 51 relevance_(relevance), | 51 relevance_(relevance), |
| 52 relevance_from_server_(relevance_from_server), | 52 relevance_from_server_(relevance_from_server), |
| 53 received_after_last_keystroke_(true), |
| 53 deletion_url_(deletion_url) {} | 54 deletion_url_(deletion_url) {} |
| 54 | 55 |
| 55 SearchSuggestionParser::Result::~Result() {} | 56 SearchSuggestionParser::Result::~Result() {} |
| 56 | 57 |
| 57 // SearchSuggestionParser::SuggestResult --------------------------------------- | 58 // SearchSuggestionParser::SuggestResult --------------------------------------- |
| 58 | 59 |
| 59 SearchSuggestionParser::SuggestResult::SuggestResult( | 60 SearchSuggestionParser::SuggestResult::SuggestResult( |
| 60 const base::string16& suggestion, | 61 const base::string16& suggestion, |
| 61 AutocompleteMatchType::Type type, | 62 AutocompleteMatchType::Type type, |
| 62 const base::string16& match_contents, | 63 const base::string16& match_contents, |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 // Concatenate scheme and host/path using only ':' as separator. This is | 504 // Concatenate scheme and host/path using only ':' as separator. This is |
| 504 // due to the results delivering strings of the form '//host/path', which | 505 // due to the results delivering strings of the form '//host/path', which |
| 505 // is web-speak for "use the enclosing page's scheme", but not a valid path | 506 // is web-speak for "use the enclosing page's scheme", but not a valid path |
| 506 // of an URL. | 507 // of an URL. |
| 507 GURL image_url( | 508 GURL image_url( |
| 508 GURL(std::string(url::kHttpsScheme) + ":" + image_host_and_path)); | 509 GURL(std::string(url::kHttpsScheme) + ":" + image_host_and_path)); |
| 509 if (image_url.is_valid()) | 510 if (image_url.is_valid()) |
| 510 urls->push_back(image_url); | 511 urls->push_back(image_url); |
| 511 } | 512 } |
| 512 } | 513 } |
| OLD | NEW |