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

Side by Side Diff: chrome/browser/importer/profile_writer.cc

Issue 10173001: Add a Profile* member to TemplateURL. This makes some invocations of ReplaceSearchTerms() a bit le… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
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
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() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698