WebKit Bugzilla
Attachment 360855 Details for
Bug 194151
: [WPE] MiniBrowser: add ky bindings for back/forward navigation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
wpe-mb-key-navigation.diff (text/plain), 3.69 KB, created by
Carlos Garcia Campos
on 2019-02-01 03:46:05 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2019-02-01 03:46:05 PST
Size:
3.69 KB
patch
obsolete
>diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 265f91945ae..579750031ac 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,16 @@ >+2019-02-01 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [WPE] MiniBrowser: add ky bindings for back/forward navigation >+ https://bugs.webkit.org/show_bug.cgi?id=194151 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ ALT + <- go back >+ ALT + -> go forward >+ >+ * MiniBrowser/wpe/main.cpp: >+ (main): >+ > 2019-02-01 Carlos Garcia Campos <cgarcia@igalia.com> > > [WPE] Show test results in minibrowser >diff --git a/Tools/MiniBrowser/wpe/main.cpp b/Tools/MiniBrowser/wpe/main.cpp >index 8070080c83b..25cc88493ff 100644 >--- a/Tools/MiniBrowser/wpe/main.cpp >+++ b/Tools/MiniBrowser/wpe/main.cpp >@@ -61,23 +61,40 @@ static const GOptionEntry commandLineOptions[] = > > class InputClient final : public WPEToolingBackends::ViewBackend::InputClient { > public: >- InputClient(GMainLoop* loop) >+ InputClient(GMainLoop* loop, WebKitWebView* webView) > : m_loop(loop) >+ , m_webView(webView) > { > } > > bool dispatchKeyboardEvent(struct wpe_input_keyboard_event* event) override > { >- if (event->pressed && event->modifiers & wpe_input_keyboard_modifier_control && event->key_code == WPE_KEY_q) { >+ if (!event->pressed) >+ return false; >+ >+ if (event->modifiers & wpe_input_keyboard_modifier_control && event->key_code == WPE_KEY_q) { > g_main_loop_quit(m_loop); > return true; > } > >+ if (event->modifiers & wpe_input_keyboard_modifier_alt) { >+ if ((event->key_code == WPE_KEY_Left || event->key_code == WPE_KEY_KP_Left) && webkit_web_view_can_go_back(m_webView)) { >+ webkit_web_view_go_back(m_webView); >+ return true; >+ } >+ >+ if ((event->key_code == WPE_KEY_Right || event->key_code == WPE_KEY_KP_Right) && webkit_web_view_can_go_forward(m_webView)) { >+ webkit_web_view_go_forward(m_webView); >+ return true; >+ } >+ } >+ > return false; > } > > private: > GMainLoop* m_loop { nullptr }; >+ WebKitWebView* m_webView { nullptr }; > }; > > static WebKitWebView* createWebViewForAutomationCallback(WebKitAutomationSession*, WebKitWebView* view) >@@ -142,12 +159,6 @@ int main(int argc, char *argv[]) > return 1; > } > >- backend->setInputClient(std::make_unique<InputClient>(loop)); >- >- auto* viewBackend = webkit_web_view_backend_new(wpeBackend, [](gpointer data) { >- delete static_cast<WPEToolingBackends::ViewBackend*>(data); >- }, backend.release()); >- > auto* webContext = (privateMode || automationMode) ? webkit_web_context_new_ephemeral() : webkit_web_context_get_default(); > > if (cookiesPolicy) { >@@ -182,6 +193,11 @@ int main(int argc, char *argv[]) > "enable-encrypted-media", TRUE, > nullptr); > >+ auto* backendPtr = backend.get(); >+ auto* viewBackend = webkit_web_view_backend_new(wpeBackend, [](gpointer data) { >+ delete static_cast<WPEToolingBackends::ViewBackend*>(data); >+ }, backend.release()); >+ > auto* webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, > "backend", viewBackend, > "web-context", webContext, >@@ -190,6 +206,8 @@ int main(int argc, char *argv[]) > nullptr)); > g_object_unref(settings); > >+ backendPtr->setInputClient(std::make_unique<InputClient>(loop, webView)); >+ > webkit_web_context_set_automation_allowed(webContext, automationMode); > g_signal_connect(webContext, "automation-started", G_CALLBACK(automationStartedCallback), webView); > g_signal_connect(webView, "permission-request", G_CALLBACK(decidePermissionRequest), NULL);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
zan
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194151
: 360855