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

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

Issue 375613002: Bypass the favicon_service when importing favicons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS)-> 229 HistoryService* history_service =
230 SetImportedFavicons(favicons); 230 HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
231 if (history_service)
232 history_service->SetImportedFavicons(favicons);
231 } 233 }
232 234
233 typedef std::map<std::string, TemplateURL*> HostPathMap; 235 typedef std::map<std::string, TemplateURL*> HostPathMap;
234 236
235 // Returns the key for the map built by BuildHostPathMap. If url_string is not 237 // Returns the key for the map built by BuildHostPathMap. If url_string is not
236 // a valid URL, an empty string is returned, otherwise host+path is returned. 238 // a valid URL, an empty string is returned, otherwise host+path is returned.
237 static std::string HostPathKeyForURL(const GURL& url) { 239 static std::string HostPathKeyForURL(const GURL& url) {
238 return url.is_valid() ? url.host() + url.path() : std::string(); 240 return url.is_valid() ? url.host() + url.path() : std::string();
239 } 241 }
240 242
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 320
319 // Only add valid TemplateURLs to the model. 321 // Only add valid TemplateURLs to the model.
320 if ((*i)->url_ref().IsValid(model->search_terms_data())) { 322 if ((*i)->url_ref().IsValid(model->search_terms_data())) {
321 model->Add(*i); // Takes ownership. 323 model->Add(*i); // Takes ownership.
322 *i = NULL; // Prevent the vector from deleting *i later. 324 *i = NULL; // Prevent the vector from deleting *i later.
323 } 325 }
324 } 326 }
325 } 327 }
326 328
327 ProfileWriter::~ProfileWriter() {} 329 ProfileWriter::~ProfileWriter() {}
OLDNEW
« chrome/browser/history/history_service.h ('K') | « chrome/browser/history/history_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698