| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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> |
| 8 #include <set> |
| 7 #include <string> | 9 #include <string> |
| 8 | 10 |
| 9 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
| 10 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 11 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
| 12 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/bookmarks/bookmark_model.h" | 15 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 14 #include "chrome/browser/password_manager/password_store.h" | 16 #include "chrome/browser/password_manager/password_store.h" |
| 15 #include "chrome/browser/prefs/pref_service.h" | 17 #include "chrome/browser/prefs/pref_service.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 52 |
| 51 NOTREACHED(); | 53 NOTREACHED(); |
| 52 return folder_name; | 54 return folder_name; |
| 53 } | 55 } |
| 54 | 56 |
| 55 // Shows the bookmarks toolbar. | 57 // Shows the bookmarks toolbar. |
| 56 void ShowBookmarkBar(Profile* profile) { | 58 void ShowBookmarkBar(Profile* profile) { |
| 57 PrefService* prefs = profile->GetPrefs(); | 59 PrefService* prefs = profile->GetPrefs(); |
| 58 // Check whether the bookmark bar is shown in current pref. | 60 // Check whether the bookmark bar is shown in current pref. |
| 59 if (!prefs->GetBoolean(prefs::kShowBookmarkBar)) { | 61 if (!prefs->GetBoolean(prefs::kShowBookmarkBar)) { |
| 60 // Set the pref and notify the notification service. | |
| 61 prefs->SetBoolean(prefs::kShowBookmarkBar, true); | 62 prefs->SetBoolean(prefs::kShowBookmarkBar, true); |
| 62 prefs->ScheduleSavePersistentPrefs(); | 63 prefs->ScheduleSavePersistentPrefs(); |
| 63 Source<Profile> source(profile); | |
| 64 NotificationService::current()->Notify( | |
| 65 chrome::NOTIFICATION_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, source, | |
| 66 NotificationService::NoDetails()); | |
| 67 } | 64 } |
| 68 } | 65 } |
| 69 | 66 |
| 70 } // namespace | 67 } // namespace |
| 71 | 68 |
| 72 ProfileWriter::BookmarkEntry::BookmarkEntry() | 69 ProfileWriter::BookmarkEntry::BookmarkEntry() |
| 73 : in_toolbar(false), | 70 : in_toolbar(false), |
| 74 is_folder(false) {} | 71 is_folder(false) {} |
| 75 | 72 |
| 76 ProfileWriter::BookmarkEntry::~BookmarkEntry() {} | 73 ProfileWriter::BookmarkEntry::~BookmarkEntry() {} |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 if (default_keyword && TemplateURL::SupportsReplacement(t_url)) | 328 if (default_keyword && TemplateURL::SupportsReplacement(t_url)) |
| 332 model->SetDefaultSearchProvider(t_url); | 329 model->SetDefaultSearchProvider(t_url); |
| 333 } else { | 330 } else { |
| 334 // Don't add invalid TemplateURLs to the model. | 331 // Don't add invalid TemplateURLs to the model. |
| 335 delete t_url; | 332 delete t_url; |
| 336 } | 333 } |
| 337 } | 334 } |
| 338 } | 335 } |
| 339 | 336 |
| 340 ProfileWriter::~ProfileWriter() {} | 337 ProfileWriter::~ProfileWriter() {} |
| OLD | NEW |