| 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/bookmarks/bookmark_utils.h" | 5 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_drag_data.h" | 10 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 return (node->is_url() && DoesBookmarkContainWords(node, words)); | 531 return (node->is_url() && DoesBookmarkContainWords(node, words)); |
| 532 } | 532 } |
| 533 | 533 |
| 534 // Formerly in BookmarkBarView | 534 // Formerly in BookmarkBarView |
| 535 void ToggleWhenVisible(Profile* profile) { | 535 void ToggleWhenVisible(Profile* profile) { |
| 536 PrefService* prefs = profile->GetPrefs(); | 536 PrefService* prefs = profile->GetPrefs(); |
| 537 const bool always_show = !prefs->GetBoolean(prefs::kShowBookmarkBar); | 537 const bool always_show = !prefs->GetBoolean(prefs::kShowBookmarkBar); |
| 538 | 538 |
| 539 // The user changed when the bookmark bar is shown, update the preferences. | 539 // The user changed when the bookmark bar is shown, update the preferences. |
| 540 prefs->SetBoolean(prefs::kShowBookmarkBar, always_show); | 540 prefs->SetBoolean(prefs::kShowBookmarkBar, always_show); |
| 541 prefs->ScheduleSavePersistentPrefs(g_browser_process->file_thread()); | 541 prefs->ScheduleSavePersistentPrefs(); |
| 542 | 542 |
| 543 // And notify the notification service. | 543 // And notify the notification service. |
| 544 Source<Profile> source(profile); | 544 Source<Profile> source(profile); |
| 545 NotificationService::current()->Notify( | 545 NotificationService::current()->Notify( |
| 546 NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, | 546 NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, |
| 547 source, | 547 source, |
| 548 NotificationService::NoDetails()); | 548 NotificationService::NoDetails()); |
| 549 } | 549 } |
| 550 | 550 |
| 551 void RegisterUserPrefs(PrefService* prefs) { | 551 void RegisterUserPrefs(PrefService* prefs) { |
| 552 // Formerly in BookmarkBarView | 552 // Formerly in BookmarkBarView |
| 553 prefs->RegisterBooleanPref(prefs::kShowBookmarkBar, false); | 553 prefs->RegisterBooleanPref(prefs::kShowBookmarkBar, false); |
| 554 | 554 |
| 555 // Formerly in BookmarkTableView | 555 // Formerly in BookmarkTableView |
| 556 prefs->RegisterIntegerPref(prefs::kBookmarkTableNameWidth1, -1); | 556 prefs->RegisterIntegerPref(prefs::kBookmarkTableNameWidth1, -1); |
| 557 prefs->RegisterIntegerPref(prefs::kBookmarkTableURLWidth1, -1); | 557 prefs->RegisterIntegerPref(prefs::kBookmarkTableURLWidth1, -1); |
| 558 prefs->RegisterIntegerPref(prefs::kBookmarkTableNameWidth2, -1); | 558 prefs->RegisterIntegerPref(prefs::kBookmarkTableNameWidth2, -1); |
| 559 prefs->RegisterIntegerPref(prefs::kBookmarkTableURLWidth2, -1); | 559 prefs->RegisterIntegerPref(prefs::kBookmarkTableURLWidth2, -1); |
| 560 prefs->RegisterIntegerPref(prefs::kBookmarkTablePathWidth, -1); | 560 prefs->RegisterIntegerPref(prefs::kBookmarkTablePathWidth, -1); |
| 561 } | 561 } |
| 562 | 562 |
| 563 } // namespace bookmark_utils | 563 } // namespace bookmark_utils |
| OLD | NEW |