| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/importer.h" | 5 #include "chrome/browser/importer/importer.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)-> | 80 profile_->GetHistoryService(Profile::EXPLICIT_ACCESS)-> |
| 81 AddPagesWithDetails(page); | 81 AddPagesWithDetails(page); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void ProfileWriter::AddHomepage(const GURL& home_page) { | 84 void ProfileWriter::AddHomepage(const GURL& home_page) { |
| 85 DCHECK(profile_); | 85 DCHECK(profile_); |
| 86 | 86 |
| 87 PrefService* prefs = profile_->GetPrefs(); | 87 PrefService* prefs = profile_->GetPrefs(); |
| 88 // NOTE: We set the kHomePage value, but keep the NewTab page as the homepage. | 88 // NOTE: We set the kHomePage value, but keep the NewTab page as the homepage. |
| 89 prefs->SetString(prefs::kHomePage, ASCIIToWide(home_page.spec())); | 89 prefs->SetString(prefs::kHomePage, ASCIIToWide(home_page.spec())); |
| 90 prefs->ScheduleSavePersistentPrefs(g_browser_process->file_thread()); | 90 prefs->ScheduleSavePersistentPrefs(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void ProfileWriter::AddBookmarkEntry( | 93 void ProfileWriter::AddBookmarkEntry( |
| 94 const std::vector<BookmarkEntry>& bookmark, | 94 const std::vector<BookmarkEntry>& bookmark, |
| 95 const std::wstring& first_folder_name, | 95 const std::wstring& first_folder_name, |
| 96 int options) { | 96 int options) { |
| 97 BookmarkModel* model = profile_->GetBookmarkModel(); | 97 BookmarkModel* model = profile_->GetBookmarkModel(); |
| 98 DCHECK(model->IsLoaded()); | 98 DCHECK(model->IsLoaded()); |
| 99 | 99 |
| 100 bool first_run = (options & FIRST_RUN) != 0; | 100 bool first_run = (options & FIRST_RUN) != 0; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 288 } |
| 289 | 289 |
| 290 void ProfileWriter::ShowBookmarkBar() { | 290 void ProfileWriter::ShowBookmarkBar() { |
| 291 DCHECK(profile_); | 291 DCHECK(profile_); |
| 292 | 292 |
| 293 PrefService* prefs = profile_->GetPrefs(); | 293 PrefService* prefs = profile_->GetPrefs(); |
| 294 // Check whether the bookmark bar is shown in current pref. | 294 // Check whether the bookmark bar is shown in current pref. |
| 295 if (!prefs->GetBoolean(prefs::kShowBookmarkBar)) { | 295 if (!prefs->GetBoolean(prefs::kShowBookmarkBar)) { |
| 296 // Set the pref and notify the notification service. | 296 // Set the pref and notify the notification service. |
| 297 prefs->SetBoolean(prefs::kShowBookmarkBar, true); | 297 prefs->SetBoolean(prefs::kShowBookmarkBar, true); |
| 298 prefs->ScheduleSavePersistentPrefs(g_browser_process->file_thread()); | 298 prefs->ScheduleSavePersistentPrefs(); |
| 299 Source<Profile> source(profile_); | 299 Source<Profile> source(profile_); |
| 300 NotificationService::current()->Notify( | 300 NotificationService::current()->Notify( |
| 301 NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, source, | 301 NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, source, |
| 302 NotificationService::NoDetails()); | 302 NotificationService::NoDetails()); |
| 303 } | 303 } |
| 304 } | 304 } |
| 305 | 305 |
| 306 std::wstring ProfileWriter::GenerateUniqueFolderName( | 306 std::wstring ProfileWriter::GenerateUniqueFolderName( |
| 307 BookmarkModel* model, | 307 BookmarkModel* model, |
| 308 const std::wstring& folder_name) { | 308 const std::wstring& folder_name) { |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 ProfileInfo* google_toolbar = new ProfileInfo(); | 755 ProfileInfo* google_toolbar = new ProfileInfo(); |
| 756 google_toolbar->browser_type = GOOGLE_TOOLBAR5; | 756 google_toolbar->browser_type = GOOGLE_TOOLBAR5; |
| 757 google_toolbar->description = l10n_util::GetString( | 757 google_toolbar->description = l10n_util::GetString( |
| 758 IDS_IMPORT_FROM_GOOGLE_TOOLBAR); | 758 IDS_IMPORT_FROM_GOOGLE_TOOLBAR); |
| 759 google_toolbar->source_path.clear(); | 759 google_toolbar->source_path.clear(); |
| 760 google_toolbar->app_path.clear(); | 760 google_toolbar->app_path.clear(); |
| 761 google_toolbar->services_supported = FAVORITES; | 761 google_toolbar->services_supported = FAVORITES; |
| 762 source_profiles_.push_back(google_toolbar); | 762 source_profiles_.push_back(google_toolbar); |
| 763 } | 763 } |
| 764 } | 764 } |
| OLD | NEW |