1 // Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
13 // * Neither the name of Google Inc. nor the name Chromium Embedded
14 // Framework nor the names of its contributors may be used to endorse
15 // or promote products derived from this software without specific prior
16 // written permission.
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 // ---------------------------------------------------------------------------
32 // The contents of this file must follow a specific format in order to
33 // support the CEF translator tool. See the translator.README.txt file in the
34 // tools directory for more information.
37 #ifndef CEF_INCLUDE_CEF_CLIENT_H_
38 #define CEF_INCLUDE_CEF_CLIENT_H_
41 #include "include/cef_base.h"
42 #include "include/cef_context_menu_handler.h"
43 #include "include/cef_dialog_handler.h"
44 #include "include/cef_display_handler.h"
45 #include "include/cef_download_handler.h"
46 #include "include/cef_drag_handler.h"
47 #include "include/cef_find_handler.h"
48 #include "include/cef_focus_handler.h"
49 #include "include/cef_geolocation_handler.h"
50 #include "include/cef_jsdialog_handler.h"
51 #include "include/cef_keyboard_handler.h"
52 #include "include/cef_life_span_handler.h"
53 #include "include/cef_load_handler.h"
54 #include "include/cef_process_message.h"
55 #include "include/cef_render_handler.h"
56 #include "include/cef_request_handler.h"
59 // Implement this interface to provide handler implementations.
61 /*--cef(source=client,no_debugct_check)--*/
62 class CefClient : public virtual CefBase {
65 // Return the handler for context menus. If no handler is provided the default
66 // implementation will be used.
69 virtual CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() {
74 // Return the handler for dialogs. If no handler is provided the default
75 // implementation will be used.
78 virtual CefRefPtr<CefDialogHandler> GetDialogHandler() {
83 // Return the handler for browser display state events.
86 virtual CefRefPtr<CefDisplayHandler> GetDisplayHandler() {
91 // Return the handler for download events. If no handler is returned downloads
92 // will not be allowed.
95 virtual CefRefPtr<CefDownloadHandler> GetDownloadHandler() {
100 // Return the handler for drag events.
103 virtual CefRefPtr<CefDragHandler> GetDragHandler() {
108 // Return the handler for find result events.
111 virtual CefRefPtr<CefFindHandler> GetFindHandler() {
116 // Return the handler for focus events.
119 virtual CefRefPtr<CefFocusHandler> GetFocusHandler() {
124 // Return the handler for geolocation permissions requests. If no handler is
125 // provided geolocation access will be denied by default.
128 virtual CefRefPtr<CefGeolocationHandler> GetGeolocationHandler() {
133 // Return the handler for JavaScript dialogs. If no handler is provided the
134 // default implementation will be used.
137 virtual CefRefPtr<CefJSDialogHandler> GetJSDialogHandler() {
142 // Return the handler for keyboard events.
145 virtual CefRefPtr<CefKeyboardHandler> GetKeyboardHandler() {
150 // Return the handler for browser life span events.
153 virtual CefRefPtr<CefLifeSpanHandler> GetLifeSpanHandler() {
158 // Return the handler for browser load status events.
161 virtual CefRefPtr<CefLoadHandler> GetLoadHandler() {
166 // Return the handler for off-screen rendering events.
169 virtual CefRefPtr<CefRenderHandler> GetRenderHandler() {
174 // Return the handler for browser request events.
177 virtual CefRefPtr<CefRequestHandler> GetRequestHandler() {
182 // Called when a new message is received from a different process. Return true
183 // if the message was handled or false otherwise. Do not keep a reference to
184 // or attempt to access the message outside of this callback.
187 virtual bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
188 CefProcessId source_process,
189 CefRefPtr<CefProcessMessage> message) {
194 #endif // CEF_INCLUDE_CEF_CLIENT_H_