本文整理汇总了Java中org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode类的典型用法代码示例。如果您正苦于以下问题:Java BookmarkNode类的具体用法?Java BookmarkNode怎么用?Java BookmarkNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BookmarkNode类属于org.chromium.chrome.browser.ChromeBrowserProvider包,在下文中一共展示了BookmarkNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: syncState
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
private void syncState() {
long currentFolderId = mPreferences.getLong(STATE_CURRENT_FOLDER,
ChromeBrowserProviderClient.INVALID_BOOKMARK_ID);
// Keep outside the synchronized block to avoid deadlocks in case loading the folder
// triggers an update that locks when trying to read mCurrentFolder.
BookmarkNode newFolder = loadBookmarkFolder(currentFolderId);
synchronized (mLock) {
mCurrentFolder =
getFolderId(newFolder) != ChromeBrowserProviderClient.INVALID_BOOKMARK_ID
? newFolder : null;
}
mPreferences.edit()
.putLong(STATE_CURRENT_FOLDER, getFolderId(mCurrentFolder))
.apply();
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:19,代码来源:BookmarkThumbnailWidgetService.java
示例2: handleLoadAllFolders
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
private void handleLoadAllFolders(BookmarkNode result, long selectedFolderId,
boolean syncEnabled) {
if (getActivity() == null || getActivity().isFinishing()) return;
mFoldersAdapter.clear();
if (result == null) {
mEmptyFoldersView.setText(R.string.bookmark_folder_tree_error);
} else {
mEmptyFoldersView.setText(R.string.no_bookmark_folders);
// The root node is just a placeholder, so directly add it's children.
for (BookmarkNode child : result.children()) {
if (!syncEnabled) {
Type type = child.type();
if (type == Type.BOOKMARK_BAR || type == Type.OTHER_NODE) {
continue;
}
}
addFolderItem(child, 0, selectedFolderId);
}
}
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:23,代码来源:SelectBookmarkFolderFragment.java
示例3: getBookmarkNode
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
/**
* Retrieves a bookmark node given its ID or null if no such node exists.
* The parent and immediate child nodes can be also retrieved by enabling the getParent
* and getChildren flags. No deeper child nodes can be retrieved with this method.
*
* @param nodeId The ID of the bookmark node to be retrieved.
* @param flags Combination of constants telling what information of the node is required.
* @return The bookmark node corresponding to the provided ID.
*/
public static BookmarkNode getBookmarkNode(Context context, long nodeId, int flags) {
return chromeBrowserProviderCall(BookmarkNode.class,
ChromeBrowserProvider.CLIENT_API_GET_BOOKMARK_NODE, context,
argsToBundle(nodeId,
(flags & GET_PARENT) != 0,
(flags & GET_CHILDREN) != 0,
(flags & GET_FAVICONS) != 0,
(flags & GET_THUMBNAILS) != 0));
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:19,代码来源:ChromeBrowserProviderClient.java
示例4: onThumbnailUpdated
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
@Override
public void onThumbnailUpdated(String url) {
synchronized (mLock) {
if (mCurrentFolder == null) return;
for (BookmarkNode child : mCurrentFolder.children()) {
if (child.isUrl() && url.equals(child.url())) {
refreshWidget();
break;
}
}
}
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:14,代码来源:BookmarkThumbnailWidgetService.java
示例5: loadBookmarkFolder
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
private BookmarkNode loadBookmarkFolder(long folderId) {
if (ThreadUtils.runningOnUiThread()) {
Log.e(TAG, "Trying to load bookmark folder from the UI thread.");
return null;
}
// If the current folder id doesn't exist (it was deleted) try the current parent.
// If this fails too then fallback to Mobile Bookmarks.
if (!ChromeBrowserProviderClient.bookmarkNodeExists(mContext, folderId)) {
folderId = mCurrentFolder != null ? getFolderId(mCurrentFolder.parent())
: ChromeBrowserProviderClient.INVALID_BOOKMARK_ID;
if (!ChromeBrowserProviderClient.bookmarkNodeExists(mContext, folderId)) {
folderId = ChromeBrowserProviderClient.INVALID_BOOKMARK_ID;
}
}
// Need to verify this always because the package data might be cleared while the
// widget is in the Mobile Bookmarks folder with sync enabled. In that case the
// hierarchy up folder would still work (we can't update the widget) but the parent
// folders should not be accessible because sync has been reset when clearing data.
if (folderId != ChromeBrowserProviderClient.INVALID_BOOKMARK_ID
&& !AndroidSyncSettings.isSyncEnabled(mContext)
&& !ChromeBrowserProviderClient.isBookmarkInMobileBookmarksBranch(
mContext, folderId)) {
folderId = ChromeBrowserProviderClient.INVALID_BOOKMARK_ID;
}
// Use the Mobile Bookmarks folder by default.
if (folderId < 0) {
folderId = ChromeBrowserProviderClient.getMobileBookmarksFolderId(mContext);
if (folderId == ChromeBrowserProviderClient.INVALID_BOOKMARK_ID) return null;
}
return ChromeBrowserProviderClient.getBookmarkNode(mContext, folderId,
ChromeBrowserProviderClient.GET_PARENT
| ChromeBrowserProviderClient.GET_CHILDREN
| ChromeBrowserProviderClient.GET_FAVICONS
| ChromeBrowserProviderClient.GET_THUMBNAILS);
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:40,代码来源:BookmarkThumbnailWidgetService.java
示例6: getBookmarkForPosition
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
private BookmarkNode getBookmarkForPosition(int position) {
if (mCurrentFolder == null) return null;
// The position 0 is saved for an entry of the current folder used to go up.
// This is not the case when the current node has no parent (it's the root node).
return (mCurrentFolder.parent() == null)
? mCurrentFolder.children().get(position)
: (position == 0
? mCurrentFolder : mCurrentFolder.children().get(position - 1));
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:11,代码来源:BookmarkThumbnailWidgetService.java
示例7: addFolderItem
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
private void addFolderItem(BookmarkNode folder, int depth, long selectedFolderId) {
boolean isSelectedFolder = (folder.id() == selectedFolderId);
mFoldersAdapter.add(new FolderListEntry(folder, depth, isSelectedFolder));
// Hiding sub folders will prevent current folder to be moved under a sub folder.
if (folder.id() != selectedFolderId || !mIsFolder) {
for (BookmarkNode child : folder.children()) {
addFolderItem(child, depth + 1, selectedFolderId);
}
}
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:11,代码来源:SelectBookmarkFolderFragment.java
示例8: handleDefaultBookmarkNode
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
private void handleDefaultBookmarkNode(BookmarkNode result) {
if (getActivity() == null || getActivity().isFinishing()) return;
if (result != null) {
setParentFolderInfo(result.id(), result.name());
} else {
mFolderInput.setError(getResources().getText(R.string.default_folder_error));
}
synchronized (mLoadedLock) {
mDefaultFolderLoaded = true;
}
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:14,代码来源:AddEditBookmarkFragment.java
示例9: removeAllUserBookmarks
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
/**
* Removes all bookmarks and bookmark folders that the user can edit.
* Only the permanent bookmark folders remain after this operation, and any managed bookmarks.
*/
public static void removeAllUserBookmarks(Context context) {
chromeBrowserProviderCall(BookmarkNode.class,
ChromeBrowserProvider.CLIENT_API_DELETE_ALL_USER_BOOKMARKS, context,
argsToBundle());
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:10,代码来源:ChromeBrowserProviderClient.java
示例10: getFolderId
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
private static long getFolderId(BookmarkNode folder) {
return folder != null ? folder.id() : ChromeBrowserProviderClient.INVALID_BOOKMARK_ID;
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:4,代码来源:BookmarkThumbnailWidgetService.java
示例11: FolderListEntry
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
FolderListEntry(BookmarkNode folder, int depth, boolean isSelectedFolder) {
mFolder = folder;
mDepth = depth;
mIsSelectedFolder = isSelectedFolder;
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:6,代码来源:SelectBookmarkFolderFragment.java
示例12: removeAllBookmarks
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
/**
* Removes all bookmarks and bookmark folders.
* Only the permanent bookmark folders remain after this operation.
*/
public static void removeAllBookmarks(Context context) {
chromeBrowserProviderCall(BookmarkNode.class,
ChromeBrowserProvider.CLIENT_API_DELETE_ALL_BOOKMARKS, context,
argsToBundle());
}
开发者ID:morristech,项目名称:android-chromium,代码行数:10,代码来源:ChromeBrowserProviderClient.java
示例13: getEditableBookmarkFolderHierarchy
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
/**
* Retrieves the bookmark folder hierarchy of editable nodes, returning its root node.
*
* @return The root node of the bookmark folder hierarchy with all its descendant folders
* that are editable by the user, populated or null in case of error.
* Note that only folders are returned.
*/
public static BookmarkNode getEditableBookmarkFolderHierarchy(Context context) {
return chromeBrowserProviderCall(BookmarkNode.class,
ChromeBrowserProvider.CLIENT_API_GET_EDITABLE_BOOKMARK_FOLDER_HIERARCHY, context,
argsToBundle());
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:13,代码来源:ChromeBrowserProviderClient.java
示例14: getDefaultBookmarkFolder
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
/**
* Retrieves the current default folder for UI based bookmark operations.
* The result depends on where the last successful bookmark operation was performed by the user.
*
* @return The default bookmark folder for new bookmarks or null in case of error.
* No parent or children are populated in the returned node.
*/
public static BookmarkNode getDefaultBookmarkFolder(Context context) {
return chromeBrowserProviderCall(BookmarkNode.class,
ChromeBrowserProvider.CLIENT_API_GET_DEFAULT_BOOKMARK_FOLDER, context,
argsToBundle());
}
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:13,代码来源:ChromeBrowserProviderClient.java
示例15: getBookmarkFolderHierarchy
import org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode; //导入依赖的package包/类
/**
* Retrieves the full bookmark folder hierarchy returning its root node.
*
* @return The root node of the bookmark folder hierarchy with all its descendant folders
* populated or null in case of error. Note that only folders are returned.
*/
public static BookmarkNode getBookmarkFolderHierarchy(Context context) {
return chromeBrowserProviderCall(BookmarkNode.class,
ChromeBrowserProvider.CLIENT_API_GET_BOOKMARK_FOLDER_HIERARCHY, context,
argsToBundle());
}
开发者ID:morristech,项目名称:android-chromium,代码行数:12,代码来源:ChromeBrowserProviderClient.java
注:本文中的org.chromium.chrome.browser.ChromeBrowserProvider.BookmarkNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论