| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/android/bookmarks/bookmarks_bridge.h" | 5 #include "chrome/browser/android/bookmarks/bookmarks_bridge.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 788 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 789 DCHECK(IsLoaded()); | 789 DCHECK(IsLoaded()); |
| 790 DCHECK(grouped_bookmark_actions_.get()); // should only call after start | 790 DCHECK(grouped_bookmark_actions_.get()); // should only call after start |
| 791 grouped_bookmark_actions_.reset(); | 791 grouped_bookmark_actions_.reset(); |
| 792 } | 792 } |
| 793 | 793 |
| 794 base::string16 BookmarksBridge::GetTitle(const BookmarkNode* node) const { | 794 base::string16 BookmarksBridge::GetTitle(const BookmarkNode* node) const { |
| 795 if (partner_bookmarks_shim_->IsPartnerBookmark(node)) | 795 if (partner_bookmarks_shim_->IsPartnerBookmark(node)) |
| 796 return partner_bookmarks_shim_->GetTitle(node); | 796 return partner_bookmarks_shim_->GetTitle(node); |
| 797 | 797 |
| 798 if (node == bookmark_model_->bookmark_bar_node()) { | |
| 799 return l10n_util::GetStringUTF16(IDS_ENHANCED_BOOKMARK_BAR_FOLDER_NAME); | |
| 800 } | |
| 801 | |
| 802 return node->GetTitle(); | 798 return node->GetTitle(); |
| 803 } | 799 } |
| 804 | 800 |
| 805 ScopedJavaLocalRef<jobject> BookmarksBridge::CreateJavaBookmark( | 801 ScopedJavaLocalRef<jobject> BookmarksBridge::CreateJavaBookmark( |
| 806 const BookmarkNode* node) { | 802 const BookmarkNode* node) { |
| 807 JNIEnv* env = AttachCurrentThread(); | 803 JNIEnv* env = AttachCurrentThread(); |
| 808 | 804 |
| 809 const BookmarkNode* parent = GetParentNode(node); | 805 const BookmarkNode* parent = GetParentNode(node); |
| 810 int64_t parent_id = parent ? parent->id() : -1; | 806 int64_t parent_id = parent ? parent->id() : -1; |
| 811 | 807 |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 BookmarkModelChanged(); | 1100 BookmarkModelChanged(); |
| 1105 } | 1101 } |
| 1106 | 1102 |
| 1107 void BookmarksBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { | 1103 void BookmarksBridge::PartnerShimLoaded(PartnerBookmarksShim* shim) { |
| 1108 NotifyIfDoneLoading(); | 1104 NotifyIfDoneLoading(); |
| 1109 } | 1105 } |
| 1110 | 1106 |
| 1111 void BookmarksBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { | 1107 void BookmarksBridge::ShimBeingDeleted(PartnerBookmarksShim* shim) { |
| 1112 partner_bookmarks_shim_ = NULL; | 1108 partner_bookmarks_shim_ = NULL; |
| 1113 } | 1109 } |
| OLD | NEW |