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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_match.cc

Issue 55413002: Don't demote top match for certain match types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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
OLDNEW
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/autocomplete_match.h" 5 #include "chrome/browser/autocomplete/autocomplete_match.h"
6 6
7 #include "base/i18n/time_formatting.h" 7 #include "base/i18n/time_formatting.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 26 matching lines...) Expand all
37 0x2029, // Paragraph separator 37 0x2029, // Paragraph separator
38 0 38 0
39 }; 39 };
40 40
41 AutocompleteMatch::AutocompleteMatch() 41 AutocompleteMatch::AutocompleteMatch()
42 : provider(NULL), 42 : provider(NULL),
43 relevance(0), 43 relevance(0),
44 typed_count(-1), 44 typed_count(-1),
45 deletable(false), 45 deletable(false),
46 allowed_to_be_default_match(false), 46 allowed_to_be_default_match(false),
47 demoteable(true),
47 transition(content::PAGE_TRANSITION_GENERATED), 48 transition(content::PAGE_TRANSITION_GENERATED),
48 is_history_what_you_typed_match(false), 49 is_history_what_you_typed_match(false),
49 type(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED), 50 type(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED),
50 starred(false), 51 starred(false),
51 from_previous(false) { 52 from_previous(false) {
52 } 53 }
53 54
54 AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider, 55 AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider,
55 int relevance, 56 int relevance,
56 bool deletable, 57 bool deletable,
57 Type type) 58 Type type)
58 : provider(provider), 59 : provider(provider),
59 relevance(relevance), 60 relevance(relevance),
60 typed_count(-1), 61 typed_count(-1),
61 deletable(deletable), 62 deletable(deletable),
62 allowed_to_be_default_match(false), 63 allowed_to_be_default_match(false),
64 demoteable(true),
63 transition(content::PAGE_TRANSITION_TYPED), 65 transition(content::PAGE_TRANSITION_TYPED),
64 is_history_what_you_typed_match(false), 66 is_history_what_you_typed_match(false),
65 type(type), 67 type(type),
66 starred(false), 68 starred(false),
67 from_previous(false) { 69 from_previous(false) {
68 } 70 }
69 71
70 AutocompleteMatch::AutocompleteMatch(const AutocompleteMatch& match) 72 AutocompleteMatch::AutocompleteMatch(const AutocompleteMatch& match)
71 : provider(match.provider), 73 : provider(match.provider),
72 relevance(match.relevance), 74 relevance(match.relevance),
73 typed_count(match.typed_count), 75 typed_count(match.typed_count),
74 deletable(match.deletable), 76 deletable(match.deletable),
75 fill_into_edit(match.fill_into_edit), 77 fill_into_edit(match.fill_into_edit),
76 inline_autocompletion(match.inline_autocompletion), 78 inline_autocompletion(match.inline_autocompletion),
77 allowed_to_be_default_match(match.allowed_to_be_default_match), 79 allowed_to_be_default_match(match.allowed_to_be_default_match),
80 demoteable(match.demoteable),
78 destination_url(match.destination_url), 81 destination_url(match.destination_url),
79 stripped_destination_url(match.stripped_destination_url), 82 stripped_destination_url(match.stripped_destination_url),
80 contents(match.contents), 83 contents(match.contents),
81 contents_class(match.contents_class), 84 contents_class(match.contents_class),
82 description(match.description), 85 description(match.description),
83 description_class(match.description_class), 86 description_class(match.description_class),
84 transition(match.transition), 87 transition(match.transition),
85 is_history_what_you_typed_match(match.is_history_what_you_typed_match), 88 is_history_what_you_typed_match(match.is_history_what_you_typed_match),
86 type(match.type), 89 type(match.type),
87 associated_keyword(match.associated_keyword.get() ? 90 associated_keyword(match.associated_keyword.get() ?
(...skipping 15 matching lines...) Expand all
103 if (this == &match) 106 if (this == &match)
104 return *this; 107 return *this;
105 108
106 provider = match.provider; 109 provider = match.provider;
107 relevance = match.relevance; 110 relevance = match.relevance;
108 typed_count = match.typed_count; 111 typed_count = match.typed_count;
109 deletable = match.deletable; 112 deletable = match.deletable;
110 fill_into_edit = match.fill_into_edit; 113 fill_into_edit = match.fill_into_edit;
111 inline_autocompletion = match.inline_autocompletion; 114 inline_autocompletion = match.inline_autocompletion;
112 allowed_to_be_default_match = match.allowed_to_be_default_match; 115 allowed_to_be_default_match = match.allowed_to_be_default_match;
116 demoteable = match.demoteable;
113 destination_url = match.destination_url; 117 destination_url = match.destination_url;
114 stripped_destination_url = match.stripped_destination_url; 118 stripped_destination_url = match.stripped_destination_url;
115 contents = match.contents; 119 contents = match.contents;
116 contents_class = match.contents_class; 120 contents_class = match.contents_class;
117 description = match.description; 121 description = match.description;
118 description_class = match.description_class; 122 description_class = match.description_class;
119 transition = match.transition; 123 transition = match.transition;
120 is_history_what_you_typed_match = match.is_history_what_you_typed_match; 124 is_history_what_you_typed_match = match.is_history_what_you_typed_match;
121 type = match.type; 125 type = match.type;
122 associated_keyword.reset(match.associated_keyword.get() ? 126 associated_keyword.reset(match.associated_keyword.get() ?
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 << " is unsorted in relation to last offset of " << last_offset 489 << " is unsorted in relation to last offset of " << last_offset
486 << ". Provider: " << provider_name << "."; 490 << ". Provider: " << provider_name << ".";
487 DCHECK_LT(i->offset, text.length()) 491 DCHECK_LT(i->offset, text.length())
488 << " Classification of [" << i->offset << "," << text.length() 492 << " Classification of [" << i->offset << "," << text.length()
489 << "] is out of bounds for \"" << text << "\". Provider: " 493 << "] is out of bounds for \"" << text << "\". Provider: "
490 << provider_name << "."; 494 << provider_name << ".";
491 last_offset = i->offset; 495 last_offset = i->offset;
492 } 496 }
493 } 497 }
494 #endif 498 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698