2012-04-03 03:34:16 +02:00
|
|
|
// Copyright (c) 2011 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 CEF_TESTS_CEFCLIENT_CLIENT_HANDLER_H_
|
|
|
|
#define CEF_TESTS_CEFCLIENT_CLIENT_HANDLER_H_
|
|
|
|
#pragma once
|
|
|
|
|
2013-04-03 21:29:47 +02:00
|
|
|
#include <list>
|
2012-04-03 03:34:16 +02:00
|
|
|
#include <map>
|
2012-04-12 22:21:50 +02:00
|
|
|
#include <set>
|
2012-04-03 03:34:16 +02:00
|
|
|
#include <string>
|
2014-07-15 00:18:51 +02:00
|
|
|
|
|
|
|
#include "include/base/cef_lock.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "include/cef_client.h"
|
2014-07-11 22:10:05 +02:00
|
|
|
#include "include/wrapper/cef_helpers.h"
|
2014-01-28 00:31:03 +01:00
|
|
|
#include "include/wrapper/cef_message_router.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2014-05-22 23:01:22 +02:00
|
|
|
#if defined(OS_LINUX)
|
|
|
|
// The Linux client uses GTK instead of the underlying platform type (X11).
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#define ClientWindowHandle GtkWidget*
|
|
|
|
#else
|
|
|
|
#define ClientWindowHandle CefWindowHandle
|
|
|
|
#endif
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Define this value to redirect all popup URLs to the main application browser
|
|
|
|
// window.
|
|
|
|
// #define TEST_REDIRECT_POPUP_URLS
|
|
|
|
|
|
|
|
// ClientHandler implementation.
|
|
|
|
class ClientHandler : public CefClient,
|
2012-06-11 17:52:49 +02:00
|
|
|
public CefContextMenuHandler,
|
2014-07-09 20:03:43 +02:00
|
|
|
public CefDialogHandler,
|
2012-04-03 03:34:16 +02:00
|
|
|
public CefDisplayHandler,
|
2012-06-28 19:21:18 +02:00
|
|
|
public CefDownloadHandler,
|
2013-06-24 17:45:58 +02:00
|
|
|
public CefDragHandler,
|
2012-04-19 22:31:46 +02:00
|
|
|
public CefGeolocationHandler,
|
2014-07-09 19:13:06 +02:00
|
|
|
public CefJSDialogHandler,
|
2012-06-11 17:52:49 +02:00
|
|
|
public CefKeyboardHandler,
|
|
|
|
public CefLifeSpanHandler,
|
|
|
|
public CefLoadHandler,
|
2014-07-01 00:30:29 +02:00
|
|
|
public CefRenderHandler,
|
2012-06-11 17:52:49 +02:00
|
|
|
public CefRequestHandler {
|
2012-04-03 03:34:16 +02:00
|
|
|
public:
|
2014-07-01 00:30:29 +02:00
|
|
|
// Interface implemented to handle off-screen rendering.
|
|
|
|
class RenderHandler : public CefRenderHandler {
|
|
|
|
public:
|
|
|
|
virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser) =0;
|
|
|
|
};
|
|
|
|
|
2014-01-28 00:31:03 +01:00
|
|
|
typedef std::set<CefMessageRouterBrowserSide::Handler*> MessageHandlerSet;
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
ClientHandler();
|
|
|
|
virtual ~ClientHandler();
|
|
|
|
|
|
|
|
// CefClient methods
|
2012-06-11 17:52:49 +02:00
|
|
|
virtual CefRefPtr<CefContextMenuHandler> GetContextMenuHandler() OVERRIDE {
|
2012-04-03 03:34:16 +02:00
|
|
|
return this;
|
|
|
|
}
|
2014-07-09 20:03:43 +02:00
|
|
|
virtual CefRefPtr<CefDialogHandler> GetDialogHandler() OVERRIDE {
|
|
|
|
return this;
|
|
|
|
}
|
2012-06-11 17:52:49 +02:00
|
|
|
virtual CefRefPtr<CefDisplayHandler> GetDisplayHandler() OVERRIDE {
|
2012-04-03 03:34:16 +02:00
|
|
|
return this;
|
|
|
|
}
|
2012-06-28 19:21:18 +02:00
|
|
|
virtual CefRefPtr<CefDownloadHandler> GetDownloadHandler() OVERRIDE {
|
|
|
|
return this;
|
|
|
|
}
|
2013-06-24 17:45:58 +02:00
|
|
|
virtual CefRefPtr<CefDragHandler> GetDragHandler() OVERRIDE {
|
|
|
|
return this;
|
|
|
|
}
|
2012-06-11 17:52:49 +02:00
|
|
|
virtual CefRefPtr<CefGeolocationHandler> GetGeolocationHandler() OVERRIDE {
|
2012-04-03 03:34:16 +02:00
|
|
|
return this;
|
|
|
|
}
|
2014-07-09 19:13:06 +02:00
|
|
|
virtual CefRefPtr<CefJSDialogHandler> GetJSDialogHandler() OVERRIDE {
|
|
|
|
return this;
|
|
|
|
}
|
2012-06-11 17:52:49 +02:00
|
|
|
virtual CefRefPtr<CefKeyboardHandler> GetKeyboardHandler() OVERRIDE {
|
2012-04-03 03:34:16 +02:00
|
|
|
return this;
|
|
|
|
}
|
2012-06-11 17:52:49 +02:00
|
|
|
virtual CefRefPtr<CefLifeSpanHandler> GetLifeSpanHandler() OVERRIDE {
|
2012-04-03 03:34:16 +02:00
|
|
|
return this;
|
|
|
|
}
|
2012-06-11 17:52:49 +02:00
|
|
|
virtual CefRefPtr<CefLoadHandler> GetLoadHandler() OVERRIDE {
|
|
|
|
return this;
|
|
|
|
}
|
2014-07-01 00:30:29 +02:00
|
|
|
virtual CefRefPtr<CefRenderHandler> GetRenderHandler() OVERRIDE {
|
|
|
|
return this;
|
|
|
|
}
|
2012-06-11 17:52:49 +02:00
|
|
|
virtual CefRefPtr<CefRequestHandler> GetRequestHandler() OVERRIDE {
|
2012-04-19 22:31:46 +02:00
|
|
|
return this;
|
|
|
|
}
|
2012-06-11 22:03:49 +02:00
|
|
|
virtual bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
|
2012-04-12 22:21:50 +02:00
|
|
|
CefProcessId source_process,
|
|
|
|
CefRefPtr<CefProcessMessage> message)
|
|
|
|
OVERRIDE;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2012-06-11 17:52:49 +02:00
|
|
|
// CefContextMenuHandler methods
|
|
|
|
virtual void OnBeforeContextMenu(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefContextMenuParams> params,
|
|
|
|
CefRefPtr<CefMenuModel> model) OVERRIDE;
|
|
|
|
virtual bool OnContextMenuCommand(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefContextMenuParams> params,
|
|
|
|
int command_id,
|
|
|
|
EventFlags event_flags) OVERRIDE;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2014-07-09 20:03:43 +02:00
|
|
|
// CefDialogHandler methods
|
|
|
|
virtual bool OnFileDialog(CefRefPtr<CefBrowser> browser,
|
|
|
|
FileDialogMode mode,
|
|
|
|
const CefString& title,
|
2015-01-20 19:24:54 +01:00
|
|
|
const CefString& default_file_path,
|
|
|
|
const std::vector<CefString>& accept_filters,
|
|
|
|
int selected_accept_filter,
|
2014-07-09 20:03:43 +02:00
|
|
|
CefRefPtr<CefFileDialogCallback> callback) OVERRIDE;
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// CefDisplayHandler methods
|
|
|
|
virtual void OnAddressChange(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
const CefString& url) OVERRIDE;
|
|
|
|
virtual void OnTitleChange(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& title) OVERRIDE;
|
|
|
|
virtual bool OnConsoleMessage(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& message,
|
|
|
|
const CefString& source,
|
|
|
|
int line) OVERRIDE;
|
|
|
|
|
2012-06-28 19:21:18 +02:00
|
|
|
// CefDownloadHandler methods
|
|
|
|
virtual void OnBeforeDownload(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefDownloadItem> download_item,
|
|
|
|
const CefString& suggested_name,
|
|
|
|
CefRefPtr<CefBeforeDownloadCallback> callback) OVERRIDE;
|
|
|
|
virtual void OnDownloadUpdated(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefDownloadItem> download_item,
|
|
|
|
CefRefPtr<CefDownloadItemCallback> callback) OVERRIDE;
|
|
|
|
|
2013-06-24 17:45:58 +02:00
|
|
|
// CefDragHandler methods
|
|
|
|
virtual bool OnDragEnter(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefDragData> dragData,
|
2014-07-01 00:30:29 +02:00
|
|
|
CefDragHandler::DragOperationsMask mask) OVERRIDE;
|
2013-06-24 17:45:58 +02:00
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// CefGeolocationHandler methods
|
2014-07-02 20:25:22 +02:00
|
|
|
virtual bool OnRequestGeolocationPermission(
|
2012-04-03 03:34:16 +02:00
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& requesting_url,
|
|
|
|
int request_id,
|
|
|
|
CefRefPtr<CefGeolocationCallback> callback) OVERRIDE;
|
|
|
|
|
2014-07-09 19:13:06 +02:00
|
|
|
// CefJSDialogHandler methods
|
|
|
|
virtual bool OnJSDialog(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& origin_url,
|
|
|
|
const CefString& accept_lang,
|
|
|
|
JSDialogType dialog_type,
|
|
|
|
const CefString& message_text,
|
|
|
|
const CefString& default_prompt_text,
|
|
|
|
CefRefPtr<CefJSDialogCallback> callback,
|
|
|
|
bool& suppress_message) OVERRIDE;
|
|
|
|
virtual bool OnBeforeUnloadDialog(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& message_text,
|
|
|
|
bool is_reload,
|
|
|
|
CefRefPtr<CefJSDialogCallback> callback) OVERRIDE;
|
|
|
|
virtual void OnResetDialogState(CefRefPtr<CefBrowser> browser) OVERRIDE;
|
|
|
|
|
2012-06-11 17:52:49 +02:00
|
|
|
// CefKeyboardHandler methods
|
|
|
|
virtual bool OnPreKeyEvent(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefKeyEvent& event,
|
|
|
|
CefEventHandle os_event,
|
|
|
|
bool* is_keyboard_shortcut) OVERRIDE;
|
|
|
|
|
|
|
|
// CefLifeSpanHandler methods
|
2014-07-01 00:30:29 +02:00
|
|
|
virtual bool OnBeforePopup(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
const CefString& target_url,
|
|
|
|
const CefString& target_frame_name,
|
|
|
|
const CefPopupFeatures& popupFeatures,
|
|
|
|
CefWindowInfo& windowInfo,
|
|
|
|
CefRefPtr<CefClient>& client,
|
|
|
|
CefBrowserSettings& settings,
|
|
|
|
bool* no_javascript_access) OVERRIDE;
|
2012-06-11 17:52:49 +02:00
|
|
|
virtual void OnAfterCreated(CefRefPtr<CefBrowser> browser) OVERRIDE;
|
|
|
|
virtual bool DoClose(CefRefPtr<CefBrowser> browser) OVERRIDE;
|
|
|
|
virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser) OVERRIDE;
|
|
|
|
|
|
|
|
// CefLoadHandler methods
|
2013-09-12 22:34:18 +02:00
|
|
|
virtual void OnLoadingStateChange(CefRefPtr<CefBrowser> browser,
|
|
|
|
bool isLoading,
|
|
|
|
bool canGoBack,
|
|
|
|
bool canGoForward) OVERRIDE;
|
2012-06-11 17:52:49 +02:00
|
|
|
virtual void OnLoadError(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
ErrorCode errorCode,
|
|
|
|
const CefString& errorText,
|
|
|
|
const CefString& failedUrl) OVERRIDE;
|
|
|
|
|
|
|
|
// CefRequestHandler methods
|
2014-01-28 00:31:03 +01:00
|
|
|
virtual bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefRequest> request,
|
|
|
|
bool is_redirect) OVERRIDE;
|
2012-06-11 17:52:49 +02:00
|
|
|
virtual CefRefPtr<CefResourceHandler> GetResourceHandler(
|
|
|
|
CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefFrame> frame,
|
|
|
|
CefRefPtr<CefRequest> request) OVERRIDE;
|
2012-09-28 00:52:15 +02:00
|
|
|
virtual bool OnQuotaRequest(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& origin_url,
|
|
|
|
int64 new_size,
|
|
|
|
CefRefPtr<CefQuotaCallback> callback) OVERRIDE;
|
2012-06-25 23:21:27 +02:00
|
|
|
virtual void OnProtocolExecution(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefString& url,
|
|
|
|
bool& allow_os_execution) OVERRIDE;
|
2013-09-12 22:34:18 +02:00
|
|
|
virtual void OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser,
|
|
|
|
TerminationStatus status) OVERRIDE;
|
2012-04-19 22:31:46 +02:00
|
|
|
|
2014-07-01 00:30:29 +02:00
|
|
|
// CefRenderHandler methods
|
|
|
|
virtual bool GetRootScreenRect(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRect& rect) OVERRIDE;
|
|
|
|
virtual bool GetViewRect(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRect& rect) OVERRIDE;
|
|
|
|
virtual bool GetScreenPoint(CefRefPtr<CefBrowser> browser,
|
|
|
|
int viewX,
|
|
|
|
int viewY,
|
|
|
|
int& screenX,
|
|
|
|
int& screenY) OVERRIDE;
|
|
|
|
virtual bool GetScreenInfo(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefScreenInfo& screen_info) OVERRIDE;
|
|
|
|
virtual void OnPopupShow(CefRefPtr<CefBrowser> browser, bool show) OVERRIDE;
|
|
|
|
virtual void OnPopupSize(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefRect& rect) OVERRIDE;
|
|
|
|
virtual void OnPaint(CefRefPtr<CefBrowser> browser,
|
|
|
|
PaintElementType type,
|
|
|
|
const RectList& dirtyRects,
|
|
|
|
const void* buffer,
|
|
|
|
int width,
|
|
|
|
int height) OVERRIDE;
|
|
|
|
virtual void OnCursorChange(CefRefPtr<CefBrowser> browser,
|
2014-11-24 22:56:12 +01:00
|
|
|
CefCursorHandle cursor,
|
|
|
|
CursorType type,
|
|
|
|
const CefCursorInfo& custom_cursor_info) OVERRIDE;
|
2014-07-01 00:30:29 +02:00
|
|
|
virtual bool StartDragging(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRefPtr<CefDragData> drag_data,
|
|
|
|
CefRenderHandler::DragOperationsMask allowed_ops,
|
|
|
|
int x, int y) OVERRIDE;
|
|
|
|
virtual void UpdateDragCursor(CefRefPtr<CefBrowser> browser,
|
|
|
|
CefRenderHandler::DragOperation operation)
|
|
|
|
OVERRIDE;
|
|
|
|
|
2014-07-11 22:28:37 +02:00
|
|
|
void SetMainWindowHandle(ClientWindowHandle handle);
|
2014-07-15 00:18:51 +02:00
|
|
|
ClientWindowHandle GetMainWindowHandle() const;
|
2014-07-11 22:28:37 +02:00
|
|
|
void SetEditWindowHandle(ClientWindowHandle handle);
|
|
|
|
void SetButtonWindowHandles(ClientWindowHandle backHandle,
|
|
|
|
ClientWindowHandle forwardHandle,
|
|
|
|
ClientWindowHandle reloadHandle,
|
|
|
|
ClientWindowHandle stopHandle);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2014-07-15 00:18:51 +02:00
|
|
|
void SetOSRHandler(CefRefPtr<RenderHandler> handler);
|
|
|
|
CefRefPtr<RenderHandler> GetOSRHandler() const;
|
|
|
|
|
|
|
|
CefRefPtr<CefBrowser> GetBrowser() const;
|
|
|
|
int GetBrowserId() const;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2013-04-03 21:29:47 +02:00
|
|
|
// Request that all existing browser windows close.
|
|
|
|
void CloseAllBrowsers(bool force_close);
|
|
|
|
|
2013-03-19 23:59:33 +01:00
|
|
|
// Returns true if the main browser window is currently closing. Used in
|
|
|
|
// combination with DoClose() and the OS close notification to properly handle
|
|
|
|
// 'onbeforeunload' JavaScript events during window close.
|
2014-07-15 00:18:51 +02:00
|
|
|
bool IsClosing() const;
|
2013-03-19 23:59:33 +01:00
|
|
|
|
2014-10-11 02:12:01 +02:00
|
|
|
void ShowDevTools(CefRefPtr<CefBrowser> browser,
|
|
|
|
const CefPoint& inspect_element_at);
|
2013-11-08 17:06:06 +01:00
|
|
|
void CloseDevTools(CefRefPtr<CefBrowser> browser);
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2012-06-26 18:47:05 +02:00
|
|
|
// Returns the startup URL.
|
2014-07-15 00:18:51 +02:00
|
|
|
std::string GetStartupURL() const;
|
2012-06-26 18:47:05 +02:00
|
|
|
|
2012-10-18 00:45:49 +02:00
|
|
|
bool Save(const std::string& path, const std::string& data);
|
|
|
|
|
2014-07-15 00:18:51 +02:00
|
|
|
private:
|
2012-04-03 03:34:16 +02:00
|
|
|
void SetLoading(bool isLoading);
|
|
|
|
void SetNavState(bool canGoBack, bool canGoForward);
|
|
|
|
|
2012-04-19 22:31:46 +02:00
|
|
|
// Test context menu creation.
|
|
|
|
void BuildTestMenu(CefRefPtr<CefMenuModel> model);
|
|
|
|
bool ExecuteTestMenu(int command_id);
|
|
|
|
struct TestMenuState {
|
|
|
|
TestMenuState() : check_item(true), radio_item(0) {}
|
|
|
|
bool check_item;
|
|
|
|
int radio_item;
|
2014-07-11 22:28:37 +02:00
|
|
|
} test_menu_state_;
|
2012-04-19 22:31:46 +02:00
|
|
|
|
2014-07-15 00:18:51 +02:00
|
|
|
// START THREAD SAFE MEMBERS
|
|
|
|
// The following members are thread-safe because they're initialized during
|
|
|
|
// object construction and not changed thereafter.
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2014-07-15 00:18:51 +02:00
|
|
|
// The startup URL.
|
|
|
|
std::string startup_url_;
|
2013-04-03 21:29:47 +02:00
|
|
|
|
2014-07-15 00:18:51 +02:00
|
|
|
// True if mouse cursor change is disabled.
|
|
|
|
bool mouse_cursor_change_disabled_;
|
|
|
|
// END THREAD SAFE MEMBERS
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2014-07-15 00:18:51 +02:00
|
|
|
// Lock used to protect members accessed on multiple threads. Make it mutable
|
|
|
|
// so that it can be used from const methods.
|
|
|
|
mutable base::Lock lock_;
|
|
|
|
|
|
|
|
// START LOCK PROTECTED MEMBERS
|
|
|
|
// The following members are accessed on multiple threads and must be
|
|
|
|
// protected by |lock_|.
|
|
|
|
|
|
|
|
// The child browser window.
|
|
|
|
CefRefPtr<CefBrowser> browser_;
|
|
|
|
|
|
|
|
// The child browser id.
|
2014-07-11 22:28:37 +02:00
|
|
|
int browser_id_;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2013-03-19 23:59:33 +01:00
|
|
|
// True if the main browser window is currently closing.
|
2014-07-11 22:28:37 +02:00
|
|
|
bool is_closing_;
|
2014-07-15 00:18:51 +02:00
|
|
|
// END LOCK PROTECTED MEMBERS
|
|
|
|
|
|
|
|
// START UI THREAD ACCESS ONLY MEMBERS
|
|
|
|
// The following members will only be accessed on the CEF UI thread.
|
|
|
|
|
|
|
|
// List of any popup browser windows.
|
|
|
|
typedef std::list<CefRefPtr<CefBrowser> > BrowserList;
|
|
|
|
BrowserList popup_browsers_;
|
|
|
|
|
|
|
|
// The main frame window handle.
|
|
|
|
ClientWindowHandle main_handle_;
|
2013-03-19 23:59:33 +01:00
|
|
|
|
2014-07-15 00:18:51 +02:00
|
|
|
// The edit window handle.
|
2014-07-11 22:28:37 +02:00
|
|
|
ClientWindowHandle edit_handle_;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2014-07-15 00:18:51 +02:00
|
|
|
// The button window handles.
|
2014-07-11 22:28:37 +02:00
|
|
|
ClientWindowHandle back_handle_;
|
|
|
|
ClientWindowHandle forward_handle_;
|
|
|
|
ClientWindowHandle stop_handle_;
|
|
|
|
ClientWindowHandle reload_handle_;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2014-07-15 00:18:51 +02:00
|
|
|
// The handler for off-screen rendering, if any.
|
2014-07-11 22:28:37 +02:00
|
|
|
CefRefPtr<RenderHandler> osr_handler_;
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2015-01-22 22:39:36 +01:00
|
|
|
// Used for console logging purposes.
|
|
|
|
const std::string console_log_file_;
|
|
|
|
bool first_console_message_;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2012-06-11 17:52:49 +02:00
|
|
|
// True if an editable field currently has focus.
|
2014-07-11 22:28:37 +02:00
|
|
|
bool focus_on_editable_field_;
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2014-01-28 00:31:03 +01:00
|
|
|
// Handles the browser side of query routing. The renderer side is handled
|
2015-01-22 02:55:39 +01:00
|
|
|
// in client_renderer.cc.
|
2014-01-28 00:31:03 +01:00
|
|
|
CefRefPtr<CefMessageRouterBrowserSide> message_router_;
|
|
|
|
|
|
|
|
// Set of Handlers registered with the message router.
|
|
|
|
MessageHandlerSet message_handler_set_;
|
|
|
|
|
2013-03-19 23:59:33 +01:00
|
|
|
// Number of currently existing browser windows. The application will exit
|
|
|
|
// when the number of windows reaches 0.
|
2014-07-11 22:28:37 +02:00
|
|
|
static int browser_count_;
|
2013-03-19 23:59:33 +01:00
|
|
|
|
2014-07-09 19:13:06 +02:00
|
|
|
#if defined(OS_LINUX)
|
2014-07-15 00:18:51 +02:00
|
|
|
// Linux-only implementation of GTK-based dialog boxes.
|
2014-07-09 19:13:06 +02:00
|
|
|
static void OnDialogResponse(GtkDialog *dialog,
|
|
|
|
gint response_id,
|
|
|
|
ClientHandler* handler);
|
|
|
|
GtkWidget* gtk_dialog_;
|
|
|
|
CefRefPtr<CefJSDialogCallback> js_dialog_callback_;
|
|
|
|
#endif
|
2014-07-15 00:18:51 +02:00
|
|
|
// END UI THREAD ACCESS ONLY MEMBERS
|
2014-07-09 19:13:06 +02:00
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Include the default reference counting implementation.
|
|
|
|
IMPLEMENT_REFCOUNTING(ClientHandler);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_TESTS_CEFCLIENT_CLIENT_HANDLER_H_
|