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

Unified Diff: chrome/browser/extensions/api/omnibox/omnibox_api.cc

Issue 1833773002: [Extensions] Convert APIs to use movable types [8] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698