A lice-sized code review (suzhe localrev 1601)

1 view
Skip to first unread message

jame...@gmail.com

unread,
Dec 2, 2009, 4:47:16 AM12/2/09
to phni...@gmail.com, google-gadgets...@googlegroups.com
Hello phnixwxz,

I'd like you to do a code review. Please review the following patch:

----------------------------------------------------------------------
r1601: suzhe | 2009-12-02 17:43:04 +0800

Implement "ongotourl" signal for gtkwebkit-browser-element.
----------------------------------------------------------------------

=== extensions/gtkwebkit_browser_element/browser_element.cc
==================================================================
--- extensions/gtkwebkit_browser_element/browser_element.cc (revision 1600)
+++ extensions/gtkwebkit_browser_element/browser_element.cc (revision 1601)
@@ -523,13 +523,17 @@
webkit_web_navigation_action_get_modifier_state(action));

gboolean result = FALSE;
- if (reason == WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED) {
+ if (reason == WEBKIT_WEB_NAVIGATION_REASON_LINK_CLICKED)
result = impl->HandleNavigationRequest(original_uri, new_uri);
- if (result)
- webkit_web_policy_decision_ignore(decision);
- }

+ // If the url was not opened in a new window, the give the gadget a chance
+ // to handle the url.
if (!result)
+ result = impl->ongotourl_signal_(new_uri);
+
+ if (result)
+ webkit_web_policy_decision_ignore(decision);
+ else
impl->loaded_uri_ = new_uri ? new_uri : "";

return result;
@@ -593,6 +597,8 @@

ScriptableHolder<ScriptableInterface> external_object_;

+ Signal1<bool, const char *> ongotourl_signal_;
+
gint x_;
gint y_;
gint width_;
@@ -662,6 +668,9 @@
RegisterProperty("alwaysOpenNewWindow",
NewSlot(&BrowserElement::IsAlwaysOpenNewWindow),
NewSlot(&BrowserElement::SetAlwaysOpenNewWindow));
+ RegisterClassSignal("ongotourl",
+ &Impl::ongotourl_signal_,
+ &BrowserElement::impl_);
}

} // namespace gtkwebkit

This is a semiautomated message from "svkmail". Complaints or suggestions?
Mail edy...@gmail.com.

Xianzhu Wang

unread,
Dec 2, 2009, 7:59:20 PM12/2/09
to jame...@gmail.com, google-gadgets...@googlegroups.com
LGTM

2009/12/2 <james.su@gmail.com>
Reply all
Reply to author
Forward
0 new messages