mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add support for DevTools inspect element via a new |inspect_element_at| parameter added to CefBrowserHost::ShowDevTools (issue #586).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1870 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -333,12 +333,14 @@ typedef struct _cef_browser_host_t {
|
|||||||
int clearSelection);
|
int clearSelection);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Open developer tools in its own window.
|
// Open developer tools in its own window. If |inspect_element_at| is non-
|
||||||
|
// NULL the element at the specified (x,y) location will be inspected.
|
||||||
///
|
///
|
||||||
void (CEF_CALLBACK *show_dev_tools)(struct _cef_browser_host_t* self,
|
void (CEF_CALLBACK *show_dev_tools)(struct _cef_browser_host_t* self,
|
||||||
const struct _cef_window_info_t* windowInfo,
|
const struct _cef_window_info_t* windowInfo,
|
||||||
struct _cef_client_t* client,
|
struct _cef_client_t* client,
|
||||||
const struct _cef_browser_settings_t* settings);
|
const struct _cef_browser_settings_t* settings,
|
||||||
|
const cef_point_t* inspect_element_at);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Explicitly close the developer tools window if one exists for this browser
|
// Explicitly close the developer tools window if one exists for this browser
|
||||||
|
@ -378,12 +378,14 @@ class CefBrowserHost : public virtual CefBase {
|
|||||||
virtual void StopFinding(bool clearSelection) =0;
|
virtual void StopFinding(bool clearSelection) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Open developer tools in its own window.
|
// Open developer tools in its own window. If |inspect_element_at| is non-
|
||||||
|
// empty the element at the specified (x,y) location will be inspected.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef(optional_param=inspect_element_at)--*/
|
||||||
virtual void ShowDevTools(const CefWindowInfo& windowInfo,
|
virtual void ShowDevTools(const CefWindowInfo& windowInfo,
|
||||||
CefRefPtr<CefClient> client,
|
CefRefPtr<CefClient> client,
|
||||||
const CefBrowserSettings& settings) =0;
|
const CefBrowserSettings& settings,
|
||||||
|
const CefPoint& inspect_element_at) =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Explicitly close the developer tools window if one exists for this browser
|
// Explicitly close the developer tools window if one exists for this browser
|
||||||
|
@ -1102,6 +1102,14 @@ typedef enum {
|
|||||||
UR_FAILED,
|
UR_FAILED,
|
||||||
} cef_urlrequest_status_t;
|
} cef_urlrequest_status_t;
|
||||||
|
|
||||||
|
///
|
||||||
|
// Structure representing a point.
|
||||||
|
///
|
||||||
|
typedef struct _cef_point_t {
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
} cef_point_t;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Structure representing a rectangle.
|
// Structure representing a rectangle.
|
||||||
///
|
///
|
||||||
|
@ -134,6 +134,47 @@ class CefStructBase : public traits::struct_type {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct CefPointTraits {
|
||||||
|
typedef cef_point_t struct_type;
|
||||||
|
|
||||||
|
static inline void init(struct_type* s) {}
|
||||||
|
static inline void clear(struct_type* s) {}
|
||||||
|
|
||||||
|
static inline void set(const struct_type* src, struct_type* target,
|
||||||
|
bool copy) {
|
||||||
|
*target = *src;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
// Class representing a point.
|
||||||
|
///
|
||||||
|
class CefPoint : public CefStructBase<CefPointTraits> {
|
||||||
|
public:
|
||||||
|
typedef CefStructBase<CefPointTraits> parent;
|
||||||
|
|
||||||
|
CefPoint() : parent() {}
|
||||||
|
CefPoint(const cef_point_t& r) : parent(r) {} // NOLINT(runtime/explicit)
|
||||||
|
CefPoint(const CefPoint& r) : parent(r) {} // NOLINT(runtime/explicit)
|
||||||
|
CefPoint(int x, int y) : parent() {
|
||||||
|
Set(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsEmpty() const { return x <= 0 || x <= 0; }
|
||||||
|
void Set(int x, int y) {
|
||||||
|
this->x = x, this->y = y;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
inline bool operator==(const CefPoint& a, const CefPoint& b) {
|
||||||
|
return a.x == b.x && a.y == b.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool operator!=(const CefPoint& a, const CefPoint& b) {
|
||||||
|
return !(a == b);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
struct CefRectTraits {
|
struct CefRectTraits {
|
||||||
typedef cef_rect_t struct_type;
|
typedef cef_rect_t struct_type;
|
||||||
|
|
||||||
|
@ -98,21 +98,24 @@ class ShowDevToolsHelper {
|
|||||||
ShowDevToolsHelper(CefRefPtr<CefBrowserHostImpl> browser,
|
ShowDevToolsHelper(CefRefPtr<CefBrowserHostImpl> browser,
|
||||||
const CefWindowInfo& windowInfo,
|
const CefWindowInfo& windowInfo,
|
||||||
CefRefPtr<CefClient> client,
|
CefRefPtr<CefClient> client,
|
||||||
const CefBrowserSettings& settings)
|
const CefBrowserSettings& settings,
|
||||||
|
const CefPoint& inspect_element_at)
|
||||||
: browser_(browser),
|
: browser_(browser),
|
||||||
window_info_(windowInfo),
|
window_info_(windowInfo),
|
||||||
client_(client),
|
client_(client),
|
||||||
settings_(settings) {}
|
settings_(settings),
|
||||||
|
inspect_element_at_(inspect_element_at) {}
|
||||||
|
|
||||||
CefRefPtr<CefBrowserHostImpl> browser_;
|
CefRefPtr<CefBrowserHostImpl> browser_;
|
||||||
CefWindowInfo window_info_;
|
CefWindowInfo window_info_;
|
||||||
CefRefPtr<CefClient> client_;
|
CefRefPtr<CefClient> client_;
|
||||||
CefBrowserSettings settings_;
|
CefBrowserSettings settings_;
|
||||||
|
CefPoint inspect_element_at_;
|
||||||
};
|
};
|
||||||
|
|
||||||
void ShowDevToolsWithHelper(ShowDevToolsHelper* helper) {
|
void ShowDevToolsWithHelper(ShowDevToolsHelper* helper) {
|
||||||
helper->browser_->ShowDevTools(helper->window_info_, helper->client_,
|
helper->browser_->ShowDevTools(helper->window_info_, helper->client_,
|
||||||
helper->settings_);
|
helper->settings_, helper->inspect_element_at_);
|
||||||
delete helper;
|
delete helper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -812,7 +815,8 @@ void CefBrowserHostImpl::StopFinding(bool clearSelection) {
|
|||||||
void CefBrowserHostImpl::ShowDevTools(
|
void CefBrowserHostImpl::ShowDevTools(
|
||||||
const CefWindowInfo& windowInfo,
|
const CefWindowInfo& windowInfo,
|
||||||
CefRefPtr<CefClient> client,
|
CefRefPtr<CefClient> client,
|
||||||
const CefBrowserSettings& settings) {
|
const CefBrowserSettings& settings,
|
||||||
|
const CefPoint& inspect_element_at) {
|
||||||
if (CEF_CURRENTLY_ON_UIT()) {
|
if (CEF_CURRENTLY_ON_UIT()) {
|
||||||
if (!web_contents_)
|
if (!web_contents_)
|
||||||
return;
|
return;
|
||||||
@ -823,12 +827,13 @@ void CefBrowserHostImpl::ShowDevTools(
|
|||||||
}
|
}
|
||||||
|
|
||||||
devtools_frontend_ = CefDevToolsFrontend::Show(
|
devtools_frontend_ = CefDevToolsFrontend::Show(
|
||||||
this, windowInfo, client, settings);
|
this, windowInfo, client, settings, inspect_element_at);
|
||||||
devtools_observer_.reset(new DevToolsWebContentsObserver(
|
devtools_observer_.reset(new DevToolsWebContentsObserver(
|
||||||
this, devtools_frontend_->frontend_browser()->web_contents()));
|
this, devtools_frontend_->frontend_browser()->web_contents()));
|
||||||
} else {
|
} else {
|
||||||
ShowDevToolsHelper* helper =
|
ShowDevToolsHelper* helper =
|
||||||
new ShowDevToolsHelper(this, windowInfo, client, settings);
|
new ShowDevToolsHelper(this, windowInfo, client, settings,
|
||||||
|
inspect_element_at);
|
||||||
CEF_POST_TASK(CEF_UIT, base::Bind(ShowDevToolsWithHelper, helper));
|
CEF_POST_TASK(CEF_UIT, base::Bind(ShowDevToolsWithHelper, helper));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,8 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
|||||||
virtual void StopFinding(bool clearSelection) OVERRIDE;
|
virtual void StopFinding(bool clearSelection) OVERRIDE;
|
||||||
virtual void ShowDevTools(const CefWindowInfo& windowInfo,
|
virtual void ShowDevTools(const CefWindowInfo& windowInfo,
|
||||||
CefRefPtr<CefClient> client,
|
CefRefPtr<CefClient> client,
|
||||||
const CefBrowserSettings& settings) OVERRIDE;
|
const CefBrowserSettings& settings,
|
||||||
|
const CefPoint& inspect_element_at) OVERRIDE;
|
||||||
virtual void CloseDevTools() OVERRIDE;
|
virtual void CloseDevTools() OVERRIDE;
|
||||||
virtual void SetMouseCursorChangeDisabled(bool disabled) OVERRIDE;
|
virtual void SetMouseCursorChangeDisabled(bool disabled) OVERRIDE;
|
||||||
virtual bool IsMouseCursorChangeDisabled() OVERRIDE;
|
virtual bool IsMouseCursorChangeDisabled() OVERRIDE;
|
||||||
|
@ -26,7 +26,8 @@ CefDevToolsFrontend* CefDevToolsFrontend::Show(
|
|||||||
CefRefPtr<CefBrowserHostImpl> inspected_browser,
|
CefRefPtr<CefBrowserHostImpl> inspected_browser,
|
||||||
const CefWindowInfo& windowInfo,
|
const CefWindowInfo& windowInfo,
|
||||||
CefRefPtr<CefClient> client,
|
CefRefPtr<CefClient> client,
|
||||||
const CefBrowserSettings& settings) {
|
const CefBrowserSettings& settings,
|
||||||
|
const CefPoint& inspect_element_at) {
|
||||||
CefBrowserSettings new_settings = settings;
|
CefBrowserSettings new_settings = settings;
|
||||||
if (CefColorGetA(new_settings.background_color) == 0) {
|
if (CefColorGetA(new_settings.background_color) == 0) {
|
||||||
// Use white as the default background color for DevTools instead of the
|
// Use white as the default background color for DevTools instead of the
|
||||||
@ -40,12 +41,17 @@ CefDevToolsFrontend* CefDevToolsFrontend::Show(
|
|||||||
inspected_browser->GetWindowHandle(), true,
|
inspected_browser->GetWindowHandle(), true,
|
||||||
inspected_browser->GetRequestContext());
|
inspected_browser->GetRequestContext());
|
||||||
|
|
||||||
|
scoped_refptr<content::DevToolsAgentHost> agent_host =
|
||||||
|
content::DevToolsAgentHost::GetOrCreateFor(
|
||||||
|
inspected_browser->GetWebContents());
|
||||||
|
if (!inspect_element_at.IsEmpty())
|
||||||
|
agent_host->InspectElement(inspect_element_at.x, inspect_element_at.y);
|
||||||
|
|
||||||
// CefDevToolsFrontend will delete itself when the frontend WebContents is
|
// CefDevToolsFrontend will delete itself when the frontend WebContents is
|
||||||
// destroyed.
|
// destroyed.
|
||||||
CefDevToolsFrontend* devtools_frontend = new CefDevToolsFrontend(
|
CefDevToolsFrontend* devtools_frontend = new CefDevToolsFrontend(
|
||||||
static_cast<CefBrowserHostImpl*>(frontend_browser.get()),
|
static_cast<CefBrowserHostImpl*>(frontend_browser.get()),
|
||||||
content::DevToolsAgentHost::GetOrCreateFor(
|
agent_host.get());
|
||||||
inspected_browser->GetWebContents()).get());
|
|
||||||
|
|
||||||
// Need to load the URL after creating the DevTools objects.
|
// Need to load the URL after creating the DevTools objects.
|
||||||
CefDevToolsDelegate* delegate =
|
CefDevToolsDelegate* delegate =
|
||||||
|
@ -28,7 +28,8 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
|
|||||||
CefRefPtr<CefBrowserHostImpl> inspected_browser,
|
CefRefPtr<CefBrowserHostImpl> inspected_browser,
|
||||||
const CefWindowInfo& windowInfo,
|
const CefWindowInfo& windowInfo,
|
||||||
CefRefPtr<CefClient> client,
|
CefRefPtr<CefClient> client,
|
||||||
const CefBrowserSettings& settings);
|
const CefBrowserSettings& settings,
|
||||||
|
const CefPoint& inspect_element_at);
|
||||||
|
|
||||||
void Activate();
|
void Activate();
|
||||||
void Focus();
|
void Focus();
|
||||||
|
@ -336,7 +336,8 @@ void CEF_CALLBACK browser_host_stop_finding(struct _cef_browser_host_t* self,
|
|||||||
|
|
||||||
void CEF_CALLBACK browser_host_show_dev_tools(struct _cef_browser_host_t* self,
|
void CEF_CALLBACK browser_host_show_dev_tools(struct _cef_browser_host_t* self,
|
||||||
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
|
const cef_window_info_t* windowInfo, struct _cef_client_t* client,
|
||||||
const struct _cef_browser_settings_t* settings) {
|
const struct _cef_browser_settings_t* settings,
|
||||||
|
const cef_point_t* inspect_element_at) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -354,6 +355,7 @@ void CEF_CALLBACK browser_host_show_dev_tools(struct _cef_browser_host_t* self,
|
|||||||
DCHECK(settings);
|
DCHECK(settings);
|
||||||
if (!settings)
|
if (!settings)
|
||||||
return;
|
return;
|
||||||
|
// Unverified params: inspect_element_at
|
||||||
|
|
||||||
// Translate param: windowInfo; type: struct_byref_const
|
// Translate param: windowInfo; type: struct_byref_const
|
||||||
CefWindowInfo windowInfoObj;
|
CefWindowInfo windowInfoObj;
|
||||||
@ -363,12 +365,16 @@ void CEF_CALLBACK browser_host_show_dev_tools(struct _cef_browser_host_t* self,
|
|||||||
CefBrowserSettings settingsObj;
|
CefBrowserSettings settingsObj;
|
||||||
if (settings)
|
if (settings)
|
||||||
settingsObj.Set(*settings, false);
|
settingsObj.Set(*settings, false);
|
||||||
|
// Translate param: inspect_element_at; type: simple_byref_const
|
||||||
|
CefPoint inspect_element_atVal =
|
||||||
|
inspect_element_at?*inspect_element_at:CefPoint();
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
CefBrowserHostCppToC::Get(self)->ShowDevTools(
|
CefBrowserHostCppToC::Get(self)->ShowDevTools(
|
||||||
windowInfoObj,
|
windowInfoObj,
|
||||||
CefClientCToCpp::Wrap(client),
|
CefClientCToCpp::Wrap(client),
|
||||||
settingsObj);
|
settingsObj,
|
||||||
|
inspect_element_atVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEF_CALLBACK browser_host_close_dev_tools(
|
void CEF_CALLBACK browser_host_close_dev_tools(
|
||||||
|
@ -279,7 +279,8 @@ void CefBrowserHostCToCpp::StopFinding(bool clearSelection) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CefBrowserHostCToCpp::ShowDevTools(const CefWindowInfo& windowInfo,
|
void CefBrowserHostCToCpp::ShowDevTools(const CefWindowInfo& windowInfo,
|
||||||
CefRefPtr<CefClient> client, const CefBrowserSettings& settings) {
|
CefRefPtr<CefClient> client, const CefBrowserSettings& settings,
|
||||||
|
const CefPoint& inspect_element_at) {
|
||||||
if (CEF_MEMBER_MISSING(struct_, show_dev_tools))
|
if (CEF_MEMBER_MISSING(struct_, show_dev_tools))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -289,12 +290,14 @@ void CefBrowserHostCToCpp::ShowDevTools(const CefWindowInfo& windowInfo,
|
|||||||
DCHECK(client.get());
|
DCHECK(client.get());
|
||||||
if (!client.get())
|
if (!client.get())
|
||||||
return;
|
return;
|
||||||
|
// Unverified params: inspect_element_at
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
struct_->show_dev_tools(struct_,
|
struct_->show_dev_tools(struct_,
|
||||||
&windowInfo,
|
&windowInfo,
|
||||||
CefClientCppToC::Wrap(client),
|
CefClientCppToC::Wrap(client),
|
||||||
&settings);
|
&settings,
|
||||||
|
&inspect_element_at);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefBrowserHostCToCpp::CloseDevTools() {
|
void CefBrowserHostCToCpp::CloseDevTools() {
|
||||||
|
@ -57,8 +57,8 @@ class CefBrowserHostCToCpp
|
|||||||
bool matchCase, bool findNext) OVERRIDE;
|
bool matchCase, bool findNext) OVERRIDE;
|
||||||
virtual void StopFinding(bool clearSelection) OVERRIDE;
|
virtual void StopFinding(bool clearSelection) OVERRIDE;
|
||||||
virtual void ShowDevTools(const CefWindowInfo& windowInfo,
|
virtual void ShowDevTools(const CefWindowInfo& windowInfo,
|
||||||
CefRefPtr<CefClient> client,
|
CefRefPtr<CefClient> client, const CefBrowserSettings& settings,
|
||||||
const CefBrowserSettings& settings) OVERRIDE;
|
const CefPoint& inspect_element_at) OVERRIDE;
|
||||||
virtual void CloseDevTools() OVERRIDE;
|
virtual void CloseDevTools() OVERRIDE;
|
||||||
virtual void SetMouseCursorChangeDisabled(bool disabled) OVERRIDE;
|
virtual void SetMouseCursorChangeDisabled(bool disabled) OVERRIDE;
|
||||||
virtual bool IsMouseCursorChangeDisabled() OVERRIDE;
|
virtual bool IsMouseCursorChangeDisabled() OVERRIDE;
|
||||||
|
@ -34,6 +34,7 @@ namespace {
|
|||||||
enum client_menu_ids {
|
enum client_menu_ids {
|
||||||
CLIENT_ID_SHOW_DEVTOOLS = MENU_ID_USER_FIRST,
|
CLIENT_ID_SHOW_DEVTOOLS = MENU_ID_USER_FIRST,
|
||||||
CLIENT_ID_CLOSE_DEVTOOLS,
|
CLIENT_ID_CLOSE_DEVTOOLS,
|
||||||
|
CLIENT_ID_INSPECT_ELEMENT,
|
||||||
CLIENT_ID_TESTMENU_SUBMENU,
|
CLIENT_ID_TESTMENU_SUBMENU,
|
||||||
CLIENT_ID_TESTMENU_CHECKITEM,
|
CLIENT_ID_TESTMENU_CHECKITEM,
|
||||||
CLIENT_ID_TESTMENU_RADIOITEM1,
|
CLIENT_ID_TESTMENU_RADIOITEM1,
|
||||||
@ -158,6 +159,8 @@ void ClientHandler::OnBeforeContextMenu(
|
|||||||
// Add DevTools items to all context menus.
|
// Add DevTools items to all context menus.
|
||||||
model->AddItem(CLIENT_ID_SHOW_DEVTOOLS, "&Show DevTools");
|
model->AddItem(CLIENT_ID_SHOW_DEVTOOLS, "&Show DevTools");
|
||||||
model->AddItem(CLIENT_ID_CLOSE_DEVTOOLS, "Close DevTools");
|
model->AddItem(CLIENT_ID_CLOSE_DEVTOOLS, "Close DevTools");
|
||||||
|
model->AddSeparator();
|
||||||
|
model->AddItem(CLIENT_ID_INSPECT_ELEMENT, "Inspect Element");
|
||||||
|
|
||||||
// Test context menu features.
|
// Test context menu features.
|
||||||
BuildTestMenu(model);
|
BuildTestMenu(model);
|
||||||
@ -174,11 +177,14 @@ bool ClientHandler::OnContextMenuCommand(
|
|||||||
|
|
||||||
switch (command_id) {
|
switch (command_id) {
|
||||||
case CLIENT_ID_SHOW_DEVTOOLS:
|
case CLIENT_ID_SHOW_DEVTOOLS:
|
||||||
ShowDevTools(browser);
|
ShowDevTools(browser, CefPoint());
|
||||||
return true;
|
return true;
|
||||||
case CLIENT_ID_CLOSE_DEVTOOLS:
|
case CLIENT_ID_CLOSE_DEVTOOLS:
|
||||||
CloseDevTools(browser);
|
CloseDevTools(browser);
|
||||||
return true;
|
return true;
|
||||||
|
case CLIENT_ID_INSPECT_ELEMENT:
|
||||||
|
ShowDevTools(browser, CefPoint(params->GetXCoord(), params->GetYCoord()));
|
||||||
|
return true;
|
||||||
default: // Allow default handling, if any.
|
default: // Allow default handling, if any.
|
||||||
return ExecuteTestMenu(command_id);
|
return ExecuteTestMenu(command_id);
|
||||||
}
|
}
|
||||||
@ -779,7 +785,8 @@ std::string ClientHandler::GetLastDownloadFile() const {
|
|||||||
return last_download_file_;
|
return last_download_file_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientHandler::ShowDevTools(CefRefPtr<CefBrowser> browser) {
|
void ClientHandler::ShowDevTools(CefRefPtr<CefBrowser> browser,
|
||||||
|
const CefPoint& inspect_element_at) {
|
||||||
CefWindowInfo windowInfo;
|
CefWindowInfo windowInfo;
|
||||||
CefBrowserSettings settings;
|
CefBrowserSettings settings;
|
||||||
|
|
||||||
@ -787,7 +794,8 @@ void ClientHandler::ShowDevTools(CefRefPtr<CefBrowser> browser) {
|
|||||||
windowInfo.SetAsPopup(browser->GetHost()->GetWindowHandle(), "DevTools");
|
windowInfo.SetAsPopup(browser->GetHost()->GetWindowHandle(), "DevTools");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
browser->GetHost()->ShowDevTools(windowInfo, this, settings);
|
browser->GetHost()->ShowDevTools(windowInfo, this, settings,
|
||||||
|
inspect_element_at);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientHandler::CloseDevTools(CefRefPtr<CefBrowser> browser) {
|
void ClientHandler::CloseDevTools(CefRefPtr<CefBrowser> browser) {
|
||||||
|
@ -282,7 +282,8 @@ class ClientHandler : public CefClient,
|
|||||||
};
|
};
|
||||||
void SendNotification(NotificationType type);
|
void SendNotification(NotificationType type);
|
||||||
|
|
||||||
void ShowDevTools(CefRefPtr<CefBrowser> browser);
|
void ShowDevTools(CefRefPtr<CefBrowser> browser,
|
||||||
|
const CefPoint& inspect_element_at);
|
||||||
void CloseDevTools(CefRefPtr<CefBrowser> browser);
|
void CloseDevTools(CefRefPtr<CefBrowser> browser);
|
||||||
|
|
||||||
// Returns the startup URL.
|
// Returns the startup URL.
|
||||||
|
@ -2051,7 +2051,8 @@ class V8TestHandler : public TestHandler {
|
|||||||
windowInfo.SetAsPopup(browser->GetHost()->GetWindowHandle(), "DevTools");
|
windowInfo.SetAsPopup(browser->GetHost()->GetWindowHandle(), "DevTools");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
browser->GetHost()->ShowDevTools(windowInfo, this, settings);
|
browser->GetHost()->ShowDevTools(windowInfo, this, settings,
|
||||||
|
CefPoint());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -381,6 +381,7 @@ _simpletypes = {
|
|||||||
'CefEventHandle' : ['cef_event_handle_t', 'kNullEventHandle'],
|
'CefEventHandle' : ['cef_event_handle_t', 'kNullEventHandle'],
|
||||||
'CefWindowHandle' : ['cef_window_handle_t', 'kNullWindowHandle'],
|
'CefWindowHandle' : ['cef_window_handle_t', 'kNullWindowHandle'],
|
||||||
'CefTextInputContext' : ['cef_text_input_context_t' ,'NULL'],
|
'CefTextInputContext' : ['cef_text_input_context_t' ,'NULL'],
|
||||||
|
'CefPoint' : ['cef_point_t', 'CefPoint()'],
|
||||||
'CefRect' : ['cef_rect_t', 'CefRect()'],
|
'CefRect' : ['cef_rect_t', 'CefRect()'],
|
||||||
'CefSize' : ['cef_size_t', 'CefSize()'],
|
'CefSize' : ['cef_size_t', 'CefSize()'],
|
||||||
'CefPageRange' : ['cef_page_range_t', 'CefPageRange()'],
|
'CefPageRange' : ['cef_page_range_t', 'CefPageRange()'],
|
||||||
|
Reference in New Issue
Block a user