// 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_LOAD_HANDLER_H_ #define JCEF_NATIVE_LOAD_HANDLER_H_ #pragma once #include #include "include/cef_load_handler.h" #include "jni_scoped_helpers.h" // LoadHandler implementation. class LoadHandler : public CefLoadHandler { public: LoadHandler(JNIEnv* env, jobject handler); // CefLoadHandler methods void OnLoadingStateChange(CefRefPtr browser, bool isLoading, bool canGoBack, bool canGoForward) override; void OnLoadStart(CefRefPtr browser, CefRefPtr frame, TransitionType transition_type) override; void OnLoadEnd(CefRefPtr browser, CefRefPtr frame, int httpStatusCode) override; void OnLoadError(CefRefPtr browser, CefRefPtr frame, ErrorCode errorCode, const CefString& errorText, const CefString& failedUrl) override; protected: ScopedJNIObjectGlobal handle_; // Include the default reference counting implementation. IMPLEMENT_REFCOUNTING(LoadHandler); }; #endif // JCEF_NATIVE_LOAD_HANDLER_H_