Changeset 102600 in webkit


Ignore:
Timestamp:
Dec 12, 2011 10:18:34 AM (12 years ago)
Author:
kubo@profusion.mobi
Message:

[EFL] Add API to notify that mixed content has been loaded.
https://bugs.webkit.org/show_bug.cgi?id=74301

Reviewed by Gustavo Noronha Silva.

When mixed content is displayed/run, both frames and views
emit the proper signals to notify API users.

  • WebCoreSupport/FrameLoaderClientEfl.cpp:

(WebCore::FrameLoaderClientEfl::didDisplayInsecureContent):
(WebCore::FrameLoaderClientEfl::didRunInsecureContent):

  • ewk/ewk_frame.cpp:

(ewk_frame_view_create_for_view):
(ewk_frame_mixed_content_displayed_get):
(ewk_frame_mixed_content_run_get):
(ewk_frame_mixed_content_displayed_set):
(ewk_frame_mixed_content_run_set):

  • ewk/ewk_frame.h:
  • ewk/ewk_private.h:
  • ewk/ewk_view.cpp:

(ewk_view_frame_main_cleared):
(ewk_view_mixed_content_displayed_get):
(ewk_view_mixed_content_run_get):
(ewk_view_mixed_content_displayed_set):
(ewk_view_mixed_content_run_set):

  • ewk/ewk_view.h:
