Chromium Code Reviews| Index: chrome/browser/extensions/api/omnibox/omnibox_api.cc |
| diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.cc b/chrome/browser/extensions/api/omnibox/omnibox_api.cc |
| index a2eeb58c125449652f037feb8ce1196853554724..88b2016741227a9d8aa8f06d403e2feaa56a879a 100644 |
| --- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc |
| +++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc |
| @@ -320,20 +320,19 @@ ACMatchClassifications StyleTypesToACMatchClassifications( |
| base::string16 description = base::UTF8ToUTF16(suggestion.description); |
| std::vector<int> styles(description.length(), 0); |
| - for (std::vector<linked_ptr<omnibox::SuggestResult::DescriptionStylesType> > |
| - ::iterator i = suggestion.description_styles->begin(); |
| - i != suggestion.description_styles->end(); ++i) { |
| - omnibox::SuggestResult::DescriptionStylesType* style = i->get(); |
| - |
| + for (const omnibox::SuggestResult::DescriptionStylesType& style : |
| + *suggestion.description_styles) { |
| int length = description.length(); |
| - if (style->length) |
| - length = *style->length; |
| + if (style.length) |
| + length = *style.length; |
|
stevenjb
2016/03/29 00:52:37
nit: int length = style.length ? :
Devlin
2016/03/29 20:20:35
Done.
|
| - size_t offset = style->offset >= 0 ? style->offset : |
| - std::max(0, static_cast<int>(description.length()) + style->offset); |
| + size_t offset = style.offset >= 0 |
| + ? style.offset |
| + : std::max(0, static_cast<int>(description.length()) + |
|
stevenjb
2016/03/29 00:52:37
optional nit: clean this up too (casting seems bac
Devlin
2016/03/29 20:20:35
Wrong how?
stevenjb
2016/03/29 20:31:45
Oh, I guess we have to cast to an int to do the si
|
| + style.offset); |
| int type_class; |
| - switch (style->type) { |
| + switch (style.type) { |
| case omnibox::DESCRIPTION_STYLE_TYPE_URL: |
| type_class = AutocompleteMatch::ACMatchClassification::URL; |
| break; |