Package com.cefrium

Class CefModalDialogPresenter

java.lang.Object
org.chromium.ui.modaldialog.ModalDialogManager.Presenter
com.cefrium.CefModalDialogPresenter

public class CefModalDialogPresenter extends org.chromium.ui.modaldialog.ModalDialogManager.Presenter
A ModalDialogManager.Presenter that renders Chromium dialog models with a plain Android AlertDialog.

Chrome's AppModalPresenter inflates a Chromium dialog layout (ButtonCompat + ThemeOverlay.BrowserUI.ModalDialog styles + ColorStateLists) whose resource graph does not resolve cleanly inside an embedding AAR (the same coupling that broke the contacts picker). This draws the dialog with the platform AlertDialog instead - same approach as Cefrium's device chooser and contact picker. It is enough for the dialogs an embedding hits today, the most important being the File System Access "let this site view files in this folder?" permission prompt (a tab-modal dialog). Without any presenter the native ModalDialogWrapper::ShowTabModal CHECK(dialog_manager) crashes the process.

  • Constructor Summary

    Constructors
    Constructor
    Description
    CefModalDialogPresenter(android.content.Context context)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addDialogView(org.chromium.ui.modelutil.PropertyModel model, org.chromium.base.Callback<androidx.activity.ComponentDialog> onDialogCreatedCallback, org.chromium.base.Callback<android.view.View> onDialogShownCallback)
     
    protected void
    removeDialogView(org.chromium.ui.modelutil.PropertyModel model)
     

    Methods inherited from class org.chromium.ui.modaldialog.ModalDialogManager.Presenter

    dismissCurrentDialog, getDialogModel, setEdgeToEdgeStateSupplier, setInsetObserver

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CefModalDialogPresenter

      public CefModalDialogPresenter(android.content.Context context)
  • Method Details

    • addDialogView

      protected void addDialogView(org.chromium.ui.modelutil.PropertyModel model, org.chromium.base.Callback<androidx.activity.ComponentDialog> onDialogCreatedCallback, org.chromium.base.Callback<android.view.View> onDialogShownCallback)
      Specified by:
      addDialogView in class org.chromium.ui.modaldialog.ModalDialogManager.Presenter
    • removeDialogView

      protected void removeDialogView(org.chromium.ui.modelutil.PropertyModel model)
      Specified by:
      removeDialogView in class org.chromium.ui.modaldialog.ModalDialogManager.Presenter