Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pregmodfan
fc-pregmod
Commits
88c0df7c
Commit
88c0df7c
authored
5 years ago
by
svornost
Browse files
Options
Downloads
Patches
Plain Diff
Apparently Chrome's ENTIRE javascript debugger is exposed in CEF, so we can just...use it. Cool.
parent
1be723b2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!5145
Add standalone host executable for FreeCities, with unlimited storage adapter
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FCHost/fchost/fchost_handler.cc
+32
-0
32 additions, 0 deletions
FCHost/fchost/fchost_handler.cc
FCHost/fchost/fchost_handler.h
+10
-2
10 additions, 2 deletions
FCHost/fchost/fchost_handler.h
with
42 additions
and
2 deletions
FCHost/fchost/fchost_handler.cc
+
32
−
0
View file @
88c0df7c
...
...
@@ -151,6 +151,38 @@ void FCHostHandler::OnBeforeDownload(CefRefPtr<CefBrowser> browser,
callback
->
Continue
(
suggested_name
,
true
);
}
bool
FCHostHandler
::
OnPreKeyEvent
(
CefRefPtr
<
CefBrowser
>
browser
,
const
CefKeyEvent
&
event
,
CefEventHandle
os_event
,
bool
*
is_keyboard_shortcut
)
{
CEF_REQUIRE_UI_THREAD
();
if
(
event
.
type
==
cef_key_event_type_t
::
KEYEVENT_CHAR
)
{
// CTRL+SHIFT+J - bring up the Javascript debugger
if
((
event
.
modifiers
==
(
cef_event_flags_t
::
EVENTFLAG_CONTROL_DOWN
|
cef_event_flags_t
::
EVENTFLAG_SHIFT_DOWN
))
&&
event
.
unmodified_character
==
10
/* j? maybe only on windows? whatever */
)
{
CefWindowInfo
windowInfo
;
CefBrowserSettings
settings
;
CefPoint
point
;
windowInfo
.
SetAsPopup
(
browser
->
GetHost
()
->
GetWindowHandle
(),
"DevTools"
);
browser
->
GetHost
()
->
ShowDevTools
(
windowInfo
,
browser
->
GetHost
()
->
GetClient
(),
settings
,
point
);
return
true
;
}
// CTRL+F - bring up Find In Page
else
if
(
event
.
modifiers
==
cef_event_flags_t
::
EVENTFLAG_CONTROL_DOWN
&&
event
.
unmodified_character
==
6
/* f? maybe only on windows? whatever */
)
{
// probably can do this at some point by ripping off code from the full-fat cefclient, but damn there's a lot of it...
// return true;
}
}
return
false
;
}
void
FCHostHandler
::
CloseAllBrowsers
(
bool
force_close
)
{
if
(
!
CefCurrentlyOn
(
TID_UI
))
{
// Execute on the UI thread.
...
...
This diff is collapsed.
Click to expand it.
FCHost/fchost/fchost_handler.h
+
10
−
2
View file @
88c0df7c
...
...
@@ -12,7 +12,8 @@ class FCHostHandler : public CefClient,
public
CefDisplayHandler
,
public
CefLifeSpanHandler
,
public
CefLoadHandler
,
public
CefDownloadHandler
{
public
CefDownloadHandler
,
public
CefKeyboardHandler
{
public:
explicit
FCHostHandler
(
bool
use_views
);
~
FCHostHandler
();
...
...
@@ -29,6 +30,7 @@ class FCHostHandler : public CefClient,
}
virtual
CefRefPtr
<
CefLoadHandler
>
GetLoadHandler
()
OVERRIDE
{
return
this
;
}
virtual
CefRefPtr
<
CefDownloadHandler
>
GetDownloadHandler
()
OVERRIDE
{
return
this
;
}
virtual
CefRefPtr
<
CefKeyboardHandler
>
GetKeyboardHandler
()
OVERRIDE
{
return
this
;
}
// CefDisplayHandler methods:
...
...
@@ -57,7 +59,13 @@ class FCHostHandler : public CefClient,
CefRefPtr
<
CefDownloadItem
>
download_item
,
const
CefString
&
suggested_name
,
CefRefPtr
<
CefBeforeDownloadCallback
>
callback
)
OVERRIDE
;
// CefKeyboardHandler methods:
virtual
bool
OnPreKeyEvent
(
CefRefPtr
<
CefBrowser
>
browser
,
const
CefKeyEvent
&
event
,
CefEventHandle
os_event
,
bool
*
is_keyboard_shortcut
)
OVERRIDE
;
// Request that all existing browser windows close.
void
CloseAllBrowsers
(
bool
force_close
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment