mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefFindHandler for reporting find results (issue #1482).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1969 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -28,6 +28,7 @@
|
|||||||
'include/cef_download_item.h',
|
'include/cef_download_item.h',
|
||||||
'include/cef_drag_data.h',
|
'include/cef_drag_data.h',
|
||||||
'include/cef_drag_handler.h',
|
'include/cef_drag_handler.h',
|
||||||
|
'include/cef_find_handler.h',
|
||||||
'include/cef_focus_handler.h',
|
'include/cef_focus_handler.h',
|
||||||
'include/cef_frame.h',
|
'include/cef_frame.h',
|
||||||
'include/cef_geolocation.h',
|
'include/cef_geolocation.h',
|
||||||
@ -83,6 +84,7 @@
|
|||||||
'include/capi/cef_download_item_capi.h',
|
'include/capi/cef_download_item_capi.h',
|
||||||
'include/capi/cef_drag_data_capi.h',
|
'include/capi/cef_drag_data_capi.h',
|
||||||
'include/capi/cef_drag_handler_capi.h',
|
'include/capi/cef_drag_handler_capi.h',
|
||||||
|
'include/capi/cef_find_handler_capi.h',
|
||||||
'include/capi/cef_focus_handler_capi.h',
|
'include/capi/cef_focus_handler_capi.h',
|
||||||
'include/capi/cef_frame_capi.h',
|
'include/capi/cef_frame_capi.h',
|
||||||
'include/capi/cef_geolocation_capi.h',
|
'include/capi/cef_geolocation_capi.h',
|
||||||
@ -180,6 +182,8 @@
|
|||||||
'libcef_dll/ctocpp/end_tracing_callback_ctocpp.h',
|
'libcef_dll/ctocpp/end_tracing_callback_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc',
|
'libcef_dll/cpptoc/file_dialog_callback_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/file_dialog_callback_cpptoc.h',
|
'libcef_dll/cpptoc/file_dialog_callback_cpptoc.h',
|
||||||
|
'libcef_dll/ctocpp/find_handler_ctocpp.cc',
|
||||||
|
'libcef_dll/ctocpp/find_handler_ctocpp.h',
|
||||||
'libcef_dll/ctocpp/focus_handler_ctocpp.cc',
|
'libcef_dll/ctocpp/focus_handler_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/focus_handler_ctocpp.h',
|
'libcef_dll/ctocpp/focus_handler_ctocpp.h',
|
||||||
'libcef_dll/cpptoc/frame_cpptoc.cc',
|
'libcef_dll/cpptoc/frame_cpptoc.cc',
|
||||||
@ -350,6 +354,8 @@
|
|||||||
'libcef_dll/cpptoc/end_tracing_callback_cpptoc.h',
|
'libcef_dll/cpptoc/end_tracing_callback_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc',
|
'libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc',
|
||||||
'libcef_dll/ctocpp/file_dialog_callback_ctocpp.h',
|
'libcef_dll/ctocpp/file_dialog_callback_ctocpp.h',
|
||||||
|
'libcef_dll/cpptoc/find_handler_cpptoc.cc',
|
||||||
|
'libcef_dll/cpptoc/find_handler_cpptoc.h',
|
||||||
'libcef_dll/cpptoc/focus_handler_cpptoc.cc',
|
'libcef_dll/cpptoc/focus_handler_cpptoc.cc',
|
||||||
'libcef_dll/cpptoc/focus_handler_cpptoc.h',
|
'libcef_dll/cpptoc/focus_handler_cpptoc.h',
|
||||||
'libcef_dll/ctocpp/frame_ctocpp.cc',
|
'libcef_dll/ctocpp/frame_ctocpp.cc',
|
||||||
|
@ -344,7 +344,8 @@ typedef struct _cef_browser_host_t {
|
|||||||
// running simultaniously. |forward| indicates whether to search forward or
|
// running simultaniously. |forward| indicates whether to search forward or
|
||||||
// backward within the page. |matchCase| indicates whether the search should
|
// backward within the page. |matchCase| indicates whether the search should
|
||||||
// be case-sensitive. |findNext| indicates whether this is the first request
|
// be case-sensitive. |findNext| indicates whether this is the first request
|
||||||
// or a follow-up.
|
// or a follow-up. The cef_find_handler_t instance, if any, returned via
|
||||||
|
// cef_client_t::GetFindHandler will be called to report find results.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *find)(struct _cef_browser_host_t* self, int identifier,
|
void (CEF_CALLBACK *find)(struct _cef_browser_host_t* self, int identifier,
|
||||||
const cef_string_t* searchText, int forward, int matchCase,
|
const cef_string_t* searchText, int forward, int matchCase,
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include "include/capi/cef_display_handler_capi.h"
|
#include "include/capi/cef_display_handler_capi.h"
|
||||||
#include "include/capi/cef_download_handler_capi.h"
|
#include "include/capi/cef_download_handler_capi.h"
|
||||||
#include "include/capi/cef_drag_handler_capi.h"
|
#include "include/capi/cef_drag_handler_capi.h"
|
||||||
|
#include "include/capi/cef_find_handler_capi.h"
|
||||||
#include "include/capi/cef_focus_handler_capi.h"
|
#include "include/capi/cef_focus_handler_capi.h"
|
||||||
#include "include/capi/cef_geolocation_handler_capi.h"
|
#include "include/capi/cef_geolocation_handler_capi.h"
|
||||||
#include "include/capi/cef_jsdialog_handler_capi.h"
|
#include "include/capi/cef_jsdialog_handler_capi.h"
|
||||||
@ -101,6 +102,12 @@ typedef struct _cef_client_t {
|
|||||||
struct _cef_drag_handler_t* (CEF_CALLBACK *get_drag_handler)(
|
struct _cef_drag_handler_t* (CEF_CALLBACK *get_drag_handler)(
|
||||||
struct _cef_client_t* self);
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Return the handler for find result events.
|
||||||
|
///
|
||||||
|
struct _cef_find_handler_t* (CEF_CALLBACK *get_find_handler)(
|
||||||
|
struct _cef_client_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for focus events.
|
// Return the handler for focus events.
|
||||||
///
|
///
|
||||||
|
78
include/capi/cef_find_handler_capi.h
Normal file
78
include/capi/cef_find_handler_capi.h
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||||
|
// Framework nor the names of its contributors may be used to endorse
|
||||||
|
// or promote products derived from this software without specific prior
|
||||||
|
// written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This file was generated by the CEF translator tool and should not edited
|
||||||
|
// by hand. See the translator.README.txt file in the tools directory for
|
||||||
|
// more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
|
||||||
|
#define CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/capi/cef_base_capi.h"
|
||||||
|
#include "include/capi/cef_browser_capi.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
// Implement this structure to handle events related to find results. The
|
||||||
|
// functions of this structure will be called on the UI thread.
|
||||||
|
///
|
||||||
|
typedef struct _cef_find_handler_t {
|
||||||
|
///
|
||||||
|
// Base structure.
|
||||||
|
///
|
||||||
|
cef_base_t base;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Called to report find results returned by cef_browser_host_t::find().
|
||||||
|
// |identifer| is the identifier passed to find(), |count| is the number of
|
||||||
|
// matches currently identified, |selectionRect| is the location of where the
|
||||||
|
// match was found (in window coordinates), |activeMatchOrdinal| is the
|
||||||
|
// current position in the search results, and |finalUpdate| is true (1) if
|
||||||
|
// this is the last find notification.
|
||||||
|
///
|
||||||
|
void (CEF_CALLBACK *on_find_result)(struct _cef_find_handler_t* self,
|
||||||
|
struct _cef_browser_t* browser, int identifier, int count,
|
||||||
|
const cef_rect_t* selectionRect, int activeMatchOrdinal,
|
||||||
|
int finalUpdate);
|
||||||
|
} cef_find_handler_t;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // CEF_INCLUDE_CAPI_CEF_FIND_HANDLER_CAPI_H_
|
@ -388,7 +388,8 @@ class CefBrowserHost : public virtual CefBase {
|
|||||||
// running simultaniously. |forward| indicates whether to search forward or
|
// running simultaniously. |forward| indicates whether to search forward or
|
||||||
// backward within the page. |matchCase| indicates whether the search should
|
// backward within the page. |matchCase| indicates whether the search should
|
||||||
// be case-sensitive. |findNext| indicates whether this is the first request
|
// be case-sensitive. |findNext| indicates whether this is the first request
|
||||||
// or a follow-up.
|
// or a follow-up. The CefFindHandler instance, if any, returned via
|
||||||
|
// CefClient::GetFindHandler will be called to report find results.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual void Find(int identifier, const CefString& searchText,
|
virtual void Find(int identifier, const CefString& searchText,
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include "include/cef_display_handler.h"
|
#include "include/cef_display_handler.h"
|
||||||
#include "include/cef_download_handler.h"
|
#include "include/cef_download_handler.h"
|
||||||
#include "include/cef_drag_handler.h"
|
#include "include/cef_drag_handler.h"
|
||||||
|
#include "include/cef_find_handler.h"
|
||||||
#include "include/cef_focus_handler.h"
|
#include "include/cef_focus_handler.h"
|
||||||
#include "include/cef_geolocation_handler.h"
|
#include "include/cef_geolocation_handler.h"
|
||||||
#include "include/cef_jsdialog_handler.h"
|
#include "include/cef_jsdialog_handler.h"
|
||||||
@ -103,6 +104,14 @@ class CefClient : public virtual CefBase {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
// Return the handler for find result events.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual CefRefPtr<CefFindHandler> GetFindHandler() {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
// Return the handler for focus events.
|
// Return the handler for focus events.
|
||||||
///
|
///
|
||||||
|
68
include/cef_find_handler.h
Normal file
68
include/cef_find_handler.h
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
// * Neither the name of Google Inc. nor the name Chromium Embedded
|
||||||
|
// Framework nor the names of its contributors may be used to endorse
|
||||||
|
// or promote products derived from this software without specific prior
|
||||||
|
// written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// The contents of this file must follow a specific format in order to
|
||||||
|
// support the CEF translator tool. See the translator.README.txt file in the
|
||||||
|
// tools directory for more information.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef CEF_INCLUDE_CEF_FIND_HANDLER_H_
|
||||||
|
#define CEF_INCLUDE_CEF_FIND_HANDLER_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "include/cef_base.h"
|
||||||
|
#include "include/cef_browser.h"
|
||||||
|
|
||||||
|
///
|
||||||
|
// Implement this interface to handle events related to find results. The
|
||||||
|
// methods of this class will be called on the UI thread.
|
||||||
|
///
|
||||||
|
/*--cef(source=client)--*/
|
||||||
|
class CefFindHandler : public virtual CefBase {
|
||||||
|
public:
|
||||||
|
///
|
||||||
|
// Called to report find results returned by CefBrowserHost::Find().
|
||||||
|
// |identifer| is the identifier passed to Find(), |count| is the number of
|
||||||
|
// matches currently identified, |selectionRect| is the location of where the
|
||||||
|
// match was found (in window coordinates), |activeMatchOrdinal| is the
|
||||||
|
// current position in the search results, and |finalUpdate| is true if this
|
||||||
|
// is the last find notification.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual void OnFindResult(CefRefPtr<CefBrowser> browser,
|
||||||
|
int identifier,
|
||||||
|
int count,
|
||||||
|
const CefRect& selectionRect,
|
||||||
|
int activeMatchOrdinal,
|
||||||
|
bool finalUpdate) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CEF_INCLUDE_CEF_FIND_HANDLER_H_
|
@ -1780,6 +1780,24 @@ void CefBrowserHostImpl::RunFileChooser(
|
|||||||
callback));
|
callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CefBrowserHostImpl::FindReply(
|
||||||
|
content::WebContents* web_contents,
|
||||||
|
int request_id,
|
||||||
|
int number_of_matches,
|
||||||
|
const gfx::Rect& selection_rect,
|
||||||
|
int active_match_ordinal,
|
||||||
|
bool final_update) {
|
||||||
|
if (client_.get()) {
|
||||||
|
CefRefPtr<CefFindHandler> handler = client_->GetFindHandler();
|
||||||
|
if (handler.get()) {
|
||||||
|
CefRect rect(selection_rect.x(), selection_rect.y(),
|
||||||
|
selection_rect.width(), selection_rect.height());
|
||||||
|
handler->OnFindResult(this, request_id, number_of_matches,
|
||||||
|
rect, active_match_ordinal, final_update);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if !defined(OS_MACOSX)
|
#if !defined(OS_MACOSX)
|
||||||
CefTextInputContext CefBrowserHostImpl::GetNSTextInputContext() {
|
CefTextInputContext CefBrowserHostImpl::GetNSTextInputContext() {
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
|
@ -389,6 +389,13 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
|||||||
void RunFileChooser(
|
void RunFileChooser(
|
||||||
content::WebContents* tab,
|
content::WebContents* tab,
|
||||||
const content::FileChooserParams& params) override;
|
const content::FileChooserParams& params) override;
|
||||||
|
void FindReply(
|
||||||
|
content::WebContents* web_contents,
|
||||||
|
int request_id,
|
||||||
|
int number_of_matches,
|
||||||
|
const gfx::Rect& selection_rect,
|
||||||
|
int active_match_ordinal,
|
||||||
|
bool final_update) override;
|
||||||
void UpdatePreferredSize(content::WebContents* source,
|
void UpdatePreferredSize(content::WebContents* source,
|
||||||
const gfx::Size& pref_size) override;
|
const gfx::Size& pref_size) override;
|
||||||
void RequestMediaAccessPermission(
|
void RequestMediaAccessPermission(
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include "libcef_dll/cpptoc/display_handler_cpptoc.h"
|
#include "libcef_dll/cpptoc/display_handler_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/download_handler_cpptoc.h"
|
#include "libcef_dll/cpptoc/download_handler_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/drag_handler_cpptoc.h"
|
#include "libcef_dll/cpptoc/drag_handler_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/find_handler_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/focus_handler_cpptoc.h"
|
#include "libcef_dll/cpptoc/focus_handler_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/geolocation_handler_cpptoc.h"
|
#include "libcef_dll/cpptoc/geolocation_handler_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h"
|
#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h"
|
||||||
@ -110,6 +111,22 @@ struct _cef_drag_handler_t* CEF_CALLBACK client_get_drag_handler(
|
|||||||
return CefDragHandlerCppToC::Wrap(_retval);
|
return CefDragHandlerCppToC::Wrap(_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct _cef_find_handler_t* CEF_CALLBACK client_get_find_handler(
|
||||||
|
struct _cef_client_t* self) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRefPtr<CefFindHandler> _retval = CefClientCppToC::Get(
|
||||||
|
self)->GetFindHandler();
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefFindHandlerCppToC::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
struct _cef_focus_handler_t* CEF_CALLBACK client_get_focus_handler(
|
struct _cef_focus_handler_t* CEF_CALLBACK client_get_focus_handler(
|
||||||
struct _cef_client_t* self) {
|
struct _cef_client_t* self) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
@ -275,6 +292,7 @@ CefClientCppToC::CefClientCppToC(CefClient* cls)
|
|||||||
struct_.struct_.get_display_handler = client_get_display_handler;
|
struct_.struct_.get_display_handler = client_get_display_handler;
|
||||||
struct_.struct_.get_download_handler = client_get_download_handler;
|
struct_.struct_.get_download_handler = client_get_download_handler;
|
||||||
struct_.struct_.get_drag_handler = client_get_drag_handler;
|
struct_.struct_.get_drag_handler = client_get_drag_handler;
|
||||||
|
struct_.struct_.get_find_handler = client_get_find_handler;
|
||||||
struct_.struct_.get_focus_handler = client_get_focus_handler;
|
struct_.struct_.get_focus_handler = client_get_focus_handler;
|
||||||
struct_.struct_.get_geolocation_handler = client_get_geolocation_handler;
|
struct_.struct_.get_geolocation_handler = client_get_geolocation_handler;
|
||||||
struct_.struct_.get_jsdialog_handler = client_get_jsdialog_handler;
|
struct_.struct_.get_jsdialog_handler = client_get_jsdialog_handler;
|
||||||
|
62
libcef_dll/cpptoc/find_handler_cpptoc.cc
Normal file
62
libcef_dll/cpptoc/find_handler_cpptoc.cc
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
// Copyright (c) 2015 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/find_handler_cpptoc.h"
|
||||||
|
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||||
|
|
||||||
|
void CEF_CALLBACK find_handler_on_find_result(struct _cef_find_handler_t* self,
|
||||||
|
cef_browser_t* browser, int identifier, int count,
|
||||||
|
const cef_rect_t* selectionRect, int activeMatchOrdinal,
|
||||||
|
int finalUpdate) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
// Verify param: browser; type: refptr_diff
|
||||||
|
DCHECK(browser);
|
||||||
|
if (!browser)
|
||||||
|
return;
|
||||||
|
// Verify param: selectionRect; type: simple_byref_const
|
||||||
|
DCHECK(selectionRect);
|
||||||
|
if (!selectionRect)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Translate param: selectionRect; type: simple_byref_const
|
||||||
|
CefRect selectionRectVal = selectionRect?*selectionRect:CefRect();
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefFindHandlerCppToC::Get(self)->OnFindResult(
|
||||||
|
CefBrowserCToCpp::Wrap(browser),
|
||||||
|
identifier,
|
||||||
|
count,
|
||||||
|
selectionRectVal,
|
||||||
|
activeMatchOrdinal,
|
||||||
|
finalUpdate?true:false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTRUCTOR - Do not edit by hand.
|
||||||
|
|
||||||
|
CefFindHandlerCppToC::CefFindHandlerCppToC(CefFindHandler* cls)
|
||||||
|
: CefCppToC<CefFindHandlerCppToC, CefFindHandler, cef_find_handler_t>(cls) {
|
||||||
|
struct_.struct_.on_find_result = find_handler_on_find_result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
template<> base::AtomicRefCount CefCppToC<CefFindHandlerCppToC, CefFindHandler,
|
||||||
|
cef_find_handler_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
36
libcef_dll/cpptoc/find_handler_cpptoc.h
Normal file
36
libcef_dll/cpptoc/find_handler_cpptoc.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// Copyright (c) 2015 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_FIND_HANDLER_CPPTOC_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CPPTOC_FIND_HANDLER_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_find_handler.h"
|
||||||
|
#include "include/capi/cef_find_handler_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 CefFindHandlerCppToC
|
||||||
|
: public CefCppToC<CefFindHandlerCppToC, CefFindHandler,
|
||||||
|
cef_find_handler_t> {
|
||||||
|
public:
|
||||||
|
explicit CefFindHandlerCppToC(CefFindHandler* cls);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // USING_CEF_SHARED
|
||||||
|
#endif // CEF_LIBCEF_DLL_CPPTOC_FIND_HANDLER_CPPTOC_H_
|
||||||
|
|
@ -18,6 +18,7 @@
|
|||||||
#include "libcef_dll/ctocpp/display_handler_ctocpp.h"
|
#include "libcef_dll/ctocpp/display_handler_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/download_handler_ctocpp.h"
|
#include "libcef_dll/ctocpp/download_handler_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/drag_handler_ctocpp.h"
|
#include "libcef_dll/ctocpp/drag_handler_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/find_handler_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/focus_handler_ctocpp.h"
|
#include "libcef_dll/ctocpp/focus_handler_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/geolocation_handler_ctocpp.h"
|
#include "libcef_dll/ctocpp/geolocation_handler_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/jsdialog_handler_ctocpp.h"
|
#include "libcef_dll/ctocpp/jsdialog_handler_ctocpp.h"
|
||||||
@ -96,6 +97,19 @@ CefRefPtr<CefDragHandler> CefClientCToCpp::GetDragHandler() {
|
|||||||
return CefDragHandlerCToCpp::Wrap(_retval);
|
return CefDragHandlerCToCpp::Wrap(_retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CefRefPtr<CefFindHandler> CefClientCToCpp::GetFindHandler() {
|
||||||
|
if (CEF_MEMBER_MISSING(struct_, get_find_handler))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
cef_find_handler_t* _retval = struct_->get_find_handler(struct_);
|
||||||
|
|
||||||
|
// Return type: refptr_same
|
||||||
|
return CefFindHandlerCToCpp::Wrap(_retval);
|
||||||
|
}
|
||||||
|
|
||||||
CefRefPtr<CefFocusHandler> CefClientCToCpp::GetFocusHandler() {
|
CefRefPtr<CefFocusHandler> CefClientCToCpp::GetFocusHandler() {
|
||||||
if (CEF_MEMBER_MISSING(struct_, get_focus_handler))
|
if (CEF_MEMBER_MISSING(struct_, get_focus_handler))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -36,6 +36,7 @@ class CefClientCToCpp
|
|||||||
CefRefPtr<CefDisplayHandler> GetDisplayHandler() override;
|
CefRefPtr<CefDisplayHandler> GetDisplayHandler() override;
|
||||||
CefRefPtr<CefDownloadHandler> GetDownloadHandler() override;
|
CefRefPtr<CefDownloadHandler> GetDownloadHandler() override;
|
||||||
CefRefPtr<CefDragHandler> GetDragHandler() override;
|
CefRefPtr<CefDragHandler> GetDragHandler() override;
|
||||||
|
CefRefPtr<CefFindHandler> GetFindHandler() override;
|
||||||
CefRefPtr<CefFocusHandler> GetFocusHandler() override;
|
CefRefPtr<CefFocusHandler> GetFocusHandler() override;
|
||||||
CefRefPtr<CefGeolocationHandler> GetGeolocationHandler() override;
|
CefRefPtr<CefGeolocationHandler> GetGeolocationHandler() override;
|
||||||
CefRefPtr<CefJSDialogHandler> GetJSDialogHandler() override;
|
CefRefPtr<CefJSDialogHandler> GetJSDialogHandler() override;
|
||||||
|
47
libcef_dll/ctocpp/find_handler_ctocpp.cc
Normal file
47
libcef_dll/ctocpp/find_handler_ctocpp.cc
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
// Copyright (c) 2015 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/browser_cpptoc.h"
|
||||||
|
#include "libcef_dll/ctocpp/find_handler_ctocpp.h"
|
||||||
|
|
||||||
|
|
||||||
|
// VIRTUAL METHODS - Body may be edited by hand.
|
||||||
|
|
||||||
|
void CefFindHandlerCToCpp::OnFindResult(CefRefPtr<CefBrowser> browser,
|
||||||
|
int identifier, int count, const CefRect& selectionRect,
|
||||||
|
int activeMatchOrdinal, bool finalUpdate) {
|
||||||
|
if (CEF_MEMBER_MISSING(struct_, on_find_result))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: browser; type: refptr_diff
|
||||||
|
DCHECK(browser.get());
|
||||||
|
if (!browser.get())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
struct_->on_find_result(struct_,
|
||||||
|
CefBrowserCppToC::Wrap(browser),
|
||||||
|
identifier,
|
||||||
|
count,
|
||||||
|
&selectionRect,
|
||||||
|
activeMatchOrdinal,
|
||||||
|
finalUpdate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
template<> base::AtomicRefCount CefCToCpp<CefFindHandlerCToCpp, CefFindHandler,
|
||||||
|
cef_find_handler_t>::DebugObjCt = 0;
|
||||||
|
#endif
|
||||||
|
|
43
libcef_dll/ctocpp/find_handler_ctocpp.h
Normal file
43
libcef_dll/ctocpp/find_handler_ctocpp.h
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
// Copyright (c) 2015 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_CTOCPP_FIND_HANDLER_CTOCPP_H_
|
||||||
|
#define CEF_LIBCEF_DLL_CTOCPP_FIND_HANDLER_CTOCPP_H_
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef BUILDING_CEF_SHARED
|
||||||
|
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
|
||||||
|
#else // BUILDING_CEF_SHARED
|
||||||
|
|
||||||
|
#include "include/cef_find_handler.h"
|
||||||
|
#include "include/capi/cef_find_handler_capi.h"
|
||||||
|
#include "libcef_dll/ctocpp/ctocpp.h"
|
||||||
|
|
||||||
|
// Wrap a C structure with a C++ class.
|
||||||
|
// This class may be instantiated and accessed DLL-side only.
|
||||||
|
class CefFindHandlerCToCpp
|
||||||
|
: public CefCToCpp<CefFindHandlerCToCpp, CefFindHandler,
|
||||||
|
cef_find_handler_t> {
|
||||||
|
public:
|
||||||
|
explicit CefFindHandlerCToCpp(cef_find_handler_t* str)
|
||||||
|
: CefCToCpp<CefFindHandlerCToCpp, CefFindHandler, cef_find_handler_t>(
|
||||||
|
str) {}
|
||||||
|
|
||||||
|
// CefFindHandler methods
|
||||||
|
void OnFindResult(CefRefPtr<CefBrowser> browser, int identifier, int count,
|
||||||
|
const CefRect& selectionRect, int activeMatchOrdinal,
|
||||||
|
bool finalUpdate) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // BUILDING_CEF_SHARED
|
||||||
|
#endif // CEF_LIBCEF_DLL_CTOCPP_FIND_HANDLER_CTOCPP_H_
|
||||||
|
|
@ -83,6 +83,7 @@
|
|||||||
#include "libcef_dll/ctocpp/download_handler_ctocpp.h"
|
#include "libcef_dll/ctocpp/download_handler_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/drag_handler_ctocpp.h"
|
#include "libcef_dll/ctocpp/drag_handler_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/end_tracing_callback_ctocpp.h"
|
#include "libcef_dll/ctocpp/end_tracing_callback_ctocpp.h"
|
||||||
|
#include "libcef_dll/ctocpp/find_handler_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/focus_handler_ctocpp.h"
|
#include "libcef_dll/ctocpp/focus_handler_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/geolocation_handler_ctocpp.h"
|
#include "libcef_dll/ctocpp/geolocation_handler_ctocpp.h"
|
||||||
#include "libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h"
|
#include "libcef_dll/ctocpp/get_geolocation_callback_ctocpp.h"
|
||||||
@ -210,6 +211,7 @@ CEF_EXPORT void cef_shutdown() {
|
|||||||
DCHECK(base::AtomicRefCountIsZero(&CefDragHandlerCToCpp::DebugObjCt));
|
DCHECK(base::AtomicRefCountIsZero(&CefDragHandlerCToCpp::DebugObjCt));
|
||||||
DCHECK(base::AtomicRefCountIsZero(&CefEndTracingCallbackCToCpp::DebugObjCt));
|
DCHECK(base::AtomicRefCountIsZero(&CefEndTracingCallbackCToCpp::DebugObjCt));
|
||||||
DCHECK(base::AtomicRefCountIsZero(&CefFileDialogCallbackCppToC::DebugObjCt));
|
DCHECK(base::AtomicRefCountIsZero(&CefFileDialogCallbackCppToC::DebugObjCt));
|
||||||
|
DCHECK(base::AtomicRefCountIsZero(&CefFindHandlerCToCpp::DebugObjCt));
|
||||||
DCHECK(base::AtomicRefCountIsZero(&CefFocusHandlerCToCpp::DebugObjCt));
|
DCHECK(base::AtomicRefCountIsZero(&CefFocusHandlerCToCpp::DebugObjCt));
|
||||||
DCHECK(base::AtomicRefCountIsZero(&CefFrameCppToC::DebugObjCt));
|
DCHECK(base::AtomicRefCountIsZero(&CefFrameCppToC::DebugObjCt));
|
||||||
DCHECK(base::AtomicRefCountIsZero(&CefGeolocationCallbackCppToC::DebugObjCt));
|
DCHECK(base::AtomicRefCountIsZero(&CefGeolocationCallbackCppToC::DebugObjCt));
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
#include "libcef_dll/cpptoc/download_handler_cpptoc.h"
|
#include "libcef_dll/cpptoc/download_handler_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/drag_handler_cpptoc.h"
|
#include "libcef_dll/cpptoc/drag_handler_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/end_tracing_callback_cpptoc.h"
|
#include "libcef_dll/cpptoc/end_tracing_callback_cpptoc.h"
|
||||||
|
#include "libcef_dll/cpptoc/find_handler_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/focus_handler_cpptoc.h"
|
#include "libcef_dll/cpptoc/focus_handler_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/geolocation_handler_cpptoc.h"
|
#include "libcef_dll/cpptoc/geolocation_handler_cpptoc.h"
|
||||||
#include "libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h"
|
#include "libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h"
|
||||||
@ -202,6 +203,7 @@ CEF_GLOBAL void CefShutdown() {
|
|||||||
DCHECK(base::AtomicRefCountIsZero(&CefDragHandlerCppToC::DebugObjCt));
|
DCHECK(base::AtomicRefCountIsZero(&CefDragHandlerCppToC::DebugObjCt));
|
||||||
DCHECK(base::AtomicRefCountIsZero(&CefEndTracingCallbackCppToC::DebugObjCt));
|
DCHECK(base::AtomicRefCountIsZero(&CefEndTracingCallbackCppToC::DebugObjCt));
|
||||||
DCHECK(base::AtomicRefCountIsZero(&CefFileDialogCallbackCToCpp::DebugObjCt));
|
DCHECK(base::AtomicRefCountIsZero(&CefFileDialogCallbackCToCpp::DebugObjCt));
|
||||||
|
DCHECK(base::AtomicRefCountIsZero(&CefFindHandlerCppToC::DebugObjCt));
|
||||||
DCHECK(base::AtomicRefCountIsZero(&CefFocusHandlerCppToC::DebugObjCt));
|
DCHECK(base::AtomicRefCountIsZero(&CefFocusHandlerCppToC::DebugObjCt));
|
||||||
DCHECK(base::AtomicRefCountIsZero(&CefFrameCToCpp::DebugObjCt));
|
DCHECK(base::AtomicRefCountIsZero(&CefFrameCToCpp::DebugObjCt));
|
||||||
DCHECK(base::AtomicRefCountIsZero(&CefGeolocationCallbackCToCpp::DebugObjCt));
|
DCHECK(base::AtomicRefCountIsZero(&CefGeolocationCallbackCToCpp::DebugObjCt));
|
||||||
|
Reference in New Issue
Block a user