After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694144 - Implement get web app title in WebKit2
Implement get web app title in WebKit2
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Backend
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Xan Lopez
Epiphany Maintainers
Depends on: 684437 694659
Blocks: 678610 694091
 
 
Reported: 2013-02-19 06:59 UTC by Manuel Rego Casasnovas
Modified: 2013-03-02 14:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (6.00 KB, patch)
2013-02-19 07:01 UTC, Manuel Rego Casasnovas
accepted-commit_now Details | Review
Patch fixing small issues commented before (5.88 KB, patch)
2013-02-25 08:56 UTC, Manuel Rego Casasnovas
none Details | Review
Patch including check for null web extension (6.08 KB, patch)
2013-02-25 09:32 UTC, Manuel Rego Casasnovas
none Details | Review
Patch 1/2 (3.68 KB, patch)
2013-02-25 13:23 UTC, Manuel Rego Casasnovas
reviewed Details | Review
Patch 2/2 (4.49 KB, patch)
2013-02-25 13:25 UTC, Manuel Rego Casasnovas
none Details | Review
Patch 2/2 (4.43 KB, patch)
2013-02-26 16:11 UTC, Manuel Rego Casasnovas
reviewed Details | Review
Patch 1/1 updated (3.67 KB, patch)
2013-02-27 18:06 UTC, Manuel Rego Casasnovas
reviewed Details | Review
Patch 1/2 updated (4.39 KB, patch)
2013-02-27 18:07 UTC, Manuel Rego Casasnovas
reviewed Details | Review
Patch 1/2 fixed naming issue (3.70 KB, patch)
2013-02-28 22:29 UTC, Manuel Rego Casasnovas
committed Details | Review
Patch 2/2 fixed naming issue (4.41 KB, patch)
2013-02-28 22:29 UTC, Manuel Rego Casasnovas
committed Details | Review

Description Manuel Rego Casasnovas 2013-02-19 06:59:57 UTC
Currently it's not implemented in WK2 the part to get the default application title from DOM bindings.
Comment 1 Manuel Rego Casasnovas 2013-02-19 07:01:54 UTC
Created attachment 236724 [details] [review]
Patch
Comment 2 Xan Lopez 2013-02-22 11:10:47 UTC
Review of attachment 236724 [details] [review]:

Looks pretty good to me, just two small nitpicks!

::: embed/web-extension/ephy-web-extension.c
@@ +286,3 @@
+ephy_web_extension_get_web_app_title (WebKitWebPage *web_page)
+{
+  WebKitDOMDocument *document = NULL;

This is super nitpick, but no need to set this to NULL here.

@@ +363,3 @@
+    g_dbus_method_invocation_return_value (invocation,
+                                           g_variant_new ("(s)",
+                                                          title != NULL ? title : ""));

Indentation seems off here, and you can just use title ? title : ""
Comment 3 Manuel Rego Casasnovas 2013-02-25 08:56:12 UTC
Created attachment 237339 [details] [review]
Patch fixing small issues commented before

Fixed the small issues commented by Xan.

Please push it for me as I don't have permissions at git.gnome.org. Thanks :-)
Comment 4 Manuel Rego Casasnovas 2013-02-25 09:32:44 UTC
Created attachment 237343 [details] [review]
Patch including check for null web extension

After bug #694519 web extension proxy can be NULL, so included a check before using it to get the title from DOM.
Comment 5 Manuel Rego Casasnovas 2013-02-25 13:23:54 UTC
Created attachment 237354 [details] [review]
Patch 1/2
Comment 6 Manuel Rego Casasnovas 2013-02-25 13:25:20 UTC
Created attachment 237355 [details] [review]
Patch 2/2

This has been implemented now in 2 patches:
1) It moves the code of the DOM bindings to ephy-web-dom-utils
2) Implements get title in WK2

If you prefer I can merge it in just one patch.
Comment 7 Manuel Rego Casasnovas 2013-02-26 16:11:46 UTC
Created attachment 237456 [details] [review]
Patch 2/2
Comment 8 Xan Lopez 2013-02-27 17:40:33 UTC
Review of attachment 237354 [details] [review]:

::: lib/ephy-web-dom-utils.c
@@ +134,3 @@
+  }
+
+  return title;

The opening braces are wrong here, we should be using the style described in HACKING.
Comment 9 Xan Lopez 2013-02-27 17:43:26 UTC
Review of attachment 237456 [details] [review]:

::: src/window-commands.c
@@ +725,2 @@
 	{
+		g_print ("inside last if");

Oops ;)

@@ +770,3 @@
+				   NULL,
+				   fill_default_application_title_callback,
+				   data);

Having GDbus calls around the place is pretty ugly, I think in the future we should just have wrappers around them in EphyWebView or wherever. But should do for now.
Comment 10 Manuel Rego Casasnovas 2013-02-27 18:06:47 UTC
Created attachment 237551 [details] [review]
Patch 1/1 updated
Comment 11 Manuel Rego Casasnovas 2013-02-27 18:07:05 UTC
Created attachment 237552 [details] [review]
Patch 1/2 updated
Comment 12 Claudio Saavedra 2013-02-28 07:42:27 UTC
(In reply to comment #9)
> Review of attachment 237456 [details] [review]:

> Having GDbus calls around the place is pretty ugly, I think in the future we
> should just have wrappers around them in EphyWebView or wherever. But should do
> for now.

I agree, we should have some methods, perhaps in EphyWebExtension to wrap the dbus calls.
Comment 13 Xan Lopez 2013-02-28 17:13:26 UTC
Review of attachment 237551 [details] [review]:

::: lib/ephy-web-dom-utils.c
@@ +108,3 @@
+ **/
+char *
+ephy_web_dom_get_application_title (WebKitDOMDocument *document)

Sorry to be a pain in the ass, but the name is also wrong here.
Comment 14 Xan Lopez 2013-02-28 17:14:18 UTC
Review of attachment 237552 [details] [review]:

Looks good minus the naming issue.
Comment 15 Manuel Rego Casasnovas 2013-02-28 22:18:35 UTC
(In reply to comment #13)
> Review of attachment 237551 [details] [review]:
> 
> ::: lib/ephy-web-dom-utils.c
> @@ +108,3 @@
> + **/
> +char *
> +ephy_web_dom_get_application_title (WebKitDOMDocument *document)
> 
> Sorry to be a pain in the ass, but the name is also wrong here.

Don't worry, it's my fault. I hope to do it better next time.

I'll upload the patches updated.
Comment 16 Manuel Rego Casasnovas 2013-02-28 22:29:12 UTC
Created attachment 237658 [details] [review]
Patch 1/2 fixed naming issue
Comment 17 Manuel Rego Casasnovas 2013-02-28 22:29:46 UTC
Created attachment 237659 [details] [review]
Patch 2/2 fixed naming issue
Comment 18 Xan Lopez 2013-03-01 12:38:20 UTC
Review of attachment 237658 [details] [review]:

Looks good.
Comment 19 Xan Lopez 2013-03-01 12:38:53 UTC
Review of attachment 237659 [details] [review]:

Looks good.
Comment 20 Xan Lopez 2013-03-02 14:12:14 UTC
Pushed both patches to master.