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 package org.chromium.chrome.browser; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.text.TextUtils; | 7 import android.text.TextUtils; |
8 import android.util.Log; | 8 import android.util.Log; |
9 | 9 |
10 import org.chromium.base.CalledByNative; | 10 import org.chromium.base.CalledByNative; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 * @return All the permanent nodes. | 182 * @return All the permanent nodes. |
183 */ | 183 */ |
184 public List<BookmarkId> getPermanentNodeIDs() { | 184 public List<BookmarkId> getPermanentNodeIDs() { |
185 assert mIsNativeBookmarkModelLoaded; | 185 assert mIsNativeBookmarkModelLoaded; |
186 List<BookmarkId> result = new ArrayList<BookmarkId>(); | 186 List<BookmarkId> result = new ArrayList<BookmarkId>(); |
187 nativeGetPermanentNodeIDs(mNativeBookmarksBridge, result); | 187 nativeGetPermanentNodeIDs(mNativeBookmarksBridge, result); |
188 return result; | 188 return result; |
189 } | 189 } |
190 | 190 |
191 /** | 191 /** |
192 * @return Sub-folders of the given folder. | 192 * Reads sub-folder IDs, sub-bookmark IDs, or both of the given folder. |
| 193 * |
| 194 * @param getFolders Whether sub-folders should be returned. |
| 195 * @param getBookmarks Whether sub-bookmarks should be returned. |
| 196 * @return Child IDs of the given folder, with the specified type. |
193 */ | 197 */ |
194 public List<BookmarkId> getSubFolders(BookmarkId id) { | 198 public List<BookmarkId> getChildIDs(BookmarkId id, boolean getFolders, boole
an getBookmarks) { |
195 assert mIsNativeBookmarkModelLoaded; | 199 assert mIsNativeBookmarkModelLoaded; |
196 List<BookmarkId> result = new ArrayList<BookmarkId>(); | 200 List<BookmarkId> result = new ArrayList<BookmarkId>(); |
197 nativeGetChildIDs(mNativeBookmarksBridge, id.mId, id.mType, true, false,
result); | 201 nativeGetChildIDs(mNativeBookmarksBridge, |
| 202 id.mId, |
| 203 id.mType, |
| 204 getFolders, |
| 205 getBookmarks, |
| 206 result); |
198 return result; | 207 return result; |
199 } | 208 } |
200 | 209 |
201 /** | 210 /** |
202 * @return All bookmark IDs ordered by creation date. | 211 * @return All bookmark IDs ordered by creation date. |
203 */ | 212 */ |
204 public List<BookmarkId> getAllBookmarkIDsOrderedByCreationDate() { | 213 public List<BookmarkId> getAllBookmarkIDsOrderedByCreationDate() { |
205 assert mIsNativeBookmarkModelLoaded; | 214 assert mIsNativeBookmarkModelLoaded; |
206 List<BookmarkId> result = new ArrayList<BookmarkId>(); | 215 List<BookmarkId> result = new ArrayList<BookmarkId>(); |
207 nativeGetAllBookmarkIDsOrderedByCreationDate(mNativeBookmarksBridge, res
ult); | 216 nativeGetAllBookmarkIDsOrderedByCreationDate(mNativeBookmarksBridge, res
ult); |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 case GET_CURRENT_FOLDER_HIERARCHY: | 624 case GET_CURRENT_FOLDER_HIERARCHY: |
616 mHandler.getCurrentFolderHierarchy(mFolderId, mCallback); | 625 mHandler.getCurrentFolderHierarchy(mFolderId, mCallback); |
617 break; | 626 break; |
618 default: | 627 default: |
619 assert false; | 628 assert false; |
620 break; | 629 break; |
621 } | 630 } |
622 } | 631 } |
623 } | 632 } |
624 } | 633 } |
OLD | NEW |