| OLD | NEW |
| 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/search_engines/util.h" | 5 #include "components/search_engines/util.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 return NULL; | 163 return NULL; |
| 164 } | 164 } |
| 165 | 165 |
| 166 void MergeIntoPrepopulatedEngineData(const TemplateURL* original_turl, | 166 void MergeIntoPrepopulatedEngineData(const TemplateURL* original_turl, |
| 167 TemplateURLData* prepopulated_url) { | 167 TemplateURLData* prepopulated_url) { |
| 168 DCHECK_EQ(original_turl->prepopulate_id(), prepopulated_url->prepopulate_id); | 168 DCHECK_EQ(original_turl->prepopulate_id(), prepopulated_url->prepopulate_id); |
| 169 if (!original_turl->safe_for_autoreplace()) { | 169 if (!original_turl->safe_for_autoreplace()) { |
| 170 prepopulated_url->safe_for_autoreplace = false; | 170 prepopulated_url->safe_for_autoreplace = false; |
| 171 prepopulated_url->SetKeyword(original_turl->keyword()); | 171 prepopulated_url->SetKeyword(original_turl->keyword()); |
| 172 prepopulated_url->short_name = original_turl->short_name(); | 172 prepopulated_url->SetShortName(original_turl->short_name()); |
| 173 } | 173 } |
| 174 prepopulated_url->id = original_turl->id(); | 174 prepopulated_url->id = original_turl->id(); |
| 175 prepopulated_url->sync_guid = original_turl->sync_guid(); | 175 prepopulated_url->sync_guid = original_turl->sync_guid(); |
| 176 prepopulated_url->date_created = original_turl->date_created(); | 176 prepopulated_url->date_created = original_turl->date_created(); |
| 177 prepopulated_url->last_modified = original_turl->last_modified(); | 177 prepopulated_url->last_modified = original_turl->last_modified(); |
| 178 } | 178 } |
| 179 | 179 |
| 180 ActionsFromPrepopulateData::ActionsFromPrepopulateData() {} | 180 ActionsFromPrepopulateData::ActionsFromPrepopulateData() {} |
| 181 | 181 |
| 182 ActionsFromPrepopulateData::~ActionsFromPrepopulateData() {} | 182 ActionsFromPrepopulateData::~ActionsFromPrepopulateData() {} |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 std::vector<std::string> deduped_encodings; | 380 std::vector<std::string> deduped_encodings; |
| 381 std::set<std::string> encoding_set; | 381 std::set<std::string> encoding_set; |
| 382 for (std::vector<std::string>::const_iterator i(encodings->begin()); | 382 for (std::vector<std::string>::const_iterator i(encodings->begin()); |
| 383 i != encodings->end(); ++i) { | 383 i != encodings->end(); ++i) { |
| 384 if (encoding_set.insert(*i).second) | 384 if (encoding_set.insert(*i).second) |
| 385 deduped_encodings.push_back(*i); | 385 deduped_encodings.push_back(*i); |
| 386 } | 386 } |
| 387 encodings->swap(deduped_encodings); | 387 encodings->swap(deduped_encodings); |
| 388 return encodings->size() != deduped_encodings.size(); | 388 return encodings->size() != deduped_encodings.size(); |
| 389 } | 389 } |
| OLD | NEW |