mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefBrowserHost::GetNavigationEntries for retrieving a snapshot of navigation history (issue #1442).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1924 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "libcef_dll/cpptoc/drag_data_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/request_context_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/client_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/navigation_entry_visitor_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/run_file_dialog_callback_ctocpp.h"
|
||||
#include "libcef_dll/transfer_util.h"
|
||||
|
||||
@@ -389,6 +390,25 @@ void CEF_CALLBACK browser_host_close_dev_tools(
|
||||
CefBrowserHostCppToC::Get(self)->CloseDevTools();
|
||||
}
|
||||
|
||||
void CEF_CALLBACK browser_host_get_navigation_entries(
|
||||
struct _cef_browser_host_t* self, cef_navigation_entry_visitor_t* visitor,
|
||||
int current_only) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: visitor; type: refptr_diff
|
||||
DCHECK(visitor);
|
||||
if (!visitor)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefBrowserHostCppToC::Get(self)->GetNavigationEntries(
|
||||
CefNavigationEntryVisitorCToCpp::Wrap(visitor),
|
||||
current_only?true:false);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK browser_host_set_mouse_cursor_change_disabled(
|
||||
struct _cef_browser_host_t* self, int disabled) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
@@ -830,6 +850,7 @@ CefBrowserHostCppToC::CefBrowserHostCppToC(CefBrowserHost* cls)
|
||||
struct_.struct_.stop_finding = browser_host_stop_finding;
|
||||
struct_.struct_.show_dev_tools = browser_host_show_dev_tools;
|
||||
struct_.struct_.close_dev_tools = browser_host_close_dev_tools;
|
||||
struct_.struct_.get_navigation_entries = browser_host_get_navigation_entries;
|
||||
struct_.struct_.set_mouse_cursor_change_disabled =
|
||||
browser_host_set_mouse_cursor_change_disabled;
|
||||
struct_.struct_.is_mouse_cursor_change_disabled =
|
||||
|
191
libcef_dll/cpptoc/navigation_entry_cpptoc.cc
Normal file
191
libcef_dll/cpptoc/navigation_entry_cpptoc.cc
Normal file
@@ -0,0 +1,191 @@
|
||||
// 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/navigation_entry_cpptoc.h"
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK navigation_entry_is_valid(
|
||||
struct _cef_navigation_entry_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefNavigationEntryCppToC::Get(self)->IsValid();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK navigation_entry_get_url(
|
||||
struct _cef_navigation_entry_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefNavigationEntryCppToC::Get(self)->GetURL();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK navigation_entry_get_display_url(
|
||||
struct _cef_navigation_entry_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefNavigationEntryCppToC::Get(self)->GetDisplayURL();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK navigation_entry_get_original_url(
|
||||
struct _cef_navigation_entry_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefNavigationEntryCppToC::Get(self)->GetOriginalURL();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK navigation_entry_get_title(
|
||||
struct _cef_navigation_entry_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefNavigationEntryCppToC::Get(self)->GetTitle();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_transition_type_t CEF_CALLBACK navigation_entry_get_transition_type(
|
||||
struct _cef_navigation_entry_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return TT_EXPLICIT;
|
||||
|
||||
// Execute
|
||||
cef_transition_type_t _retval = CefNavigationEntryCppToC::Get(
|
||||
self)->GetTransitionType();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK navigation_entry_has_post_data(
|
||||
struct _cef_navigation_entry_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefNavigationEntryCppToC::Get(self)->HasPostData();
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
cef_string_userfree_t CEF_CALLBACK navigation_entry_get_frame_name(
|
||||
struct _cef_navigation_entry_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefString _retval = CefNavigationEntryCppToC::Get(self)->GetFrameName();
|
||||
|
||||
// Return type: string
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_time_t CEF_CALLBACK navigation_entry_get_completion_time(
|
||||
struct _cef_navigation_entry_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return CefTime();
|
||||
|
||||
// Execute
|
||||
cef_time_t _retval = CefNavigationEntryCppToC::Get(self)->GetCompletionTime();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK navigation_entry_get_http_status_code(
|
||||
struct _cef_navigation_entry_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
int _retval = CefNavigationEntryCppToC::Get(self)->GetHttpStatusCode();
|
||||
|
||||
// Return type: simple
|
||||
return _retval;
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefNavigationEntryCppToC::CefNavigationEntryCppToC(CefNavigationEntry* cls)
|
||||
: CefCppToC<CefNavigationEntryCppToC, CefNavigationEntry,
|
||||
cef_navigation_entry_t>(cls) {
|
||||
struct_.struct_.is_valid = navigation_entry_is_valid;
|
||||
struct_.struct_.get_url = navigation_entry_get_url;
|
||||
struct_.struct_.get_display_url = navigation_entry_get_display_url;
|
||||
struct_.struct_.get_original_url = navigation_entry_get_original_url;
|
||||
struct_.struct_.get_title = navigation_entry_get_title;
|
||||
struct_.struct_.get_transition_type = navigation_entry_get_transition_type;
|
||||
struct_.struct_.has_post_data = navigation_entry_has_post_data;
|
||||
struct_.struct_.get_frame_name = navigation_entry_get_frame_name;
|
||||
struct_.struct_.get_completion_time = navigation_entry_get_completion_time;
|
||||
struct_.struct_.get_http_status_code = navigation_entry_get_http_status_code;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> base::AtomicRefCount CefCppToC<CefNavigationEntryCppToC,
|
||||
CefNavigationEntry, cef_navigation_entry_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
36
libcef_dll/cpptoc/navigation_entry_cpptoc.h
Normal file
36
libcef_dll/cpptoc/navigation_entry_cpptoc.h
Normal file
@@ -0,0 +1,36 @@
|
||||
// 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef BUILDING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||
#else // BUILDING_CEF_SHARED
|
||||
|
||||
#include "include/cef_navigation_entry.h"
|
||||
#include "include/capi/cef_navigation_entry_capi.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed DLL-side only.
|
||||
class CefNavigationEntryCppToC
|
||||
: public CefCppToC<CefNavigationEntryCppToC, CefNavigationEntry,
|
||||
cef_navigation_entry_t> {
|
||||
public:
|
||||
explicit CefNavigationEntryCppToC(CefNavigationEntry* cls);
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_CPPTOC_H_
|
||||
|
59
libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc
Normal file
59
libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc
Normal file
@@ -0,0 +1,59 @@
|
||||
// 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/navigation_entry_ctocpp.h"
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
int CEF_CALLBACK navigation_entry_visitor_visit(
|
||||
struct _cef_navigation_entry_visitor_t* self,
|
||||
struct _cef_navigation_entry_t* entry, int current, int index,
|
||||
int total) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Verify param: entry; type: refptr_diff
|
||||
DCHECK(entry);
|
||||
if (!entry)
|
||||
return 0;
|
||||
|
||||
// Execute
|
||||
bool _retval = CefNavigationEntryVisitorCppToC::Get(self)->Visit(
|
||||
CefNavigationEntryCToCpp::Wrap(entry),
|
||||
current?true:false,
|
||||
index,
|
||||
total);
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefNavigationEntryVisitorCppToC::CefNavigationEntryVisitorCppToC(
|
||||
CefNavigationEntryVisitor* cls)
|
||||
: CefCppToC<CefNavigationEntryVisitorCppToC, CefNavigationEntryVisitor,
|
||||
cef_navigation_entry_visitor_t>(cls) {
|
||||
struct_.struct_.visit = navigation_entry_visitor_visit;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> base::AtomicRefCount CefCppToC<CefNavigationEntryVisitorCppToC,
|
||||
CefNavigationEntryVisitor, cef_navigation_entry_visitor_t>::DebugObjCt =
|
||||
0;
|
||||
#endif
|
||||
|
38
libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h
Normal file
38
libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h
Normal file
@@ -0,0 +1,38 @@
|
||||
// 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_VISITOR_CPPTOC_H_
|
||||
#define CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_VISITOR_CPPTOC_H_
|
||||
#pragma once
|
||||
|
||||
#ifndef USING_CEF_SHARED
|
||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||
#else // USING_CEF_SHARED
|
||||
|
||||
#include "include/cef_browser.h"
|
||||
#include "include/capi/cef_browser_capi.h"
|
||||
#include "include/cef_client.h"
|
||||
#include "include/capi/cef_client_capi.h"
|
||||
#include "libcef_dll/cpptoc/cpptoc.h"
|
||||
|
||||
// Wrap a C++ class with a C structure.
|
||||
// This class may be instantiated and accessed wrapper-side only.
|
||||
class CefNavigationEntryVisitorCppToC
|
||||
: public CefCppToC<CefNavigationEntryVisitorCppToC,
|
||||
CefNavigationEntryVisitor, cef_navigation_entry_visitor_t> {
|
||||
public:
|
||||
explicit CefNavigationEntryVisitorCppToC(CefNavigationEntryVisitor* cls);
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
#endif // CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_VISITOR_CPPTOC_H_
|
||||
|
Reference in New Issue
Block a user