Changeset 28817 in webkit
- Timestamp:
- Dec 17, 2007 12:51:36 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/gtk/ChangeLog
r28737 r28817 1 2007-12-17 Luca Bruno <lethalman88@gmail.com> 2 3 Reviewed by Alp Toker. 4 5 http://bugs.webkit.org/show_bug.cgi?id=13542 6 gdklauncher doesnt change URL in adress GTKEntry. 7 8 Let DOMDocument observers do their work before emitting title-changed. 9 The load-committed signal has been added for both the view and the frame. 10 11 * WebCoreSupport/FrameLoaderClientGtk.cpp: 12 (WebKit::FrameLoaderClient::dispatchDidReceiveTitle): emit title-changed 13 (WebKit::FrameLoaderClient::setTitle): set private title 14 (WebKit::FrameLoaderClient::dispatchDidCommitLoad): update the frame uri and emit load-committed 15 * WebView/webkit-marshal.list: 16 * WebView/webkitprivate.h: 17 (_WebKitWebFramePrivate): rename location to uri 18 * WebView/webkitwebframe.cpp: 19 (webkit_web_frame_get_location): renamed to *_get_uri 20 (webkit_web_frame_get_uri): 21 (webkit_web_frame_real_title_changed): removed (see FrameLoaderClient::setTitle) 22 (webkit_web_frame_class_init): pass the frame and the title in title-changed, not the uri 23 (webkit_web_frame_finalize): 24 * WebView/webkitwebframe.h: 25 (_WebKitWebFrameClass): removed title_changed 26 * WebView/webkitwebview.cpp: 27 (webkit_web_view_class_init): pass only the title in title-changed 28 1 29 2007-12-14 Alp Toker <alp@atoker.com> 2 30 -
trunk/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
r28737 r28817 504 504 void FrameLoaderClient::dispatchDidReceiveTitle(const String& title) 505 505 { 506 notImplemented(); 507 } 508 506 g_signal_emit_by_name(m_frame, "title-changed", title.utf8().data()); 507 508 WebKitWebView* page = getViewFromFrame(m_frame); 509 if (m_frame == webkit_web_view_get_main_frame(page)) 510 g_signal_emit_by_name(page, "title-changed", m_frame, title.utf8().data()); 511 } 509 512 510 513 void FrameLoaderClient::dispatchDidCommitLoad() 511 514 { 512 notImplemented(); 515 /* Update the URI once first data has been received. 516 * This means the URI is valid and successfully identify the page that's going to be loaded. 517 */ 518 WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(m_frame); 519 g_free(frameData->uri); 520 frameData->uri = g_strdup(core(m_frame)->loader()->url().prettyURL().utf8().data()); 521 522 g_signal_emit_by_name(m_frame, "load-committed"); 523 524 WebKitWebView* page = getViewFromFrame(m_frame); 525 if (m_frame == webkit_web_view_get_main_frame(page)) 526 g_signal_emit_by_name(page, "load-committed", m_frame); 513 527 } 514 528 … … 634 648 void FrameLoaderClient::setTitle(const String& title, const KURL& url) 635 649 { 636 WebKitWebView* page = getViewFromFrame(m_frame); 637 638 CString titleString = title.utf8(); 639 DeprecatedCString urlString = url.prettyURL().utf8(); 640 g_signal_emit_by_name(m_frame, "title-changed", titleString.data(), urlString.data()); 641 642 if (m_frame == webkit_web_view_get_main_frame(page)) 643 g_signal_emit_by_name(page, "title-changed", titleString.data(), urlString.data()); 650 WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(m_frame); 651 g_free(frameData->title); 652 frameData->title = g_strdup(title.utf8().data()); 644 653 } 645 654 -
trunk/WebKit/gtk/WebView/webkit-marshal.list
r28273 r28817 1 VOID:OBJECT 2 VOID:STRING 1 3 VOID:STRING,STRING 2 4 VOID:OBJECT,BOOLEAN 5 VOID:OBJECT,STRING 3 6 VOID:OBJECT,OBJECT 4 7 VOID:OBJECT,POINTER,POINTER -
trunk/WebKit/gtk/WebView/webkitprivate.h
r28648 r28817 74 74 gchar* name; 75 75 gchar* title; 76 gchar* location;76 gchar* uri; 77 77 }; 78 78 -
trunk/WebKit/gtk/WebView/webkitwebframe.cpp
r28648 r28817 48 48 enum { 49 49 CLEARED, 50 LOAD_COMMITTED, 50 51 LOAD_DONE, 51 52 TITLE_CHANGED, … … 56 57 static guint webkit_web_frame_signals[LAST_SIGNAL] = { 0, }; 57 58 58 static void webkit_web_frame_real_title_changed(WebKitWebFrame* frame, gchar* title, gchar* location);59 60 59 G_DEFINE_TYPE(WebKitWebFrame, webkit_web_frame, G_TYPE_OBJECT) 61 60 … … 66 65 g_free(privateData->name); 67 66 g_free(privateData->title); 68 g_free(privateData-> location);67 g_free(privateData->uri); 69 68 delete privateData->frame; 70 69 … … 88 87 G_TYPE_NONE, 0); 89 88 89 webkit_web_frame_signals[LOAD_COMMITTED] = g_signal_new("load-committed", 90 G_TYPE_FROM_CLASS(frameClass), 91 (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), 92 0, 93 NULL, 94 NULL, 95 g_cclosure_marshal_VOID__VOID, 96 G_TYPE_NONE, 0); 97 90 98 webkit_web_frame_signals[LOAD_DONE] = g_signal_new("load-done", 91 99 G_TYPE_FROM_CLASS(frameClass), … … 101 109 G_TYPE_FROM_CLASS(frameClass), 102 110 (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), 103 G_STRUCT_OFFSET(WebKitWebFrameClass, title_changed),104 NULL, 105 NULL, 106 webkit_marshal_VOID__STRING _STRING,107 G_TYPE_NONE, 2,108 G_TYPE_STRING , G_TYPE_STRING);111 0, 112 NULL, 113 NULL, 114 webkit_marshal_VOID__STRING, 115 G_TYPE_NONE, 1, 116 G_TYPE_STRING); 109 117 110 118 webkit_web_frame_signals[HOVERING_OVER_LINK] = g_signal_new("hovering-over-link", … … 118 126 G_TYPE_STRING, G_TYPE_STRING); 119 127 120 frameClass->title_changed = webkit_web_frame_real_title_changed;121 122 128 /* 123 129 * implementations of virtual methods 124 130 */ 125 131 G_OBJECT_CLASS(frameClass)->finalize = webkit_web_frame_finalize; 126 }127 128 static void webkit_web_frame_real_title_changed(WebKitWebFrame* frame, gchar* title, gchar* location)129 {130 WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(frame);131 g_free(frameData->title);132 g_free(frameData->location);133 frameData->title = g_strdup(title);134 frameData->location = g_strdup(location);135 132 } 136 133 … … 168 165 frameData->name = 0; 169 166 frameData->title = 0; 170 frameData-> location= 0;167 frameData->uri = 0; 171 168 172 169 return frame; … … 200 197 } 201 198 202 const gchar* webkit_web_frame_get_ location(WebKitWebFrame* frame)199 const gchar* webkit_web_frame_get_uri(WebKitWebFrame* frame) 203 200 { 204 201 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL); 205 202 206 203 WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(frame); 207 return frameData-> location;204 return frameData->uri; 208 205 } 209 206 … … 419 416 } 420 417 421 422 418 #if GTK_CHECK_VERSION(2,10,0) 423 419 -
trunk/WebKit/gtk/WebView/webkitwebframe.h
r28484 r28817 44 44 GObjectClass parent; 45 45 46 void (*title_changed) (WebKitWebFrame* frame, gchar* title, gchar* location);47 48 46 void (*_webkit_reserved1) (void); 49 47 void (*_webkit_reserved2) (void); … … 51 49 void (*_webkit_reserved4) (void); 52 50 void (*_webkit_reserved5) (void); 51 void (*_webkit_reserved6) (void); 53 52 }; 54 53 … … 69 68 70 69 WEBKIT_API const gchar* 71 webkit_web_frame_get_ location(WebKitWebFrame* frame);70 webkit_web_frame_get_uri (WebKitWebFrame* frame); 72 71 73 72 WEBKIT_API WebKitWebFrame* -
trunk/WebKit/gtk/WebView/webkitwebview.cpp
r28728 r28817 57 57 WINDOW_OBJECT_CLEARED, 58 58 LOAD_STARTED, 59 LOAD_COMMITTED, 59 60 LOAD_PROGRESS_CHANGED, 60 61 LOAD_FINISHED, … … 331 332 window = gtk_widget_get_toplevel(GTK_WIDGET(webView)); 332 333 dialog = gtk_message_dialog_new(GTK_WIDGET_TOPLEVEL(window) ? GTK_WINDOW(window) : 0, GTK_DIALOG_DESTROY_WITH_PARENT, messageType, buttons, "%s", message); 333 gchar* title = g_strconcat("JavaScript - ", webkit_web_frame_get_ location(frame), NULL);334 gchar* title = g_strconcat("JavaScript - ", webkit_web_frame_get_uri(frame), NULL); 334 335 gtk_window_set_title(GTK_WINDOW(dialog), title); 335 336 g_free(title); … … 496 497 497 498 /** 499 * WebKitWebView::load-committed: 500 * @web_view: the object on which the signal is emitted 501 * @frame: the main frame that received the first data 502 * 503 * When a #WebKitWebFrame loaded the first data this signal is emitted. 504 */ 505 webkit_web_view_signals[LOAD_COMMITTED] = g_signal_new("load-committed", 506 G_TYPE_FROM_CLASS(webViewClass), 507 (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), 508 0, 509 NULL, 510 NULL, 511 g_cclosure_marshal_VOID__OBJECT, 512 G_TYPE_NONE, 1, 513 WEBKIT_TYPE_WEB_FRAME); 514 515 516 /** 498 517 * WebKitWebView::load-progress-changed: 499 518 * @web_view: the #WebKitWebView … … 520 539 WEBKIT_TYPE_WEB_FRAME); 521 540 541 /** 542 * WebKitWebView::title-changed: 543 * @web_view: the object on which the signal is emitted 544 * @frame: the main frame 545 * @title: the new title 546 * 547 * When a #WebKitWebFrame changes the document title this signal is emitted. 548 */ 522 549 webkit_web_view_signals[TITLE_CHANGED] = g_signal_new("title-changed", 523 550 G_TYPE_FROM_CLASS(webViewClass), … … 526 553 NULL, 527 554 NULL, 528 webkit_marshal_VOID__ STRING_STRING,555 webkit_marshal_VOID__OBJECT_STRING, 529 556 G_TYPE_NONE, 2, 530 G_TYPE_STRING, G_TYPE_STRING); 557 WEBKIT_TYPE_WEB_FRAME, 558 G_TYPE_STRING); 531 559 532 560 webkit_web_view_signals[HOVERING_OVER_LINK] = g_signal_new("hovering-over-link", -
trunk/WebKitTools/ChangeLog
r28789 r28817 1 2007-12-17 Luca Bruno <lethalman88@gmail.com> 2 3 Reviewed by Alp Toker. 4 5 http://bugs.webkit.org/show_bug.cgi?id=13542 6 gdklauncher doesnt change URL in adress GTKEntry. 7 8 * GtkLauncher/main.c: 9 (load_commit_cb): added 10 (title_change_cb): 11 (create_browser): 12 1 13 2007-12-16 Dimitri Glazkov <dimitri@glazkov.com> 2 14 -
trunk/WebKitTools/GtkLauncher/main.c
r28316 r28817 66 66 67 67 static void 68 title_change_cb (WebKitWebView* page, const gchar* title, const gchar* uri, gpointer data) 69 { 70 gtk_entry_set_text (GTK_ENTRY (uri_entry), uri); 71 68 title_change_cb (WebKitWebView* web_view, WebKitWebFrame* web_frame, const gchar* title, gpointer data) 69 { 72 70 if (main_title) 73 71 g_free (main_title); … … 84 82 85 83 static void 84 load_commit_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data) 85 { 86 const gchar* uri = webkit_web_frame_get_uri(frame); 87 if (uri) 88 gtk_entry_set_text (GTK_ENTRY (uri_entry), uri); 89 } 90 91 static void 86 92 destroy_cb (GtkWidget* widget, gpointer data) 87 93 { … … 112 118 g_signal_connect (G_OBJECT (web_view), "title-changed", G_CALLBACK (title_change_cb), web_view); 113 119 g_signal_connect (G_OBJECT (web_view), "load-progress-changed", G_CALLBACK (progress_change_cb), web_view); 120 g_signal_connect (G_OBJECT (web_view), "load-committed", G_CALLBACK (load_commit_cb), web_view); 114 121 g_signal_connect (G_OBJECT (web_view), "hovering-over-link", G_CALLBACK (link_hover_cb), web_view); 115 122
Note: See TracChangeset
for help on using the changeset viewer.