| 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_model.h" | 5 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/gfx/png_decoder.h" | 8 #include "base/gfx/png_decoder.h" |
| 9 #include "base/scoped_vector.h" | 9 #include "base/scoped_vector.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 void BookmarkModel::SortChildren(BookmarkNode* parent) { | 324 void BookmarkModel::SortChildren(BookmarkNode* parent) { |
| 325 if (!parent || !parent->is_folder() || parent == root_node() || | 325 if (!parent || !parent->is_folder() || parent == root_node() || |
| 326 parent->GetChildCount() <= 1) { | 326 parent->GetChildCount() <= 1) { |
| 327 return; | 327 return; |
| 328 } | 328 } |
| 329 | 329 |
| 330 UErrorCode error = U_ZERO_ERROR; | 330 UErrorCode error = U_ZERO_ERROR; |
| 331 scoped_ptr<Collator> collator( | 331 scoped_ptr<Collator> collator( |
| 332 Collator::createInstance( | 332 Collator::createInstance( |
| 333 Locale(WideToUTF8(g_browser_process->GetApplicationLocale()).c_str()), | 333 Locale(g_browser_process->GetApplicationLocale().c_str()), |
| 334 error)); | 334 error)); |
| 335 if (U_FAILURE(error)) | 335 if (U_FAILURE(error)) |
| 336 collator.reset(NULL); | 336 collator.reset(NULL); |
| 337 std::sort(parent->children().begin(), parent->children().end(), | 337 std::sort(parent->children().begin(), parent->children().end(), |
| 338 SortComparator(collator.get())); | 338 SortComparator(collator.get())); |
| 339 | 339 |
| 340 if (store_.get()) | 340 if (store_.get()) |
| 341 store_->ScheduleSave(); | 341 store_->ScheduleSave(); |
| 342 | 342 |
| 343 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, | 343 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 if (!pref_service->IsPrefRegistered(kPrefPersistIDs)) | 730 if (!pref_service->IsPrefRegistered(kPrefPersistIDs)) |
| 731 pref_service->RegisterBooleanPref(kPrefPersistIDs, false); | 731 pref_service->RegisterBooleanPref(kPrefPersistIDs, false); |
| 732 } | 732 } |
| 733 | 733 |
| 734 void BookmarkModel::LoadPreferences() { | 734 void BookmarkModel::LoadPreferences() { |
| 735 if (!profile_) | 735 if (!profile_) |
| 736 return; | 736 return; |
| 737 PrefService* pref_service = profile_->GetPrefs(); | 737 PrefService* pref_service = profile_->GetPrefs(); |
| 738 persist_ids_ = pref_service->GetBoolean(kPrefPersistIDs); | 738 persist_ids_ = pref_service->GetBoolean(kPrefPersistIDs); |
| 739 } | 739 } |
| OLD | NEW |