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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 // host+path, we don't import it. This is done to avoid both duplicate | 309 // host+path, we don't import it. This is done to avoid both duplicate |
310 // search providers (such as two Googles, or two Yahoos) as well as making | 310 // search providers (such as two Googles, or two Yahoos) as well as making |
311 // sure the search engines we provide aren't replaced by those from the | 311 // sure the search engines we provide aren't replaced by those from the |
312 // imported browser. | 312 // imported browser. |
313 if (unique_on_host_and_path && | 313 if (unique_on_host_and_path && |
314 (host_path_map.find(BuildHostPathKey(*i, true)) != host_path_map.end())) | 314 (host_path_map.find(BuildHostPathKey(*i, true)) != host_path_map.end())) |
315 continue; | 315 continue; |
316 | 316 |
317 // Only add valid TemplateURLs to the model. | 317 // Only add valid TemplateURLs to the model. |
318 if ((*i)->url_ref().IsValid()) { | 318 if ((*i)->url_ref().IsValid()) { |
319 model->Add(*i); // Takes ownership. | 319 model->AddAndSetProfile(*i, profile_); // Takes ownership. |
320 *i = NULL; // Prevent the vector from deleting *i later. | 320 *i = NULL; // Prevent the vector from deleting *i later. |
321 } | 321 } |
322 } | 322 } |
323 } | 323 } |
324 | 324 |
325 ProfileWriter::~ProfileWriter() {} | 325 ProfileWriter::~ProfileWriter() {} |
OLD | NEW |