| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 model->EndExtensiveChanges(); | 220 model->EndExtensiveChanges(); |
| 221 | 221 |
| 222 // If the user was previously using a toolbar, we should show the bar. | 222 // If the user was previously using a toolbar, we should show the bar. |
| 223 if (import_to_top_level && !add_all_to_top_level) | 223 if (import_to_top_level && !add_all_to_top_level) |
| 224 ShowBookmarkBar(profile_); | 224 ShowBookmarkBar(profile_); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void ProfileWriter::AddFavicons( | 227 void ProfileWriter::AddFavicons( |
| 228 const std::vector<ImportedFaviconUsage>& favicons) { | 228 const std::vector<ImportedFaviconUsage>& favicons) { |
| 229 HistoryService* history_service = | 229 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS)-> |
| 230 HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); | 230 SetImportedFavicons(favicons); |
| 231 if (history_service) | |
| 232 history_service->SetImportedFavicons(favicons); | |
| 233 } | 231 } |
| 234 | 232 |
| 235 typedef std::map<std::string, TemplateURL*> HostPathMap; | 233 typedef std::map<std::string, TemplateURL*> HostPathMap; |
| 236 | 234 |
| 237 // Returns the key for the map built by BuildHostPathMap. If url_string is not | 235 // Returns the key for the map built by BuildHostPathMap. If url_string is not |
| 238 // a valid URL, an empty string is returned, otherwise host+path is returned. | 236 // a valid URL, an empty string is returned, otherwise host+path is returned. |
| 239 static std::string HostPathKeyForURL(const GURL& url) { | 237 static std::string HostPathKeyForURL(const GURL& url) { |
| 240 return url.is_valid() ? url.host() + url.path() : std::string(); | 238 return url.is_valid() ? url.host() + url.path() : std::string(); |
| 241 } | 239 } |
| 242 | 240 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 318 |
| 321 // Only add valid TemplateURLs to the model. | 319 // Only add valid TemplateURLs to the model. |
| 322 if ((*i)->url_ref().IsValid(model->search_terms_data())) { | 320 if ((*i)->url_ref().IsValid(model->search_terms_data())) { |
| 323 model->Add(*i); // Takes ownership. | 321 model->Add(*i); // Takes ownership. |
| 324 *i = NULL; // Prevent the vector from deleting *i later. | 322 *i = NULL; // Prevent the vector from deleting *i later. |
| 325 } | 323 } |
| 326 } | 324 } |
| 327 } | 325 } |
| 328 | 326 |
| 329 ProfileWriter::~ProfileWriter() {} | 327 ProfileWriter::~ProfileWriter() {} |
| OLD | NEW |