org.chromium.chrome.browser.compositor.layouts.LayoutManager Java Examples
The following examples show how to use
org.chromium.chrome.browser.compositor.layouts.LayoutManager.
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: ChromeActivity.java From AndroidChromium with Apache License 2.0 | 6 votes |
@Override public final void onBackPressed() { RecordUserAction.record("SystemBack"); if (mCompositorViewHolder != null) { LayoutManager layoutManager = mCompositorViewHolder.getLayoutManager(); if (layoutManager != null && layoutManager.onBackPressed()) return; } ContentViewCore contentViewCore = getContentViewCore(); if (contentViewCore != null && contentViewCore.isSelectActionBarShowing()) { contentViewCore.clearSelection(); return; } if (mContextualSearchManager != null && mContextualSearchManager.onBackPressed()) return; if (handleBackPressed()) return; super.onBackPressed(); }
Example #2
Source File: ChromeActivity.java From 365browser with Apache License 2.0 | 6 votes |
@Override public final void onBackPressed() { if (mNativeInitialized) RecordUserAction.record("SystemBack"); if (VrShellDelegate.onBackPressed()) return; if (mCompositorViewHolder != null) { LayoutManager layoutManager = mCompositorViewHolder.getLayoutManager(); if (layoutManager != null && layoutManager.onBackPressed()) return; } ContentViewCore contentViewCore = getContentViewCore(); if (contentViewCore != null && contentViewCore.isSelectActionBarShowing()) { contentViewCore.clearSelection(); return; } if (mContextualSearchManager != null && mContextualSearchManager.onBackPressed()) return; if (handleBackPressed()) return; super.onBackPressed(); }
Example #3
Source File: ChromeActivity.java From delion with Apache License 2.0 | 6 votes |
@Override public final void onBackPressed() { RecordUserAction.record("SystemBack"); if (mCompositorViewHolder != null) { LayoutManager layoutManager = mCompositorViewHolder.getLayoutManager(); if (layoutManager != null && layoutManager.onBackPressed()) return; } ContentViewCore contentViewCore = getContentViewCore(); if (contentViewCore != null && contentViewCore.isSelectActionBarShowing()) { contentViewCore.clearSelection(); return; } if (mContextualSearchManager != null && mContextualSearchManager.onBackPressed()) return; if (handleBackPressed()) return; super.onBackPressed(); }
Example #4
Source File: ChromeTabbedActivity.java From AndroidChromium with Apache License 2.0 | 5 votes |
private void toggleOverview() { Tab currentTab = getActivityTab(); ContentViewCore contentViewCore = currentTab != null ? currentTab.getContentViewCore() : null; if (!mLayoutManager.overviewVisible()) { getCompositorViewHolder().hideKeyboard(new Runnable() { @Override public void run() { mLayoutManager.showOverview(true); } }); if (contentViewCore != null) { contentViewCore.setAccessibilityState(false); } } else { Layout activeLayout = mLayoutManager.getActiveLayout(); if (activeLayout instanceof StackLayout) { ((StackLayout) activeLayout).commitOutstandingModelState(LayoutManager.time()); } if (getCurrentTabModel().getCount() != 0) { // Don't hide overview if current tab stack is empty() mLayoutManager.hideOverview(true); // hideOverview could change the current tab. Update the local variables. currentTab = getActivityTab(); contentViewCore = currentTab != null ? currentTab.getContentViewCore() : null; if (contentViewCore != null) { contentViewCore.setAccessibilityState(true); } } } }
Example #5
Source File: ChromeTabbedActivity.java From delion with Apache License 2.0 | 5 votes |
private void toggleOverview() { Tab currentTab = getActivityTab(); ContentViewCore contentViewCore = currentTab != null ? currentTab.getContentViewCore() : null; if (!mLayoutManager.overviewVisible()) { getCompositorViewHolder().hideKeyboard(new Runnable() { @Override public void run() { mLayoutManager.showOverview(true); } }); if (contentViewCore != null) { contentViewCore.setAccessibilityState(false); } } else { Layout activeLayout = mLayoutManager.getActiveLayout(); if (activeLayout instanceof StackLayout) { ((StackLayout) activeLayout).commitOutstandingModelState(LayoutManager.time()); } if (getCurrentTabModel().getCount() != 0) { // Don't hide overview if current tab stack is empty() mLayoutManager.hideOverview(true); // hideOverview could change the current tab. Update the local variables. currentTab = getActivityTab(); contentViewCore = currentTab != null ? currentTab.getContentViewCore() : null; if (contentViewCore != null) { contentViewCore.setAccessibilityState(true); } } } }
Example #6
Source File: ChromeTabbedActivity.java From 365browser with Apache License 2.0 | 5 votes |
private void toggleOverview() { Tab currentTab = getActivityTab(); ContentViewCore contentViewCore = currentTab != null ? currentTab.getContentViewCore() : null; if (!mLayoutManager.overviewVisible()) { getCompositorViewHolder().hideKeyboard(new Runnable() { @Override public void run() { mLayoutManager.showOverview(true); } }); if (contentViewCore != null) { contentViewCore.setAccessibilityState(false); } } else { Layout activeLayout = mLayoutManager.getActiveLayout(); if (activeLayout instanceof StackLayout) { ((StackLayout) activeLayout).commitOutstandingModelState(LayoutManager.time()); } if (getCurrentTabModel().getCount() != 0) { // Don't hide overview if current tab stack is empty() mLayoutManager.hideOverview(true); // hideOverview could change the current tab. Update the local variables. currentTab = getActivityTab(); contentViewCore = currentTab != null ? currentTab.getContentViewCore() : null; if (contentViewCore != null) { contentViewCore.setAccessibilityState(true); } } } }
Example #7
Source File: CompositorViewHolder.java From 365browser with Apache License 2.0 | 5 votes |
@Override protected boolean onPerformActionForVirtualView( int virtualViewId, int action, Bundle arguments) { switch (action) { case AccessibilityNodeInfoCompat.ACTION_CLICK: mVirtualViews.get(virtualViewId).handleClick(LayoutManager.time()); return true; } return false; }
Example #8
Source File: ToolbarManager.java From delion with Apache License 2.0 | 4 votes |
/** * Initialize the manager with the components that had native initialization dependencies. * <p> * Calling this must occur after the native library have completely loaded. * * @param tabModelSelector The selector that handles tab management. * @param fullscreenManager The manager in charge of interacting with the fullscreen feature. * @param findToolbarManager The manager for find in page. * @param overviewModeBehavior The overview mode manager. * @param layoutDriver A {@link LayoutManager} instance used to watch for scene changes. */ public void initializeWithNative(TabModelSelector tabModelSelector, ChromeFullscreenManager fullscreenManager, final FindToolbarManager findToolbarManager, final OverviewModeBehavior overviewModeBehavior, final LayoutManager layoutDriver, OnClickListener tabSwitcherClickHandler, OnClickListener newTabClickHandler, OnClickListener bookmarkClickHandler, OnClickListener customTabsBackClickHandler) { assert !mInitializedWithNative; mTabModelSelector = tabModelSelector; mToolbar.getLocationBar().updateVisualsForState(); mToolbar.getLocationBar().setUrlToPageUrl(); mToolbar.setFullscreenManager(fullscreenManager); mToolbar.setOnTabSwitcherClickHandler(tabSwitcherClickHandler); mToolbar.setOnNewTabClickHandler(newTabClickHandler); mToolbar.setBookmarkClickHandler(bookmarkClickHandler); mToolbar.setCustomTabCloseClickHandler(customTabsBackClickHandler); mToolbar.setLayoutUpdateHost(layoutDriver); mToolbarModel.initializeWithNative(); mToolbar.addOnAttachStateChangeListener(new OnAttachStateChangeListener() { @Override public void onViewDetachedFromWindow(View v) { Context context = mToolbar.getContext(); HomepageManager.getInstance(context).removeListener(mHomepageStateListener); mTabModelSelector.removeObserver(mTabModelSelectorObserver); for (TabModel model : mTabModelSelector.getModels()) { model.removeObserver(mTabModelObserver); } if (mBookmarkBridge != null) { mBookmarkBridge.destroy(); mBookmarkBridge = null; } if (mTemplateUrlObserver != null) { TemplateUrlService.getInstance().removeObserver(mTemplateUrlObserver); mTemplateUrlObserver = null; } // Remove all previously attached observers from the FindToolbarManager. if (mFindToolbarManager != null) { for (FindToolbarObserver observer : mFindToolbarObservers) { mFindToolbarManager.removeObserver(observer); } } if (overviewModeBehavior != null) { overviewModeBehavior.removeOverviewModeObserver(mOverviewModeObserver); } if (layoutDriver != null) { layoutDriver.removeSceneChangeObserver(mSceneChangeObserver); } } @Override public void onViewAttachedToWindow(View v) { // As we have only just registered for notifications, any that were sent prior to // this may have been missed. // Calling refreshSelectedTab in case we missed the initial selection notification. refreshSelectedTab(); } }); mFindToolbarManager = findToolbarManager; assert fullscreenManager != null; mFullscreenManager = fullscreenManager; mNativeLibraryReady = false; // Add observers to the FindToolbarManager. if (mFindToolbarManager != null) { for (FindToolbarObserver observer : mFindToolbarObservers) { mFindToolbarManager.addObserver(observer); } } if (overviewModeBehavior != null) { overviewModeBehavior.addOverviewModeObserver(mOverviewModeObserver); } if (layoutDriver != null) layoutDriver.addSceneChangeObserver(mSceneChangeObserver); onNativeLibraryReady(); mInitializedWithNative = true; }
Example #9
Source File: CompositorViewHolder.java From delion with Apache License 2.0 | 4 votes |
/** * @return The {@link LayoutManager} associated with this view. */ public LayoutManager getLayoutManager() { return mLayoutManager; }
Example #10
Source File: CompositorViewHolder.java From AndroidChromium with Apache License 2.0 | 4 votes |
/** * @param layoutManager The {@link LayoutManager} instance that will be driving what * shows in this {@link CompositorViewHolder}. */ public void setLayoutManager(LayoutManager layoutManager) { mLayoutManager = layoutManager; propagateViewportToLayouts(getWidth(), getHeight()); }
Example #11
Source File: CompositorViewHolder.java From AndroidChromium with Apache License 2.0 | 4 votes |
/** * @return The {@link LayoutManager} associated with this view. */ public LayoutManager getLayoutManager() { return mLayoutManager; }
Example #12
Source File: ToolbarManager.java From AndroidChromium with Apache License 2.0 | 4 votes |
/** * Initialize the manager with the components that had native initialization dependencies. * <p> * Calling this must occur after the native library have completely loaded. * * @param tabModelSelector The selector that handles tab management. * @param controlsVisibilityDelegate The delegate to handle visibility of browser controls. * @param findToolbarManager The manager for find in page. * @param overviewModeBehavior The overview mode manager. * @param layoutDriver A {@link LayoutManager} instance used to watch for scene * changes. */ public void initializeWithNative(TabModelSelector tabModelSelector, BrowserStateBrowserControlsVisibilityDelegate controlsVisibilityDelegate, final FindToolbarManager findToolbarManager, final OverviewModeBehavior overviewModeBehavior, final LayoutManager layoutDriver, OnClickListener tabSwitcherClickHandler, OnClickListener newTabClickHandler, OnClickListener bookmarkClickHandler, OnClickListener customTabsBackClickHandler) { assert !mInitializedWithNative; mTabModelSelector = tabModelSelector; mToolbar.getLocationBar().updateVisualsForState(); mToolbar.getLocationBar().setUrlToPageUrl(); mToolbar.setBrowserControlsVisibilityDelegate(controlsVisibilityDelegate); mToolbar.setOnTabSwitcherClickHandler(tabSwitcherClickHandler); mToolbar.setOnNewTabClickHandler(newTabClickHandler); mToolbar.setBookmarkClickHandler(bookmarkClickHandler); mToolbar.setCustomTabCloseClickHandler(customTabsBackClickHandler); mToolbar.setLayoutUpdateHost(layoutDriver); mToolbarModel.initializeWithNative(); mToolbar.addOnAttachStateChangeListener(new OnAttachStateChangeListener() { @Override public void onViewDetachedFromWindow(View v) { Context context = mToolbar.getContext(); HomepageManager.getInstance(context).removeListener(mHomepageStateListener); mTabModelSelector.removeObserver(mTabModelSelectorObserver); for (TabModel model : mTabModelSelector.getModels()) { model.removeObserver(mTabModelObserver); } if (mBookmarkBridge != null) { mBookmarkBridge.destroy(); mBookmarkBridge = null; } if (mTemplateUrlObserver != null) { TemplateUrlService.getInstance().removeObserver(mTemplateUrlObserver); mTemplateUrlObserver = null; } // Remove all previously attached observers from the FindToolbarManager. if (mFindToolbarManager != null) { for (FindToolbarObserver observer : mFindToolbarObservers) { mFindToolbarManager.removeObserver(observer); } } if (overviewModeBehavior != null) { overviewModeBehavior.removeOverviewModeObserver(mOverviewModeObserver); } if (layoutDriver != null) { layoutDriver.removeSceneChangeObserver(mSceneChangeObserver); } } @Override public void onViewAttachedToWindow(View v) { // As we have only just registered for notifications, any that were sent prior to // this may have been missed. // Calling refreshSelectedTab in case we missed the initial selection notification. refreshSelectedTab(); } }); mFindToolbarManager = findToolbarManager; assert controlsVisibilityDelegate != null; mControlsVisibilityDelegate = controlsVisibilityDelegate; mNativeLibraryReady = false; // Add observers to the FindToolbarManager. if (mFindToolbarManager != null) { for (FindToolbarObserver observer : mFindToolbarObservers) { mFindToolbarManager.addObserver(observer); } } if (overviewModeBehavior != null) { overviewModeBehavior.addOverviewModeObserver(mOverviewModeObserver); } if (layoutDriver != null) layoutDriver.addSceneChangeObserver(mSceneChangeObserver); onNativeLibraryReady(); mInitializedWithNative = true; }
Example #13
Source File: CompositorViewHolder.java From 365browser with Apache License 2.0 | 4 votes |
/** * @param layoutManager The {@link LayoutManager} instance that will be driving what * shows in this {@link CompositorViewHolder}. */ public void setLayoutManager(LayoutManager layoutManager) { mLayoutManager = layoutManager; onViewportChanged(); }
Example #14
Source File: CompositorViewHolder.java From 365browser with Apache License 2.0 | 4 votes |
/** * @return The {@link LayoutManager} associated with this view. */ public LayoutManager getLayoutManager() { return mLayoutManager; }
Example #15
Source File: StripLayoutHelperManager.java From 365browser with Apache License 2.0 | 4 votes |
private long time() { return LayoutManager.time(); }
Example #16
Source File: StackLayout.java From 365browser with Apache License 2.0 | 4 votes |
private long time() { return LayoutManager.time(); }
Example #17
Source File: ToolbarManager.java From 365browser with Apache License 2.0 | 4 votes |
/** * Initialize the manager with the components that had native initialization dependencies. * <p> * Calling this must occur after the native library have completely loaded. * * @param tabModelSelector The selector that handles tab management. * @param controlsVisibilityDelegate The delegate to handle visibility of browser controls. * @param findToolbarManager The manager for find in page. * @param overviewModeBehavior The overview mode manager. * @param layoutDriver A {@link LayoutManager} instance used to watch for scene * changes. */ public void initializeWithNative(TabModelSelector tabModelSelector, BrowserStateBrowserControlsVisibilityDelegate controlsVisibilityDelegate, final FindToolbarManager findToolbarManager, final OverviewModeBehavior overviewModeBehavior, final LayoutManager layoutDriver, OnClickListener tabSwitcherClickHandler, OnClickListener newTabClickHandler, OnClickListener bookmarkClickHandler, OnClickListener customTabsBackClickHandler) { assert !mInitializedWithNative; mTabModelSelector = tabModelSelector; mToolbar.getLocationBar().updateVisualsForState(); mToolbar.getLocationBar().setUrlToPageUrl(); mToolbar.setBrowserControlsVisibilityDelegate(controlsVisibilityDelegate); mToolbar.setOnTabSwitcherClickHandler(tabSwitcherClickHandler); mToolbar.setOnNewTabClickHandler(newTabClickHandler); mToolbar.setBookmarkClickHandler(bookmarkClickHandler); mToolbar.setCustomTabCloseClickHandler(customTabsBackClickHandler); mToolbar.setLayoutUpdateHost(layoutDriver); mToolbarModel.initializeWithNative(); mToolbar.addOnAttachStateChangeListener(new OnAttachStateChangeListener() { @Override public void onViewDetachedFromWindow(View v) { Context context = mToolbar.getContext(); HomepageManager.getInstance(context).removeListener(mHomepageStateListener); mTabModelSelector.removeObserver(mTabModelSelectorObserver); for (TabModel model : mTabModelSelector.getModels()) { model.removeObserver(mTabModelObserver); } if (mBookmarkBridge != null) { mBookmarkBridge.destroy(); mBookmarkBridge = null; } if (mTemplateUrlObserver != null) { TemplateUrlService.getInstance().removeObserver(mTemplateUrlObserver); mTemplateUrlObserver = null; } // Remove all previously attached observers from the FindToolbarManager. if (mFindToolbarManager != null) { for (FindToolbarObserver observer : mFindToolbarObservers) { mFindToolbarManager.removeObserver(observer); } } if (overviewModeBehavior != null) { overviewModeBehavior.removeOverviewModeObserver(mOverviewModeObserver); } if (layoutDriver != null) { layoutDriver.removeSceneChangeObserver(mSceneChangeObserver); } } @Override public void onViewAttachedToWindow(View v) { // As we have only just registered for notifications, any that were sent prior to // this may have been missed. // Calling refreshSelectedTab in case we missed the initial selection notification. refreshSelectedTab(); } }); mFindToolbarManager = findToolbarManager; assert controlsVisibilityDelegate != null; mControlsVisibilityDelegate = controlsVisibilityDelegate; mNativeLibraryReady = false; // Add observers to the FindToolbarManager. if (mFindToolbarManager != null) { for (FindToolbarObserver observer : mFindToolbarObservers) { mFindToolbarManager.addObserver(observer); } } if (overviewModeBehavior != null) { overviewModeBehavior.addOverviewModeObserver(mOverviewModeObserver); } if (layoutDriver != null) layoutDriver.addSceneChangeObserver(mSceneChangeObserver); onNativeLibraryReady(); mInitializedWithNative = true; }
Example #18
Source File: CompositorViewHolder.java From delion with Apache License 2.0 | 4 votes |
/** * @param layoutManager The {@link LayoutManager} instance that will be driving what * shows in this {@link CompositorViewHolder}. */ public void setLayoutManager(LayoutManager layoutManager) { mLayoutManager = layoutManager; propagateViewportToLayouts(getWidth(), getHeight()); }