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

Side by Side Diff: components/omnibox/browser/suggestion_answer.cc

Issue 1548203002: Convert Pass()→std::move() in //components/[n-z]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad headers Created 4 years, 12 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
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/browser/suggestion_answer.h" 5 #include "components/omnibox/browser/suggestion_answer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 const base::DictionaryValue* first_line_json; 191 const base::DictionaryValue* first_line_json;
192 if (!lines_json->GetDictionary(0, &first_line_json) || 192 if (!lines_json->GetDictionary(0, &first_line_json) ||
193 !ImageLine::ParseImageLine(first_line_json, &result->first_line_)) 193 !ImageLine::ParseImageLine(first_line_json, &result->first_line_))
194 return nullptr; 194 return nullptr;
195 195
196 const base::DictionaryValue* second_line_json; 196 const base::DictionaryValue* second_line_json;
197 if (!lines_json->GetDictionary(1, &second_line_json) || 197 if (!lines_json->GetDictionary(1, &second_line_json) ||
198 !ImageLine::ParseImageLine(second_line_json, &result->second_line_)) 198 !ImageLine::ParseImageLine(second_line_json, &result->second_line_))
199 return nullptr; 199 return nullptr;
200 200
201 return result.Pass(); 201 return result;
202 } 202 }
203 203
204 bool SuggestionAnswer::Equals(const SuggestionAnswer& answer) const { 204 bool SuggestionAnswer::Equals(const SuggestionAnswer& answer) const {
205 return type_ == answer.type_ && 205 return type_ == answer.type_ &&
206 first_line_.Equals(answer.first_line_) && 206 first_line_.Equals(answer.first_line_) &&
207 second_line_.Equals(answer.second_line_); 207 second_line_.Equals(answer.second_line_);
208 } 208 }
209 209
210 void SuggestionAnswer::AddImageURLsTo(std::vector<GURL>* urls) const { 210 void SuggestionAnswer::AddImageURLsTo(std::vector<GURL>* urls) const {
211 if (first_line_.image_url().is_valid()) 211 if (first_line_.image_url().is_valid())
212 urls->push_back(first_line_.image_url()); 212 urls->push_back(first_line_.image_url());
213 if (second_line_.image_url().is_valid()) 213 if (second_line_.image_url().is_valid())
214 urls->push_back(second_line_.image_url()); 214 urls->push_back(second_line_.image_url());
215 } 215 }
OLDNEW
« no previous file with comments | « components/omnibox/browser/shortcuts_backend.cc ('k') | components/page_load_metrics/browser/metrics_web_contents_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698