Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: components/omnibox/search_suggestion_parser.cc

Issue 471673002: Omnibox: Prevent Asynchronous Suggestions from Changing Default Match (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better resolve rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 SearchSuggestionParser::Result::Result(bool from_keyword_provider, 43 SearchSuggestionParser::Result::Result(bool from_keyword_provider,
44 int relevance, 44 int relevance,
45 bool relevance_from_server, 45 bool relevance_from_server,
46 AutocompleteMatchType::Type type, 46 AutocompleteMatchType::Type type,
47 const std::string& deletion_url) 47 const std::string& deletion_url)
48 : from_keyword_provider_(from_keyword_provider), 48 : from_keyword_provider_(from_keyword_provider),
49 type_(type), 49 type_(type),
50 relevance_(relevance), 50 relevance_(relevance),
51 relevance_from_server_(relevance_from_server), 51 relevance_from_server_(relevance_from_server),
52 received_after_last_keystroke_(true),
msw 2014/08/15 21:04:39 Is there any case beyond history that generates sy
Mark P 2014/08/15 22:09:22 Good point. I used code search and discovered Sho
msw 2014/08/15 23:31:10 Acknowledged.
52 deletion_url_(deletion_url) {} 53 deletion_url_(deletion_url) {}
53 54
54 SearchSuggestionParser::Result::~Result() {} 55 SearchSuggestionParser::Result::~Result() {}
55 56
56 // SearchSuggestionParser::SuggestResult --------------------------------------- 57 // SearchSuggestionParser::SuggestResult ---------------------------------------
57 58
58 SearchSuggestionParser::SuggestResult::SuggestResult( 59 SearchSuggestionParser::SuggestResult::SuggestResult(
59 const base::string16& suggestion, 60 const base::string16& suggestion,
60 AutocompleteMatchType::Type type, 61 AutocompleteMatchType::Type type,
61 const base::string16& match_contents, 62 const base::string16& match_contents,
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 continue; 496 continue;
496 const base::DictionaryValue* imageData = NULL; 497 const base::DictionaryValue* imageData = NULL;
497 imageLine->GetDictionary("i", &imageData); 498 imageLine->GetDictionary("i", &imageData);
498 if (!imageData) 499 if (!imageData)
499 continue; 500 continue;
500 std::string imageUrl; 501 std::string imageUrl;
501 imageData->GetString("d", &imageUrl); 502 imageData->GetString("d", &imageUrl);
502 urls->push_back(GURL(imageUrl)); 503 urls->push_back(GURL(imageUrl));
503 } 504 }
504 } 505 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698