Add geolocation support (issue #365).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@780 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-09-14 19:04:45 +00:00
parent 2705f19cf6
commit 3cf6d92539
35 changed files with 1219 additions and 4 deletions

View File

@@ -15,6 +15,7 @@
#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/geolocation_handler_cpptoc.h"
#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h"
#include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h"
#include "libcef_dll/cpptoc/life_span_handler_cpptoc.h"
@@ -253,6 +254,22 @@ struct _cef_drag_handler_t* CEF_CALLBACK client_get_drag_handler(
return CefDragHandlerCppToC::Wrap(_retval);
}
struct _cef_geolocation_handler_t* CEF_CALLBACK client_get_geolocation_handler(
struct _cef_client_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return NULL;
// Execute
CefRefPtr<CefGeolocationHandler> _retval = CefClientCppToC::Get(
self)->GetGeolocationHandler();
// Return type: refptr_same
return CefGeolocationHandlerCppToC::Wrap(_retval);
}
// CONSTRUCTOR - Do not edit by hand.
@@ -272,6 +289,7 @@ CefClientCppToC::CefClientCppToC(CefClient* cls)
struct_.struct_.get_v8context_handler = client_get_v8context_handler;
struct_.struct_.get_render_handler = client_get_render_handler;
struct_.struct_.get_drag_handler = client_get_drag_handler;
struct_.struct_.get_geolocation_handler = client_get_geolocation_handler;
}
#ifndef NDEBUG

View File

@@ -0,0 +1,45 @@
// Copyright (c) 2012 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/geolocation_callback_cpptoc.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
void CEF_CALLBACK geolocation_callback_cont(
struct _cef_geolocation_callback_t* self, int allow) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Execute
CefGeolocationCallbackCppToC::Get(self)->Continue(
allow?true:false);
}
// CONSTRUCTOR - Do not edit by hand.
CefGeolocationCallbackCppToC::CefGeolocationCallbackCppToC(
CefGeolocationCallback* cls)
: CefCppToC<CefGeolocationCallbackCppToC, CefGeolocationCallback,
cef_geolocation_callback_t>(cls) {
struct_.struct_.cont = geolocation_callback_cont;
}
#ifndef NDEBUG
template<> long CefCppToC<CefGeolocationCallbackCppToC, CefGeolocationCallback,
cef_geolocation_callback_t>::DebugObjCt = 0;
#endif

View File

@@ -0,0 +1,37 @@
// Copyright (c) 2012 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_GEOLOCATION_CALLBACK_CPPTOC_H_
#define CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_CALLBACK_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_geolocation_handler.h"
#include "include/capi/cef_geolocation_handler_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 CefGeolocationCallbackCppToC
: public CefCppToC<CefGeolocationCallbackCppToC, CefGeolocationCallback,
cef_geolocation_callback_t> {
public:
explicit CefGeolocationCallbackCppToC(CefGeolocationCallback* cls);
virtual ~CefGeolocationCallbackCppToC() {}
};
#endif // BUILDING_CEF_SHARED
#endif // CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_CALLBACK_CPPTOC_H_

View File

@@ -0,0 +1,91 @@
// Copyright (c) 2012 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/geolocation_handler_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/geolocation_callback_ctocpp.h"
// MEMBER FUNCTIONS - Body may be edited by hand.
void CEF_CALLBACK geolocation_handler_on_request_geolocation_permission(
struct _cef_geolocation_handler_t* self, cef_browser_t* browser,
const cef_string_t* requesting_url, int request_id,
cef_geolocation_callback_t* callback) {
// 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: requesting_url; type: string_byref_const
DCHECK(requesting_url);
if (!requesting_url)
return;
// Verify param: callback; type: refptr_diff
DCHECK(callback);
if (!callback)
return;
// Execute
CefGeolocationHandlerCppToC::Get(self)->OnRequestGeolocationPermission(
CefBrowserCToCpp::Wrap(browser),
CefString(requesting_url),
request_id,
CefGeolocationCallbackCToCpp::Wrap(callback));
}
void CEF_CALLBACK geolocation_handler_on_cancel_geolocation_permission(
struct _cef_geolocation_handler_t* self, cef_browser_t* browser,
const cef_string_t* requesting_url, int request_id) {
// 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: requesting_url; type: string_byref_const
DCHECK(requesting_url);
if (!requesting_url)
return;
// Execute
CefGeolocationHandlerCppToC::Get(self)->OnCancelGeolocationPermission(
CefBrowserCToCpp::Wrap(browser),
CefString(requesting_url),
request_id);
}
// CONSTRUCTOR - Do not edit by hand.
CefGeolocationHandlerCppToC::CefGeolocationHandlerCppToC(
CefGeolocationHandler* cls)
: CefCppToC<CefGeolocationHandlerCppToC, CefGeolocationHandler,
cef_geolocation_handler_t>(cls) {
struct_.struct_.on_request_geolocation_permission =
geolocation_handler_on_request_geolocation_permission;
struct_.struct_.on_cancel_geolocation_permission =
geolocation_handler_on_cancel_geolocation_permission;
}
#ifndef NDEBUG
template<> long CefCppToC<CefGeolocationHandlerCppToC, CefGeolocationHandler,
cef_geolocation_handler_t>::DebugObjCt = 0;
#endif

View File

@@ -0,0 +1,37 @@
// Copyright (c) 2012 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_GEOLOCATION_HANDLER_CPPTOC_H_
#define CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_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_geolocation_handler.h"
#include "include/capi/cef_geolocation_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 CefGeolocationHandlerCppToC
: public CefCppToC<CefGeolocationHandlerCppToC, CefGeolocationHandler,
cef_geolocation_handler_t> {
public:
explicit CefGeolocationHandlerCppToC(CefGeolocationHandler* cls);
virtual ~CefGeolocationHandlerCppToC() {}
};
#endif // USING_CEF_SHARED
#endif // CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_HANDLER_CPPTOC_H_