| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/thread.h" | 8 #include "base/thread.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 10 #include "chrome/browser/importer/importer.h" | 10 #include "chrome/browser/importer/importer.h" |
| 11 #include "chrome/browser/password_manager/password_store.h" |
| 11 #include "chrome/browser/pref_service.h" | 12 #include "chrome/browser/pref_service.h" |
| 12 #include "chrome/browser/profile.h" | 13 #include "chrome/browser/profile.h" |
| 13 #include "chrome/browser/search_engines/template_url_model.h" | 14 #include "chrome/browser/search_engines/template_url_model.h" |
| 14 #include "chrome/common/notification_service.h" | 15 #include "chrome/common/notification_service.h" |
| 15 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 16 | 17 |
| 17 using webkit_glue::PasswordForm; | 18 using webkit_glue::PasswordForm; |
| 18 | 19 |
| 19 bool ProfileWriter::BookmarkModelIsLoaded() const { | 20 bool ProfileWriter::BookmarkModelIsLoaded() const { |
| 20 return profile_->GetBookmarkModel()->IsLoaded(); | 21 return profile_->GetBookmarkModel()->IsLoaded(); |
| 21 } | 22 } |
| 22 | 23 |
| 23 bool ProfileWriter::TemplateURLModelIsLoaded() const { | 24 bool ProfileWriter::TemplateURLModelIsLoaded() const { |
| 24 return profile_->GetTemplateURLModel()->loaded(); | 25 return profile_->GetTemplateURLModel()->loaded(); |
| 25 } | 26 } |
| 26 | 27 |
| 27 void ProfileWriter::AddPasswordForm(const PasswordForm& form) { | 28 void ProfileWriter::AddPasswordForm(const PasswordForm& form) { |
| 28 profile_->GetWebDataService(Profile::EXPLICIT_ACCESS)->AddLogin(form); | 29 profile_->GetPasswordStore(Profile::EXPLICIT_ACCESS)->AddLogin(form); |
| 29 } | 30 } |
| 30 | 31 |
| 31 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
| 32 void ProfileWriter::AddIE7PasswordInfo(const IE7PasswordInfo& info) { | 33 void ProfileWriter::AddIE7PasswordInfo(const IE7PasswordInfo& info) { |
| 33 profile_->GetWebDataService(Profile::EXPLICIT_ACCESS)->AddIE7Login(info); | 34 profile_->GetWebDataService(Profile::EXPLICIT_ACCESS)->AddIE7Login(info); |
| 34 } | 35 } |
| 35 #endif | 36 #endif |
| 36 | 37 |
| 37 void ProfileWriter::AddHistoryPage(const std::vector<history::URLRow>& page) { | 38 void ProfileWriter::AddHistoryPage(const std::vector<history::URLRow>& page) { |
| 38 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)-> | 39 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)-> |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 ((!import_to_bookmark_bar || !entry.in_toolbar) && | 339 ((!import_to_bookmark_bar || !entry.in_toolbar) && |
| 339 parent != model->other_node()))) { | 340 parent != model->other_node()))) { |
| 340 found_match = false; | 341 found_match = false; |
| 341 } | 342 } |
| 342 | 343 |
| 343 if (found_match) | 344 if (found_match) |
| 344 return true; // Found a match with the same url path and title. | 345 return true; // Found a match with the same url path and title. |
| 345 } | 346 } |
| 346 return false; | 347 return false; |
| 347 } | 348 } |
| OLD | NEW |