[epiphany/mcatanzaro/even-more-password-cleanups: 1/4] Rename sensitive form -> password form
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/even-more-password-cleanups: 1/4] Rename sensitive form -> password form
- Date: Sun, 28 Apr 2019 23:11:33 +0000 (UTC)
commit 483dad940d4177d79c77f6c6d91050edec305141
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Sun Apr 28 16:30:18 2019 -0500
Rename sensitive form -> password form
embed/ephy-embed-shell.c | 24 ++++++++++++------------
embed/ephy-web-view.c | 20 ++++++++++----------
embed/web-extension/ephy-web-extension.c | 8 ++++----
embed/web-extension/resources/js/ephy.js | 20 ++++++++++----------
4 files changed, 36 insertions(+), 36 deletions(-)
---
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 18700b136..3089a77f6 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -81,7 +81,7 @@ enum {
PAGE_CREATED,
ALLOW_TLS_CERTIFICATE,
ALLOW_UNSAFE_BROWSING,
- SENSITIVE_FORM_FOCUSED,
+ PASSWORD_FORM_FOCUSED,
LAST_SIGNAL
};
@@ -222,9 +222,9 @@ ephy_embed_shell_dispose (GObject *object)
}
static void
-web_extension_sensitive_form_focused_message_received_cb (WebKitUserContentManager *manager,
- WebKitJavascriptResult *message,
- EphyEmbedShell *shell)
+web_extension_password_form_focused_message_received_cb (WebKitUserContentManager *manager,
+ WebKitJavascriptResult *message,
+ EphyEmbedShell *shell)
{
guint64 page_id;
gboolean insecure_action;
@@ -235,7 +235,7 @@ web_extension_sensitive_form_focused_message_received_cb (WebKitUserContentManag
variant = g_variant_parse (G_VARIANT_TYPE ("(tb)"), message_str, NULL, NULL, NULL);
g_variant_get (variant, "(tb)", &page_id, &insecure_action);
- g_signal_emit (shell, signals[SENSITIVE_FORM_FOCUSED], 0,
+ g_signal_emit (shell, signals[PASSWORD_FORM_FOCUSED], 0,
page_id, insecure_action);
}
@@ -1136,10 +1136,10 @@ ephy_embed_shell_startup (GApplication *application)
shell, 0);
webkit_user_content_manager_register_script_message_handler_in_world (priv->user_content,
- "sensitiveFormFocused",
+ "passwordFormFocused",
priv->guid);
- g_signal_connect_object (priv->user_content, "script-message-received::sensitiveFormFocused",
- G_CALLBACK (web_extension_sensitive_form_focused_message_received_cb),
+ g_signal_connect_object (priv->user_content, "script-message-received::passwordFormFocused",
+ G_CALLBACK (web_extension_password_form_focused_message_received_cb),
shell, 0);
webkit_user_content_manager_register_script_message_handler (priv->user_content,
@@ -1268,7 +1268,7 @@ ephy_embed_shell_shutdown (GApplication *application)
"passwordManagerRequestSave",
priv->guid);
webkit_user_content_manager_unregister_script_message_handler_in_world (priv->user_content,
- "sensitiveFormFocused",
+ "passwordFormFocused",
priv->guid);
webkit_user_content_manager_unregister_script_message_handler (priv->user_content, "aboutApps");
webkit_user_content_manager_unregister_script_message_handler_in_world (priv->user_content,
@@ -1459,15 +1459,15 @@ ephy_embed_shell_class_init (EphyEmbedShellClass *klass)
G_TYPE_UINT64);
/**
- * EphyEmbedShell::sensitive-form-focused
+ * EphyEmbedShell::password-form-focused
* @shell: the #EphyEmbedShell
* @page_id: the identifier of the web page
* @insecure_action: whether the target of the form is http://
*
* Emitted when a form in a web page gains focus.
*/
- signals[SENSITIVE_FORM_FOCUSED] =
- g_signal_new ("sensitive-form-focused",
+ signals[PASSWORD_FORM_FOCUSED] =
+ g_signal_new ("password-form-focused",
EPHY_TYPE_EMBED_SHELL,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL, NULL,
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index a55e47490..39230900c 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -111,7 +111,7 @@ struct _EphyWebView {
GtkWidget *microphone_info_bar;
GtkWidget *webcam_info_bar;
GtkWidget *password_info_bar;
- GtkWidget *sensitive_form_info_bar;
+ GtkWidget *password_form_info_bar;
EphyHistoryService *history_service;
GCancellable *history_service_cancellable;
@@ -835,16 +835,16 @@ icon_changed_cb (EphyWebView *view,
}
static void
-sensitive_form_focused_cb (EphyEmbedShell *shell,
- guint64 page_id,
- gboolean insecure_action,
- EphyWebView *web_view)
+password_form_focused_cb (EphyEmbedShell *shell,
+ guint64 page_id,
+ gboolean insecure_action,
+ EphyWebView *web_view)
{
GtkWidget *info_bar;
GtkWidget *label;
GtkWidget *content_area;
- if (web_view->sensitive_form_info_bar)
+ if (web_view->password_form_info_bar)
return;
if (webkit_web_view_get_page_id (WEBKIT_WEB_VIEW (web_view)) != page_id)
return;
@@ -864,7 +864,7 @@ sensitive_form_focused_cb (EphyEmbedShell *shell,
g_signal_connect (info_bar, "response", G_CALLBACK (gtk_widget_hide), NULL);
- track_info_bar (info_bar, &web_view->sensitive_form_info_bar);
+ track_info_bar (info_bar, &web_view->password_form_info_bar);
ephy_embed_add_top_widget (EPHY_GET_EMBED_FROM_EPHY_WEB_VIEW (web_view),
info_bar,
@@ -917,8 +917,8 @@ page_created_cb (EphyEmbedShell *shell,
view->web_extension = web_extension;
g_object_add_weak_pointer (G_OBJECT (view->web_extension), (gpointer *)&view->web_extension);
- g_signal_connect_object (shell, "sensitive-form-focused",
- G_CALLBACK (sensitive_form_focused_cb),
+ g_signal_connect_object (shell, "password-form-focused",
+ G_CALLBACK (password_form_focused_cb),
view, 0);
g_signal_connect_object (shell, "allow-tls-certificate",
@@ -945,7 +945,7 @@ ephy_web_view_dispose (GObject *object)
untrack_info_bar (&view->microphone_info_bar);
untrack_info_bar (&view->webcam_info_bar);
untrack_info_bar (&view->password_info_bar);
- untrack_info_bar (&view->sensitive_form_info_bar);
+ untrack_info_bar (&view->password_form_info_bar);
g_clear_object (&view->file_monitor);
diff --git a/embed/web-extension/ephy-web-extension.c b/embed/web-extension/ephy-web-extension.c
index 9595e6514..54c91a7e9 100644
--- a/embed/web-extension/ephy-web-extension.c
+++ b/embed/web-extension/ephy-web-extension.c
@@ -231,8 +231,8 @@ web_page_will_submit_form (WebKitWebPage *web_page,
}
static char *
-sensitive_form_message_serializer (guint64 page_id,
- gboolean is_insecure_action)
+password_form_message_serializer (guint64 page_id,
+ gboolean is_insecure_action)
{
GVariant *variant;
char *message;
@@ -269,8 +269,8 @@ web_page_form_controls_associated (WebKitWebPage *web_page,
js_ephy = jsc_context_get_value (js_context, "Ephy");
js_serializer = jsc_value_new_function (js_context,
- "sensitiveFormMessageSerializer",
- G_CALLBACK (sensitive_form_message_serializer), NULL, NULL,
+ "passwordFormMessageSerializer",
+ G_CALLBACK (password_form_message_serializer), NULL, NULL,
G_TYPE_STRING, 2,
G_TYPE_UINT64, G_TYPE_BOOLEAN);
js_result = jsc_value_object_invoke_method (js_ephy,
diff --git a/embed/web-extension/resources/js/ephy.js b/embed/web-extension/resources/js/ephy.js
index d3b42e6cc..9588e4ee6 100644
--- a/embed/web-extension/resources/js/ephy.js
+++ b/embed/web-extension/resources/js/ephy.js
@@ -256,7 +256,7 @@ Ephy.formControlsAssociated = function(pageID, forms, serializer)
if (!(forms[i] instanceof HTMLFormElement))
continue;
let formManager = new Ephy.FormManager(pageID, forms[i]);
- formManager.handleSensitiveElement(serializer);
+ formManager.handlePasswordForms(serializer);
formManager.preFillForms();
Ephy.formManagers.push(formManager);
}
@@ -390,7 +390,7 @@ Ephy.FormManager = class FormManager
{
this._pageID = pageID;
this._form = form;
- this._sensitiveElementMessageSerializer = null;
+ this._passwordFormMessageSerializer = null;
this._preFillUserMenu = null;
this._elementBeingAutoFilled = null;
}
@@ -407,14 +407,14 @@ Ephy.FormManager = class FormManager
return this._form;
}
- handleSensitiveElement(serializer)
+ handlePasswordForms(serializer)
{
- if (!this._containsSensitiveElement())
+ if (!this._containsPasswordElement())
return;
- Ephy.log('Sensitive form element detected, hooking sensitive form focused callback');
- this._sensitiveElementMessageSerializer = serializer;
- this._form.addEventListener('focus', this._sensitiveElementFocused.bind(this), true);
+ Ephy.log('Password form element detected, hooking password form focused callback');
+ this._passwordFormMessageSerializer = serializer;
+ this._form.addEventListener('focus', this._passwordFormFocused.bind(this), true);
}
isAutoFilling(element)
@@ -542,7 +542,7 @@ Ephy.FormManager = class FormManager
// Private
- _containsSensitiveElement()
+ _containsPasswordElement()
{
for (let i = 0; i < this._form.elements.length; i++) {
let element = this._form.elements[i];
@@ -554,12 +554,12 @@ Ephy.FormManager = class FormManager
return false;
}
- _sensitiveElementFocused(event)
+ _passwordFormFocused(event)
{
let url = new URL(this._form.action);
// Warning: we do not whitelist localhost because it could be redirected by DNS.
let isInsecureAction = url.protocol == 'http:' && url.hostname != "127.0.0.1" && url.hostname !=
"::1";
-
window.webkit.messageHandlers.sensitiveFormFocused.postMessage(this._sensitiveElementMessageSerializer(this._pageID,
isInsecureAction));
+
window.webkit.messageHandlers.passwordFormFocused.postMessage(this._passwordFormMessageSerializer(this._pageID,
isInsecureAction));
}
_findPasswordFields()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]