45 lines
1.4 KiB
C++
45 lines
1.4 KiB
C++
// 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 <jni.h>
|
|
|
|
#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<CefBrowser> browser,
|
|
bool isLoading,
|
|
bool canGoBack,
|
|
bool canGoForward) override;
|
|
void OnLoadStart(CefRefPtr<CefBrowser> browser,
|
|
CefRefPtr<CefFrame> frame,
|
|
TransitionType transition_type) override;
|
|
void OnLoadEnd(CefRefPtr<CefBrowser> browser,
|
|
CefRefPtr<CefFrame> frame,
|
|
int httpStatusCode) override;
|
|
void OnLoadError(CefRefPtr<CefBrowser> browser,
|
|
CefRefPtr<CefFrame> 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_
|