- @Override
- public void onHttpAuthenticationCancel() {
- // Cancel the `HttpAuthHandler`.
- httpAuthHandler.cancel();
- }
-
- @Override
- public void onHttpAuthenticationProceed(DialogFragment dialogFragment) {
- // Get handles for the `EditTexts`.
- EditText usernameEditText = dialogFragment.getDialog().findViewById(R.id.http_authentication_username);
- EditText passwordEditText = dialogFragment.getDialog().findViewById(R.id.http_authentication_password);
-
- // Proceed with the HTTP authentication.
- httpAuthHandler.proceed(usernameEditText.getText().toString(), passwordEditText.getText().toString());
- }
-
- @Override
- public void onSslErrorCancel() { // TODO. How to handle this with multiple tabs? There could be multiple errors at once.
- sslErrorHandler.cancel();
- }
-
- @Override
- public void onSslErrorProceed() { // TODO. How to handle this with multiple tabs? There could be multiple errors at once.
- sslErrorHandler.proceed();
- }
-
- @Override
- public void onPinnedMismatchBack() { // TODO. Move this logic to the dialog.
- if (currentWebView.canGoBack()) { // There is a back page in the history.
- // Reset the current domain name so that navigation works if third-party requests are blocked.
- currentWebView.resetCurrentDomainName();
-
- // Set `navigatingHistory` so that the domain settings are applied when the new URL is loaded.
- navigatingHistory = true; // TODO.
-
- // Go back.
- currentWebView.goBack();
- } else { // There are no pages to go back to.
- // Load a blank page
- loadUrl("");
- }
- }
-
- @Override
- public void onPinnedMismatchProceed() { // TODO. Move this logic to the dialog.
- // Do not check the pinned information for this domain again until the domain changes.
- currentWebView.setIgnorePinnedDomainInformation(true);
- }
-
- @Override
- public void onUrlHistoryEntrySelected(int moveBackOrForwardSteps) {
- // Reset the current domain name so that navigation works if third-party requests are blocked.
- currentWebView.resetCurrentDomainName();
-
- // Set `navigatingHistory` so that the domain settings are applied when the new URL is loaded.
- navigatingHistory = true;
-
- // Load the history entry.
- currentWebView.goBackOrForward(moveBackOrForwardSteps);
- }
-
- @Override
- public void onClearHistory() {
- // Clear the history.
- currentWebView.clearHistory();
- }
-