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

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

Issue 228393004: Create bookmarks component with names of bookmark preferences (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 11 matching lines...) Expand all
22 #include "chrome/browser/history/history_service_factory.h" 22 #include "chrome/browser/history/history_service_factory.h"
23 #include "chrome/browser/password_manager/password_store_factory.h" 23 #include "chrome/browser/password_manager/password_store_factory.h"
24 #include "chrome/browser/profiles/profile.h" 24 #include "chrome/browser/profiles/profile.h"
25 #include "chrome/browser/search_engines/template_url.h" 25 #include "chrome/browser/search_engines/template_url.h"
26 #include "chrome/browser/search_engines/template_url_service.h" 26 #include "chrome/browser/search_engines/template_url_service.h"
27 #include "chrome/browser/search_engines/template_url_service_factory.h" 27 #include "chrome/browser/search_engines/template_url_service_factory.h"
28 #include "chrome/browser/webdata/web_data_service.h" 28 #include "chrome/browser/webdata/web_data_service.h"
29 #include "chrome/common/importer/imported_bookmark_entry.h" 29 #include "chrome/common/importer/imported_bookmark_entry.h"
30 #include "chrome/common/importer/imported_favicon_usage.h" 30 #include "chrome/common/importer/imported_favicon_usage.h"
31 #include "chrome/common/pref_names.h" 31 #include "chrome/common/pref_names.h"
32 #include "components/bookmarks/bookmark_pref_names.h"
32 #include "components/password_manager/core/browser/password_store.h" 33 #include "components/password_manager/core/browser/password_store.h"
33 34
34 namespace { 35 namespace {
35 36
36 // Generates a unique folder name. If |folder_name| is not unique, then this 37 // Generates a unique folder name. If |folder_name| is not unique, then this
37 // repeatedly tests for '|folder_name| + (i)' until a unique name is found. 38 // repeatedly tests for '|folder_name| + (i)' until a unique name is found.
38 base::string16 GenerateUniqueFolderName(BookmarkModel* model, 39 base::string16 GenerateUniqueFolderName(BookmarkModel* model,
39 const base::string16& folder_name) { 40 const base::string16& folder_name) {
40 // Build a set containing the bookmark bar folder names. 41 // Build a set containing the bookmark bar folder names.
41 std::set<base::string16> existing_folder_names; 42 std::set<base::string16> existing_folder_names;
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 312
312 // Only add valid TemplateURLs to the model. 313 // Only add valid TemplateURLs to the model.
313 if ((*i)->url_ref().IsValid()) { 314 if ((*i)->url_ref().IsValid()) {
314 model->AddAndSetProfile(*i, profile_); // Takes ownership. 315 model->AddAndSetProfile(*i, profile_); // Takes ownership.
315 *i = NULL; // Prevent the vector from deleting *i later. 316 *i = NULL; // Prevent the vector from deleting *i later.
316 } 317 }
317 } 318 }
318 } 319 }
319 320
320 ProfileWriter::~ProfileWriter() {} 321 ProfileWriter::~ProfileWriter() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698