| 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/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 "app/l10n_util_collator.h" | 8 #include "app/l10n_util_collator.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/scoped_vector.h" | 10 #include "base/scoped_vector.h" |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 entry.type = history::StarredEntry::OTHER; | 698 entry.type = history::StarredEntry::OTHER; |
| 699 return CreateRootNodeFromStarredEntry(entry); | 699 return CreateRootNodeFromStarredEntry(entry); |
| 700 } | 700 } |
| 701 | 701 |
| 702 BookmarkNode* BookmarkModel::CreateRootNodeFromStarredEntry( | 702 BookmarkNode* BookmarkModel::CreateRootNodeFromStarredEntry( |
| 703 const history::StarredEntry& entry) { | 703 const history::StarredEntry& entry) { |
| 704 DCHECK(entry.type == history::StarredEntry::BOOKMARK_BAR || | 704 DCHECK(entry.type == history::StarredEntry::BOOKMARK_BAR || |
| 705 entry.type == history::StarredEntry::OTHER); | 705 entry.type == history::StarredEntry::OTHER); |
| 706 BookmarkNode* node = new BookmarkNode(generate_next_node_id(), GURL()); | 706 BookmarkNode* node = new BookmarkNode(generate_next_node_id(), GURL()); |
| 707 node->Reset(entry); | 707 node->Reset(entry); |
| 708 if (entry.type == history::StarredEntry::BOOKMARK_BAR) | 708 if (entry.type == history::StarredEntry::BOOKMARK_BAR) { |
| 709 node->SetTitle(l10n_util::GetString(IDS_BOOMARK_BAR_FOLDER_NAME)); | 709 node->SetTitle(l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_FOLDER_NAME)); |
| 710 else | 710 } else { |
| 711 node->SetTitle(l10n_util::GetString(IDS_BOOMARK_BAR_OTHER_FOLDER_NAME)); | 711 node->SetTitle( |
| 712 l10n_util::GetStringUTF16(IDS_BOOMARK_BAR_OTHER_FOLDER_NAME)); |
| 713 } |
| 712 return node; | 714 return node; |
| 713 } | 715 } |
| 714 | 716 |
| 715 void BookmarkModel::OnFavIconDataAvailable( | 717 void BookmarkModel::OnFavIconDataAvailable( |
| 716 FaviconService::Handle handle, | 718 FaviconService::Handle handle, |
| 717 bool know_favicon, | 719 bool know_favicon, |
| 718 scoped_refptr<RefCountedMemory> data, | 720 scoped_refptr<RefCountedMemory> data, |
| 719 bool expired, | 721 bool expired, |
| 720 GURL icon_url) { | 722 GURL icon_url) { |
| 721 SkBitmap fav_icon; | 723 SkBitmap fav_icon; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 void BookmarkModel::SetFileChanged() { | 804 void BookmarkModel::SetFileChanged() { |
| 803 file_changed_ = true; | 805 file_changed_ = true; |
| 804 } | 806 } |
| 805 | 807 |
| 806 BookmarkLoadDetails* BookmarkModel::CreateLoadDetails() { | 808 BookmarkLoadDetails* BookmarkModel::CreateLoadDetails() { |
| 807 BookmarkNode* bb_node = CreateBookmarkNode(); | 809 BookmarkNode* bb_node = CreateBookmarkNode(); |
| 808 BookmarkNode* other_folder_node = CreateOtherBookmarksNode(); | 810 BookmarkNode* other_folder_node = CreateOtherBookmarksNode(); |
| 809 return new BookmarkLoadDetails( | 811 return new BookmarkLoadDetails( |
| 810 bb_node, other_folder_node, new BookmarkIndex(profile()), next_node_id_); | 812 bb_node, other_folder_node, new BookmarkIndex(profile()), next_node_id_); |
| 811 } | 813 } |
| OLD | NEW |