Location:
trunk/Source/WebKit/efl
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/efl/ChangeLog

    r102599 r102600  
     12011-12-12  Raphael Kubo da Costa  <kubo@profusion.mobi>
     2
     3        [EFL] Add API to notify that mixed content has been loaded.
     4        https://bugs.webkit.org/show_bug.cgi?id=74301
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        When mixed content is displayed/run, both frames and views
     9        emit the proper signals to notify API users.
     10
     11        * WebCoreSupport/FrameLoaderClientEfl.cpp:
     12        (WebCore::FrameLoaderClientEfl::didDisplayInsecureContent):
     13        (WebCore::FrameLoaderClientEfl::didRunInsecureContent):
     14        * ewk/ewk_frame.cpp:
     15        (ewk_frame_view_create_for_view):
     16        (ewk_frame_mixed_content_displayed_get):
     17        (ewk_frame_mixed_content_run_get):
     18        (ewk_frame_mixed_content_displayed_set):
     19        (ewk_frame_mixed_content_run_set):
     20        * ewk/ewk_frame.h:
     21        * ewk/ewk_private.h:
     22        * ewk/ewk_view.cpp:
     23        (ewk_view_frame_main_cleared):
     24        (ewk_view_mixed_content_displayed_get):
     25        (ewk_view_mixed_content_run_get):
     26        (ewk_view_mixed_content_displayed_set):
     27        (ewk_view_mixed_content_run_set):
     28        * ewk/ewk_view.h:
     29
    1302011-12-12  Raphael Kubo da Costa  <kubo@profusion.mobi>
    231
  • trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp

    r102159 r102600  
    503503void FrameLoaderClientEfl::didDisplayInsecureContent()
    504504{
    505     notImplemented();
     505    ewk_frame_mixed_content_displayed_set(m_frame, true);
    506506}
    507507
    508508void FrameLoaderClientEfl::didRunInsecureContent(SecurityOrigin*, const KURL&)
    509509{
    510     notImplemented();
     510    ewk_frame_mixed_content_run_set(m_frame, true);
    511511}
    512512
  • trunk/Source/WebKit/efl/ewk/ewk_frame.cpp

    r102297 r102600  
    7171    const char* name;
    7272    bool editable : 1;
     73    bool hasDisplayedMixedContent : 1;
     74    bool hasRunMixedContent : 1;
    7375};
    7476
     
    14521454    smartData->frame->view()->setEdjeTheme(theme);
    14531455    smartData->frame->view()->setEvasObject(ewkFrame);
     1456
     1457    ewk_frame_mixed_content_displayed_set(ewkFrame, false);
     1458    ewk_frame_mixed_content_run_set(ewkFrame, false);
    14541459}
    14551460
     
    15641569}
    15651570
     1571Eina_Bool ewk_frame_mixed_content_displayed_get(const Evas_Object* ewkFrame)
     1572{
     1573    EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, false);
     1574    return smartData->hasDisplayedMixedContent;
     1575}
     1576
     1577Eina_Bool ewk_frame_mixed_content_run_get(const Evas_Object* ewkFrame)
     1578{
     1579    EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData, false);
     1580    return smartData->hasRunMixedContent;
     1581}
     1582
    15661583/**
    15671584 * @internal
     
    16421659}
    16431660
     1661/**
     1662 * @internal
     1663 * Defines whether the frame has displayed mixed content.
     1664 *
     1665 * When a frame has displayed mixed content, the currently loaded URI is secure (HTTPS) but it has
     1666 * loaded and displayed a resource, such as an image, from an insecure (HTTP) source.
     1667 *
     1668 * @param hasDisplayed Do or do not clear the flag from the frame. If @c true, the container view
     1669 *                     is also notified and it then emits the "mixedcontent,displayed" signal.
     1670 *
     1671 * Emits signal: "mixedcontent,displayed" with no parameters when @p hasDisplayed is @c true.
     1672 */
     1673void ewk_frame_mixed_content_displayed_set(Evas_Object* ewkFrame, bool hasDisplayed)
     1674{
     1675    EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData);
     1676    smartData->hasDisplayedMixedContent = hasDisplayed;
     1677
     1678    if (hasDisplayed) {
     1679        ewk_view_mixed_content_displayed_set(smartData->view, true);
     1680        evas_object_smart_callback_call(ewkFrame, "mixedcontent,displayed", 0);
     1681    }
     1682}
     1683
     1684/**
     1685 * @internal
     1686 * Defines whether the frame has run mixed content.
     1687 *
     1688 * When a frame has run mixed content, the currently loaded URI is secure (HTTPS) but it has
     1689 * loaded and run a resource, such as a script, from an insecure (HTTP) source.
     1690 *
     1691 * @param hasDisplayed Do or do not clear the flag from the frame. If @c true, the container view
     1692 *                     is also notified and it then emits the "mixedcontent,run" signal.
     1693 *
     1694 * Emits signal: "mixedcontent,run" with no parameters when @p hasRun is @c true.
     1695 */
     1696void ewk_frame_mixed_content_run_set(Evas_Object* ewkFrame, bool hasRun)
     1697{
     1698    EWK_FRAME_SD_GET_OR_RETURN(ewkFrame, smartData);
     1699    smartData->hasRunMixedContent = hasRun;
     1700
     1701    if (hasRun) {
     1702        ewk_view_mixed_content_run_set(smartData->view, true);
     1703        evas_object_smart_callback_call(ewkFrame, "mixedcontent,run", 0);
     1704    }
     1705}
     1706
    16441707namespace EWKPrivate {
    16451708
  • trunk/Source/WebKit/efl/ewk/ewk_frame.h

    r102297 r102600  
    5353 *  - "load,provisional", void: frame started provisional load.
    5454 *  - "load,started", void: frame started loading the document.
     55 *  - "mixedcontent,displayed", void: frame has loaded and displayed mixed content.
     56 *  - "mixedcontent,run", void: frame has loaded and run mixed content.
    5557 *  - "navigation,first", void: first navigation was occurred.
    5658 *  - "resource,request,new", Ewk_Frame_Resource_Request*: reports that
     
    843845EAPI char* ewk_frame_plain_text_get(const Evas_Object* o);
    844846
     847/**
     848 * Returns whether the frame has displayed mixed content.
     849 *
     850 * When a frame has displayed mixed content, its current URI is an HTTPS one, but it has
     851 * loaded and displayed a resource (such as an image) from an insecure (non-HTTPS) URI.
     852 * Both the frame and the container view send a "mixedcontent,displayed" signal in this case.
     853 *
     854 * The status is reset only when a load event occurs (eg. the page is reloaded or a new page is loaded).
     855 *
     856 * @param o The frame to query.
     857 *
     858 * @sa ewk_view_mixed_content_displayed_get
     859 */
     860EAPI Eina_Bool ewk_frame_mixed_content_displayed_get(const Evas_Object *o);
     861
     862/**
     863 * Returns whether the frame has run mixed content.
     864 *
     865 * When a frame has run mixed content, its current URI is an HTTPS one, but it has
     866 * loaded and run a resource (such as an image) from an insecure (non-HTTPS) URI.
     867 * Both the frame and the container view send a "mixedcontent,run" signal in this case.
     868 *
     869 * The status is reset only when a load event occurs (eg. the page is reloaded or a new page is loaded).
     870 *
     871 * @param o The frame to query.
     872 *
     873 * @sa ewk_view_mixed_content_run_get
     874 */
     875EAPI Eina_Bool ewk_frame_mixed_content_run_get(const Evas_Object *o);
     876
    845877#ifdef __cplusplus
    846878}
  • trunk/Source/WebKit/efl/ewk/ewk_private.h

    r101744 r102600  
    223223void ewk_frame_editor_client_selection_changed(Evas_Object* o);
    224224
     225void ewk_frame_mixed_content_displayed_set(Evas_Object* ewkFrame, bool hasDisplayed);
     226void ewk_frame_mixed_content_run_set(Evas_Object* ewkFrame, bool hasRun);
     227void ewk_view_mixed_content_displayed_set(Evas_Object* ewkView, bool hasDisplayed);
     228void ewk_view_mixed_content_run_set(Evas_Object* ewkView, bool hasRun);
     229
    225230#ifdef __cplusplus
    226231
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r102297 r102600  
    149149        bool viewCleared : 1;
    150150        bool needTouchEvents : 1;
     151        bool hasDisplayedMixedContent : 1;
     152        bool hasRunMixedContent : 1;
    151153    } flags;
    152154    struct {
     
    28482850    EINA_SAFETY_ON_NULL_RETURN(smartData->api->flush);
    28492851    smartData->api->flush(smartData);
     2852
     2853    ewk_view_mixed_content_displayed_set(ewkView, false);
     2854    ewk_view_mixed_content_run_set(ewkView, false);
    28502855}
    28512856
     
    37683773}
    37693774
     3775Eina_Bool ewk_view_mixed_content_displayed_get(const Evas_Object* ewkView)
     3776{
     3777    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
     3778    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
     3779    return priv->flags.hasDisplayedMixedContent;
     3780}
     3781
     3782Eina_Bool ewk_view_mixed_content_run_get(const Evas_Object* ewkView)
     3783{
     3784    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
     3785    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
     3786    return priv->flags.hasRunMixedContent;
     3787}
     3788
    37703789/**
    37713790 * @internal
     
    37923811{
    37933812    evas_object_smart_callback_call(ewkView, "editorclient,contents,changed", 0);
     3813}
     3814
     3815/**
     3816 * @internal
     3817 * Defines whether the view has displayed mixed content.
     3818 *
     3819 * When a view has displayed mixed content, any of its frames has loaded an HTTPS URI
     3820 * which has itself loaded and displayed a resource (such as an image) from an insecure,
     3821 * that is, non-HTTPS, URI.
     3822 *
     3823 * @param hasDisplayed Do or do not clear the flag from the view.
     3824 *
     3825 * Emits signal: "mixedcontent,displayed" with no parameters when @p hasDisplayed is @c true.
     3826 */
     3827void ewk_view_mixed_content_displayed_set(Evas_Object* ewkView, bool hasDisplayed)
     3828{
     3829    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
     3830    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
     3831
     3832    priv->flags.hasDisplayedMixedContent = hasDisplayed;
     3833
     3834    if (hasDisplayed)
     3835        evas_object_smart_callback_call(ewkView, "mixedcontent,displayed", 0);
     3836}
     3837
     3838/**
     3839 * @internal
     3840 * Defines whether the view has run mixed content.
     3841 *
     3842 * When a view has run mixed content, any of its frames has loaded an HTTPS URI
     3843 * which has itself loaded and run a resource (such as a script) from an insecure,
     3844 * that is, non-HTTPS, URI.
     3845 *
     3846 * @param hasRun Do or do not clear the flag from the view.
     3847 *
     3848 * Emits signal: "mixedcontent,run" with no parameters when @p hasRun is @c true.
     3849 */
     3850void ewk_view_mixed_content_run_set(Evas_Object* ewkView, bool hasRun)
     3851{
     3852    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
     3853    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
     3854
     3855    priv->flags.hasRunMixedContent = hasRun;
     3856
     3857    if (hasRun)
     3858        evas_object_smart_callback_call(ewkView, "mixedcontent,run", 0);
    37943859}
    37953860
  • trunk/Source/WebKit/efl/ewk/ewk_view.h

    r102297 r102600  
    5959 *    visible; @c EINA_FALSE, otherwise.
    6060 *  - "menubar,visible,set", Eina_Bool: sets menubar visibility.
     61 *  - "mixedcontent,displayed", void: any of the containing frames has loaded and displayed mixed content.
     62 *  - "mixedcontent,run", void: any of the containing frames has loaded and run mixed content.
    6163 *  - "ready", void: page is fully loaded.
    6264 *  - "scrollbars,visible,get", Eina_Bool *: expects a @c EINA_TRUE if scrollbars
     
    22782280EAPI Ewk_Page_Visibility_State ewk_view_visibility_state_get(const Evas_Object *o);
    22792281
     2282/**
     2283 * Returns whether the view has displayed mixed content.
     2284 *
     2285 * When a view has displayed mixed content, any of its frames has loaded an HTTPS URI
     2286 * which has itself loaded and displayed a resource (such as an image) from an insecure,
     2287 * that is, non-HTTPS, URI.
     2288 *
     2289 * The status is reset only when a load event occurs (eg. the page is reloaded or a new page is loaded).
     2290 *
     2291 * When one of the containing frames displays mixed content, the view emits the "mixedcontent,displayed" signal.
     2292 *
     2293 * @param o The view to query.
     2294 *
     2295 * @sa ewk_frame_mixed_content_displayed_get
     2296 */
     2297EAPI Eina_Bool ewk_view_mixed_content_displayed_get(const Evas_Object *o);
     2298
     2299/**
     2300 * Returns whether the view has run mixed content.
     2301 *
     2302 * When a view has run mixed content, any of its frames has loaded an HTTPS URI
     2303 * which has itself loaded and run a resource (such as an image) from an insecure,
     2304 * that is, non-HTTPS, URI.
     2305 *
     2306 * The status is reset only when a load event occurs (eg. the page is reloaded or a new page is loaded).
     2307 *
     2308 * When one of the containing frames runs mixed content, the view emits the "mixedcontent,run" signal.
     2309 *
     2310 * @param o The view to query.
     2311 *
     2312 * @sa ewk_frame_mixed_content_run_get
     2313 */
     2314EAPI Eina_Bool ewk_view_mixed_content_run_get(const Evas_Object *o);
     2315
    22802316#ifdef __cplusplus
    22812317}
Note: See TracChangeset for help on using the changeset viewer.