org.chromium.chrome.browser.contextmenu.ContextMenuParams Java Examples

The following examples show how to use org.chromium.chrome.browser.contextmenu.ContextMenuParams. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TabContextMenuPopulator.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public void buildContextMenu(ContextMenu menu, Context context, ContextMenuParams params) {
    mPopulator.buildContextMenu(menu, context, params);
    RewindableIterator<TabObserver> observers = mTab.getTabObservers();
    while (observers.hasNext()) {
        observers.next().onContextMenuShown(mTab, menu);
    }
}
 
Example #2
Source File: TabContextMenuPopulator.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public void buildContextMenu(ContextMenu menu, Context context, ContextMenuParams params) {
    mPopulator.buildContextMenu(menu, context, params);
    RewindableIterator<TabObserver> observers = mTab.getTabObservers();
    while (observers.hasNext()) {
        observers.next().onContextMenuShown(mTab, menu);
    }
}
 
Example #3
Source File: TabContextMenuPopulator.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public List<Pair<Integer, List<ContextMenuItem>>> buildContextMenu(
        ContextMenu menu, Context context, ContextMenuParams params) {
    List<Pair<Integer, List<ContextMenuItem>>> itemGroups =
            mPopulator.buildContextMenu(menu, context, params);
    RewindableIterator<TabObserver> observers = mTab.getTabObservers();
    while (observers.hasNext()) {
        observers.next().onContextMenuShown(mTab, menu);
    }
    return itemGroups;
}
 
Example #4
Source File: BrowserActionActivity.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Opens a Browser Actions context menu based on the parsed data.
 */
@Override
public void openContextMenu(View view) {
    ContextMenuParams params = createContextMenuParams();
    mHelper = new BrowserActionsContextMenuHelper(this, params, mActions);
    mHelper.displayBrowserActionsMenu(view);
    return;
}
 
Example #5
Source File: BrowserActionActivity.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a {@link ContextMenuParams} with given Uri and type.
 * @return The ContextMenuParams used to construct context menu.
 */
private ContextMenuParams createContextMenuParams() {
    Referrer referrer = IntentHandler.constructValidReferrerForAuthority(mCreatorPackageName);
    return new ContextMenuParams(mType, mUri.toString(), mUri.toString(), mUri.toString(),
            mUri.toString(), mUri.toString(), mUri.toString(), false /* imageWasFetchedLoFi */,
            referrer, false /* canSaveMedia */);
}
 
Example #6
Source File: BrowserActionsContextMenuHelper.java    From 365browser with Apache License 2.0 5 votes vote down vote up
public BrowserActionsContextMenuHelper(BrowserActionActivity activity, ContextMenuParams params,
        List<BrowserActionItem> customItems) {
    mActivity = activity;
    mCurrentContextMenuParams = params;
    mOnMenuShown = new Runnable() {
        @Override
        public void run() {
            mActivity.onMenuShown();
        }
    };
    mOnMenuClosed = new Runnable() {
        @Override
        public void run() {
            mActivity.finish();
        }
    };
    mItemSelectedCallback = new Callback<Integer>() {
        @Override
        public void onResult(Integer result) {
            onItemSelected(result);
        }
    };
    mOnShareClickedRunnable = new Runnable() {
        @Override
        public void run() {}
    };
    mDelegate = new BrowserActionsContextMenuItemDelegate();
    mItems = buildContextMenuItems(customItems);
}
 
Example #7
Source File: TabContextMenuPopulator.java    From delion with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onItemSelected(ContextMenuHelper helper, ContextMenuParams params, int itemId) {
    return mPopulator.onItemSelected(helper, params, itemId);
}
 
Example #8
Source File: TabContextMenuPopulator.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onItemSelected(ContextMenuHelper helper, ContextMenuParams params, int itemId) {
    return mPopulator.onItemSelected(helper, params, itemId);
}
 
Example #9
Source File: TabContextMenuPopulator.java    From 365browser with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onItemSelected(ContextMenuHelper helper, ContextMenuParams params, int itemId) {
    return mPopulator.onItemSelected(helper, params, itemId);
}