// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. #ifndef JCEF_NATIVE_REQUEST_HANDLER_H_ #define JCEF_NATIVE_REQUEST_HANDLER_H_ #pragma once #include #include "include/cef_request_handler.h" #include "jni_scoped_helpers.h" // RequestHandler implementation. class RequestHandler : public CefRequestHandler { public: RequestHandler(JNIEnv* env, jobject handler); // CefRequestHandler methods: bool OnBeforeBrowse(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, bool user_gesture, bool is_redirect) override; bool OnOpenURLFromTab(CefRefPtr browser, CefRefPtr frame, const CefString& target_url, WindowOpenDisposition target_disposition, bool user_gesture) override; CefRefPtr GetResourceRequestHandler( CefRefPtr browser, CefRefPtr frame, CefRefPtr request, bool is_navigation, bool is_download, const CefString& request_initiator, bool& disable_default_handling) override; bool GetAuthCredentials(CefRefPtr browser, const CefString& origin_url, bool isProxy, const CefString& host, int port, const CefString& realm, const CefString& scheme, CefRefPtr callback) override; bool OnCertificateError(CefRefPtr browser, cef_errorcode_t cert_error, const CefString& request_url, CefRefPtr ssl_info, CefRefPtr callback) override; void OnRenderProcessTerminated(CefRefPtr browser, TerminationStatus status, int error_code, const CefString& error_string) override; protected: ScopedJNIObjectGlobal handle_; // Include the default reference counting implementation. IMPLEMENT_REFCOUNTING(RequestHandler); }; #endif // JCEF_NATIVE_REQUEST_HANDLER_H_