OLD | NEW |
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/importer/profile_writer.h" | 5 #include "chrome/browser/importer/profile_writer.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 // search providers (such as two Googles, or two Yahoos) as well as making | 311 // search providers (such as two Googles, or two Yahoos) as well as making |
312 // sure the search engines we provide aren't replaced by those from the | 312 // sure the search engines we provide aren't replaced by those from the |
313 // imported browser. | 313 // imported browser. |
314 if (unique_on_host_and_path && | 314 if (unique_on_host_and_path && |
315 (host_path_map.find(BuildHostPathKey( | 315 (host_path_map.find(BuildHostPathKey( |
316 *i, model->search_terms_data(), true)) != host_path_map.end())) | 316 *i, model->search_terms_data(), true)) != host_path_map.end())) |
317 continue; | 317 continue; |
318 | 318 |
319 // Only add valid TemplateURLs to the model. | 319 // Only add valid TemplateURLs to the model. |
320 if ((*i)->url_ref().IsValid(model->search_terms_data())) { | 320 if ((*i)->url_ref().IsValid(model->search_terms_data())) { |
321 model->AddAndSetProfile(*i, profile_); // Takes ownership. | 321 model->Add(*i); // Takes ownership. |
322 *i = NULL; // Prevent the vector from deleting *i later. | 322 *i = NULL; // Prevent the vector from deleting *i later. |
323 } | 323 } |
324 } | 324 } |
325 } | 325 } |
326 | 326 |
327 ProfileWriter::~ProfileWriter() {} | 327 ProfileWriter::~ProfileWriter() {} |
OLD | NEW |