Changeset 62787 in webkit
- Timestamp:
- Jul 8, 2010 7:37:47 AM (14 years ago)
- Location:
- trunk/WebKit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/ChangeLog
r62786 r62787 1 2010-07-08 Lucas De Marchi <lucas.demarchi@profusion.mobi> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [EFL] Implement several notification hooks in FrameLoaderClient. 6 We just notify browser, making the appropriate type conversions about 7 the events occurring in WebCore. 8 https://bugs.webkit.org/show_bug.cgi?id=41005 9 10 * efl/WebCoreSupport/FrameLoaderClientEfl.cpp: 11 (WebCore::FrameLoaderClientEfl::dispatchWillSendRequest): alloc 2 new 12 wrapper structures in stack in order to give client the opportunity to 13 change parameters. Then, call the function it defines. 14 (WebCore::FrameLoaderClientEfl::assignIdentifierToInitialRequest): 15 (WebCore::FrameLoaderClientEfl::didPerformFirstNavigation): notify 16 client. 17 (WebCore::FrameLoaderClientEfl::saveViewStateToItem): notify client. 18 (WebCore::FrameLoaderClientEfl::restoreViewState): notify client. 19 (WebCore::FrameLoaderClientEfl::dispatchDidChangeLocationWithinPage): 20 notify browser that the url changed. 21 (WebCore::FrameLoaderClientEfl::dispatchDidReceiveIcon): notify 22 browser. 23 (WebCore::FrameLoaderClientEfl::dispatchDidStartProvisionalLoad): 24 notify browser. 25 (WebCore::FrameLoaderClientEfl::dispatchDidFinishDocumentLoad): notify 26 browser. 27 (WebCore::FrameLoaderClientEfl::dispatchDidFirstLayout): norify 28 browser. 29 (WebCore::FrameLoaderClientEfl::dispatchDidFirstVisuallyNonEmptyLayout): 30 notify browser. 31 (WebCore::FrameLoaderClientEfl::dispatchShow): notify browser. 32 * efl/ewk/ewk_frame.cpp: 33 (ewk_frame_request_will_send): emit signal notifying browser. 34 (ewk_frame_request_assign_identifier): emit signal notifying browser. 35 (ewk_frame_did_perform_first_navigation): emit signal notifying browser. 36 (ewk_frame_view_state_save): emit signal notifying browser. 37 (ewk_frame_load_provisional): emit signal notifying browser. 38 (ewk_frame_load_firstlayout_finished): emit signal notifying browser. 39 (ewk_frame_load_firstlayout_nonempty_finished): emit signal notifying browser. 40 (ewk_frame_load_document_finished): emit signal notifying browser. 41 * efl/ewk/ewk_frame.h: update documentation about signals being sent 42 and implement wrapper struct for ResourceRequest. 43 * efl/ewk/ewk_private.h: export private functions. 44 1 45 2010-07-08 Lucas De Marchi <lucas.demarchi@profusion.mobi> 2 46 -
trunk/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
r62786 r62787 252 252 } 253 253 254 void FrameLoaderClientEfl::dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, const ResourceResponse&) 255 { 256 notImplemented(); 254 void FrameLoaderClientEfl::dispatchWillSendRequest(DocumentLoader* loader, unsigned long identifier, ResourceRequest& coreRequest, const ResourceResponse& coreResponse) 255 { 256 CString url = coreRequest.url().prettyURL().utf8(); 257 DBG("Resource url=%s", url.data()); 258 259 Ewk_Frame_Resource_Request request = { 0, identifier }; 260 Ewk_Frame_Resource_Request orig = request; /* Initialize const fields. */ 261 262 orig.url = request.url = url.data(); 263 264 ewk_frame_request_will_send(m_frame, &request); 265 266 if (request.url != orig.url) { 267 coreRequest.setURL(KURL(KURL(), request.url)); 268 269 // Calling client might have changed our url pointer. 270 // Free the new allocated string. 271 free(const_cast<char*>(request.url)); 272 } 257 273 } 258 274 … … 263 279 } 264 280 265 void FrameLoaderClientEfl::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&) 266 { 267 notImplemented(); 281 void FrameLoaderClientEfl::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest& coreRequest) 282 { 283 CString url = coreRequest.url().prettyURL().utf8(); 284 DBG("Resource url=%s", url.data()); 285 286 Ewk_Frame_Resource_Request request = { 0, identifier }; 287 ewk_frame_request_assign_identifier(m_frame, &request); 268 288 } 269 289 … … 424 444 void FrameLoaderClientEfl::didPerformFirstNavigation() const 425 445 { 426 notImplemented();446 ewk_frame_did_perform_first_navigation(m_frame); 427 447 } 428 448 … … 459 479 } 460 480 461 void FrameLoaderClientEfl::saveViewStateToItem(HistoryItem* )462 { 463 notImplemented();481 void FrameLoaderClientEfl::saveViewStateToItem(HistoryItem* item) 482 { 483 ewk_frame_view_state_save(m_frame, item); 464 484 } 465 485 466 486 void FrameLoaderClientEfl::restoreViewState() 467 487 { 468 notImplemented(); 488 ASSERT(m_frame); 489 ASSERT(m_view); 490 491 ewk_view_restore_state(m_view, m_frame); 469 492 } 470 493 … … 545 568 void FrameLoaderClientEfl::dispatchDidChangeLocationWithinPage() 546 569 { 547 notImplemented(); 570 ewk_frame_uri_changed(m_frame); 571 572 if (ewk_view_frame_main_get(m_view) != m_frame) 573 return; 574 ewk_view_uri_changed(m_view); 548 575 } 549 576 … … 555 582 void FrameLoaderClientEfl::dispatchDidReceiveIcon() 556 583 { 584 /* report received favicon only for main frame. */ 585 if (ewk_view_frame_main_get(m_view) != m_frame) 586 return; 587 588 ewk_view_frame_main_icon_received(m_view); 557 589 } 558 590 559 591 void FrameLoaderClientEfl::dispatchDidStartProvisionalLoad() 560 592 { 593 ewk_frame_load_provisional(m_frame); 594 if (ewk_view_frame_main_get(m_view) == m_frame) 595 ewk_view_load_provisional(m_view); 561 596 } 562 597 … … 592 627 void FrameLoaderClientEfl::dispatchDidFinishDocumentLoad() 593 628 { 594 notImplemented();629 ewk_frame_load_document_finished(m_frame); 595 630 } 596 631 597 632 void FrameLoaderClientEfl::dispatchDidFirstLayout() 598 633 { 599 // emit m_frame->initialLayoutCompleted();600 634 m_initLayoutCompleted = true; 635 ewk_frame_load_firstlayout_finished(m_frame); 601 636 } 602 637 603 638 void FrameLoaderClientEfl::dispatchDidFirstVisuallyNonEmptyLayout() 604 639 { 605 notImplemented();640 ewk_frame_load_firstlayout_nonempty_finished(m_frame); 606 641 } 607 642 608 643 void FrameLoaderClientEfl::dispatchShow() 609 644 { 610 notImplemented();645 ewk_view_load_show(m_view); 611 646 } 612 647 -
trunk/WebKit/efl/ewk/ewk_frame.cpp
r62008 r62787 32 32 #include "FrameView.h" 33 33 #include "HTMLPlugInElement.h" 34 #include "HistoryItem.h" 34 35 #include "HitTestResult.h" 35 36 #include "KURL.h" … … 1634 1635 /** 1635 1636 * @internal 1637 * Reports a resource will be requested. User may override behavior of webkit by 1638 * changing values in @param request. 1639 * 1640 * @param o Frame. 1641 * @param request Request details that user may override. Whenever values on 1642 * this struct changes, it must be properly malloc'd as it will be freed 1643 * afterwards. 1644 * 1645 * Emits signal: "resource,request,willsend" 1646 */ 1647 void ewk_frame_request_will_send(Evas_Object *o, Ewk_Frame_Resource_Request *request) 1648 { 1649 evas_object_smart_callback_call(o, "resource,request,willsend", request); 1650 } 1651 1652 /** 1653 * @internal 1654 * Reports that there's a new resource. 1655 * 1656 * @param o Frame. 1657 * @param request New request details. No changes are allowed to fields. 1658 * 1659 * Emits signal: "resource,request,new" 1660 */ 1661 void ewk_frame_request_assign_identifier(Evas_Object *o, const Ewk_Frame_Resource_Request *request) 1662 { 1663 evas_object_smart_callback_call(o, "resource,request,new", (void *)request); 1664 } 1665 1666 /** 1667 * @internal 1668 * Reports that first navigation occurred 1669 * 1670 * @param o Frame. 1671 * 1672 * Emits signal: "navigation,first" 1673 */ 1674 void ewk_frame_did_perform_first_navigation(Evas_Object *o) 1675 { 1676 evas_object_smart_callback_call(o, "navigation,first", 0); 1677 } 1678 1679 /** 1680 * @internal 1681 * Reports frame will be saved to current state 1682 * 1683 * @param o Frame. 1684 * @param item History item to save details to. 1685 * 1686 * Emits signal: "state,save" 1687 */ 1688 void ewk_frame_view_state_save(Evas_Object *o, WebCore::HistoryItem* item) 1689 { 1690 const char *title = ewk_frame_title_get(o); 1691 const char *uri = ewk_frame_uri_get(o); 1692 1693 item->setTitle(WebCore::String::fromUTF8(title)); 1694 item->setURLString(WebCore::String::fromUTF8(uri)); 1695 1696 evas_object_smart_callback_call(o, "state,save", 0); 1697 } 1698 1699 /** 1700 * @internal 1636 1701 * Reports the frame started loading something. 1637 1702 * … … 1649 1714 if (main_frame == o) 1650 1715 ewk_view_frame_main_load_started(sd->view); 1716 } 1717 1718 /** 1719 * @internal 1720 * Reports the frame started provisional load. 1721 * 1722 * @param o Frame. 1723 * 1724 * Emits signal: "load,provisional" with no parameters. 1725 */ 1726 void ewk_frame_load_provisional(Evas_Object* o) 1727 { 1728 evas_object_smart_callback_call(o, "load,provisional", 0); 1729 } 1730 1731 /** 1732 * @internal 1733 * Reports the frame finished first layout. 1734 * 1735 * @param o Frame. 1736 * 1737 * Emits signal: "load,firstlayout,finished" with no parameters. 1738 */ 1739 void ewk_frame_load_firstlayout_finished(Evas_Object *o) 1740 { 1741 evas_object_smart_callback_call(o, "load,firstlayout,finished", 0); 1742 } 1743 1744 /** 1745 * @internal 1746 * Reports the frame finished first non empty layout. 1747 * 1748 * @param o Frame. 1749 * 1750 * Emits signal: "load,nonemptylayout,finished" with no parameters. 1751 */ 1752 void ewk_frame_load_firstlayout_nonempty_finished(Evas_Object *o) 1753 { 1754 evas_object_smart_callback_call(o, "load,nonemptylayout,finished", 0); 1755 } 1756 1757 /** 1758 * @internal 1759 * Reports the loading of a document has finished on frame. 1760 * 1761 * @param o Frame. 1762 * 1763 * Emits signal: "load,document,finished" with no parameters. 1764 */ 1765 void ewk_frame_load_document_finished(Evas_Object *o) 1766 { 1767 evas_object_smart_callback_call(o, "load,document,finished", 0); 1651 1768 } 1652 1769 -
trunk/WebKit/efl/ewk/ewk_frame.h
r55958 r62787 49 49 * - "title,changed", const char*: title of the main frame changed. 50 50 * - "uri,changed", const char*: uri of the main frame changed. 51 * - "load,document,finished", void: loading of a document has 52 * finished on this frame. 53 * - "load,nonemptylayout,finished", void: frame finished first 54 * non-empty layout. 51 55 * - "load,started", void: frame started loading. 52 56 * - "load,progress", double*: load progress changed (overall value … … 55 59 * finished and as argument @c NULL if successfully or pointer to 56 60 * structure defining the error. 61 * - "load,provisional", void: frame started provisional load. 62 * - "load,firstlayout,finished", void: frame finished first layout. 57 63 * - "load,error", const Ewk_Frame_Load_Error*: reports load failed 58 64 * and as argument a pointer to structure defining the error. 59 65 * - "contents,size,changed", Evas_Coord[2]: reports contents size 60 66 * changed due new layout, script actions or any other events. 67 * - "navigation,first", void: first navigation occurred. 68 * - "resource,request,new", Ewk_Frame_Resource_Request*: reports that 69 * there's a new resource request. 70 * - "resource,request,willsend", Ewk_Frame_Resource_Request*: a resource will 71 * be requested. 72 * - "state,save", void: frame's state will be saved as a history item. 61 73 */ 62 74 … … 80 92 const char *failing_url; /**< the url that failed to load */ 81 93 Evas_Object *frame; /**< frame where the failure happened */ 94 }; 95 96 /** 97 * Structure used to report resource requests 98 * 99 * Details given before a resource is loaded on a given frame. It's used by 100 * ewk_frame_request_will_send() to inform the details of a to-be-loaded 101 * resource, allowing them to be overridden. 102 */ 103 typedef struct _Ewk_Frame_Resource_Request Ewk_Frame_Resource_Request; 104 struct _Ewk_Frame_Resource_Request { 105 const char *url; /**< url of this resource */ 106 const unsigned long identifier; /**< resource's identifier. Can not be changed */ 82 107 }; 83 108 -
trunk/WebKit/efl/ewk/ewk_private.h
r62666 r62787 53 53 void ewk_view_uri_changed(Evas_Object *o); 54 54 void ewk_view_load_started(Evas_Object *o); 55 void ewk_view_load_provisional(Evas_Object *o); 55 56 void ewk_view_frame_main_load_started(Evas_Object *o); 57 void ewk_view_frame_main_cleared(Evas_Object *o); 58 void ewk_view_frame_main_icon_received(Evas_Object *o); 56 59 void ewk_view_load_finished(Evas_Object *o, const Ewk_Frame_Load_Error *error); 57 60 void ewk_view_load_error(Evas_Object *o, const Ewk_Frame_Load_Error *error); 58 61 void ewk_view_load_progress_changed(Evas_Object *o); 62 void ewk_view_load_show(Evas_Object* o); 63 void ewk_view_restore_state(Evas_Object *o, Evas_Object *frame); 59 64 Evas_Object *ewk_view_window_create(Evas_Object *o, Eina_Bool javascript, const WebCore::WindowFeatures* coreFeatures); 60 65 … … 119 124 120 125 void ewk_frame_load_started(Evas_Object *o); 126 void ewk_frame_load_provisional(Evas_Object *o); 127 void ewk_frame_load_firstlayout_finished(Evas_Object *o); 128 void ewk_frame_load_firstlayout_nonempty_finished(Evas_Object *o); 129 void ewk_frame_load_document_finished(Evas_Object *o); 121 130 void ewk_frame_load_finished(Evas_Object *o, const char *error_domain, int error_code, Eina_Bool is_cancellation, const char *error_description, const char *failing_url); 122 131 void ewk_frame_load_error(Evas_Object *o, const char *error_domain, int error_code, Eina_Bool is_cancellation, const char *error_description, const char *failing_url); 123 132 void ewk_frame_load_progress_changed(Evas_Object *o); 133 134 void ewk_frame_request_will_send(Evas_Object *o, Ewk_Frame_Resource_Request *request); 135 void ewk_frame_request_assign_identifier(Evas_Object *o, const Ewk_Frame_Resource_Request *request); 136 void ewk_frame_view_state_save(Evas_Object *o, WebCore::HistoryItem* item); 137 138 void ewk_frame_did_perform_first_navigation(Evas_Object *o); 124 139 125 140 void ewk_frame_contents_size_changed(Evas_Object *o, Evas_Coord w, Evas_Coord h);
Note: See TracChangeset
for help on using the changeset viewer.