Changeset 61706 in webkit


Ignore:
Timestamp:
Jun 23, 2010 12:39:54 PM (14 years ago)
Author:
leandro@webkit.org
Message:

2010-06-23 Lucas De Marchi <lucas.demarchi@profusion.mobi>

Reviewed by Gustavo Noronha Silva.

Add implementaion of new windows for EFL port. Both cases of a link
with target="_blank" and a javascript that does window.open() are
treated, delegating to browser the role of actually creating the
window (or blocking it).
https://bugs.webkit.org/show_bug.cgi?id=40930

  • CMakeListsEfl.txt: add new file that wraps the WindowFeatures struct
  • efl/WebCoreSupport/ChromeClientEfl.cpp: (WebCore::ChromeClientEfl::createWindow): implement method for creating new window by delegating to browser its creation. Browser might decide to continue on the same window by returning the same view object.
  • efl/WebCoreSupport/FrameLoaderClientEfl.cpp: (WebCore::FrameLoaderClientEfl::dispatchCreatePage): implement method for creating new window when its creation is done by a javascript script.
  • efl/ewk/EWebKit.h: new header for WindowFeatures.
  • efl/ewk/ewk_private.h:
  • efl/ewk/ewk_view.cpp: (ewk_view_window_create): call the method implemented by browser.
  • efl/ewk/ewk_view.h:
  • efl/ewk/ewk_window_features.cpp: Added. (ewk_window_features_unref): (ewk_window_features_ref): (ewk_window_features_bool_property_get): (ewk_window_features_int_property_get): (ewk_window_features_new_from_core): create and wrapped struct containing the core struct.
  • efl/ewk/ewk_window_features.h: Added.
Location:
trunk/WebKit
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/CMakeListsEfl.txt

    r60454 r61706  
    4040    efl/ewk/ewk_view.cpp
    4141    efl/ewk/ewk_view_single.c
     42    efl/ewk/ewk_window_features.cpp
    4243)
    4344
  • trunk/WebKit/ChangeLog

    r61456 r61706  
     12010-06-23  Lucas De Marchi  <lucas.demarchi@profusion.mobi>
     2
     3        Reviewed by Gustavo Noronha Silva.
     4
     5        Add implementaion of new windows for EFL port. Both cases of a link
     6        with target="_blank" and a javascript that does window.open() are
     7        treated, delegating to browser the role of actually creating the
     8        window (or blocking it).
     9        https://bugs.webkit.org/show_bug.cgi?id=40930
     10
     11        * CMakeListsEfl.txt: add new file that wraps the WindowFeatures struct
     12        * efl/WebCoreSupport/ChromeClientEfl.cpp:
     13        (WebCore::ChromeClientEfl::createWindow): implement method for
     14        creating new window by delegating to browser its creation. Browser
     15        might decide to continue on the same window by returning the same
     16        view object.
     17        * efl/WebCoreSupport/FrameLoaderClientEfl.cpp:
     18        (WebCore::FrameLoaderClientEfl::dispatchCreatePage): implement method
     19        for creating new window when its creation is done by a javascript
     20        script.
     21        * efl/ewk/EWebKit.h: new header for WindowFeatures.
     22        * efl/ewk/ewk_private.h:
     23        * efl/ewk/ewk_view.cpp:
     24        (ewk_view_window_create): call the method implemented by browser.
     25        * efl/ewk/ewk_view.h:
     26        * efl/ewk/ewk_window_features.cpp: Added.
     27        (ewk_window_features_unref):
     28        (ewk_window_features_ref):
     29        (ewk_window_features_bool_property_get):
     30        (ewk_window_features_int_property_get):
     31        (ewk_window_features_new_from_core): create and wrapped struct
     32        containing the core struct.
     33        * efl/ewk/ewk_window_features.h: Added.
     34
    1352010-06-18  Anders Carlsson  <andersca@apple.com>
    236
  • trunk/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp

    r61331 r61706  
    118118}
    119119
    120 Page* ChromeClientEfl::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features)
    121 {
    122     notImplemented();
    123     return 0;
     120Page* ChromeClientEfl::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features)
     121{
     122    Evas_Object* newView = ewk_view_window_create(m_view, EINA_TRUE, &features);
     123    if (!newView)
     124        return 0;
     125
     126    if (!frameLoadRequest.isEmpty())
     127        ewk_view_uri_set(newView, frameLoadRequest.resourceRequest().url().string().utf8().data());
     128
     129    return ewk_view_core_page_get(newView);
    124130}
    125131
  • trunk/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp

    r58106 r61706  
    817817Frame* FrameLoaderClientEfl::dispatchCreatePage()
    818818{
    819     notImplemented();
    820     return 0;
     819    if (!m_view)
     820        return 0;
     821
     822    Evas_Object* newView = ewk_view_window_create(m_view, EINA_FALSE, 0);
     823    Evas_Object* mainFrame;
     824    if (!newView)
     825        mainFrame = m_frame;
     826    else
     827        mainFrame = ewk_view_frame_main_get(newView);
     828
     829    return ewk_frame_core_get(mainFrame);
    821830}
    822831
  • trunk/WebKit/efl/ewk/EWebKit.h

    r60454 r61706  
    3030#include "ewk_settings.h"
    3131#include "ewk_view.h"
     32#include "ewk_window_features.h"
    3233
    3334#include <Evas.h>
  • trunk/WebKit/efl/ewk/ewk_private.h

    r60454 r61706  
    5757void             ewk_view_load_error(Evas_Object *o, const Ewk_Frame_Load_Error *error);
    5858void             ewk_view_load_progress_changed(Evas_Object *o);
     59Evas_Object     *ewk_view_window_create(Evas_Object *o, Eina_Bool javascript, const WebCore::WindowFeatures* coreFeatures);
    5960
    6061void             ewk_view_mouse_link_hover_in(Evas_Object *o, void *data);
     
    103104void              ewk_context_menu_show(Ewk_Context_Menu *o);
    104105
     106Ewk_Window_Features *ewk_window_features_new_from_core(const WebCore::WindowFeatures* core);
     107
    105108Evas_Object      *ewk_frame_add(Evas *e);
    106109Eina_Bool         ewk_frame_init(Evas_Object *o, Evas_Object *view, WebCore::Frame *frame);
  • trunk/WebKit/efl/ewk/ewk_view.cpp

    r60454 r61706  
    31513151 * @internal
    31523152 * Delegates to browser the creation of a new window. If it is not implemented,
    3153  * current view is returned, so navigation might continue in same window.
     3153 * current view is returned, so navigation might continue in same window. If
     3154 * browser supports the creation of new windows, a new Ewk_Window_Features is
     3155 * created and passed to browser. If it intends to keep the request for opening
     3156 * the window later it must increments the Ewk_Winwdow_Features ref count by
     3157 * calling ewk_window_features_ref(window_features). Otherwise this struct will
     3158 * be freed after returning to this function.
    31543159 *
    31553160 * @param o Current view.
     3161 * @param javascript @c EINA_TRUE if the new window is originated from javascript,
     3162 * @c EINA_FALSE otherwise
     3163 * @param window_features Features of the new window being created. If it's @c
     3164 * NULL, it will be created a window with default features.
    31563165 *
    31573166 * @return New view, in case smart class implements the creation of new windows;
    31583167 * else, current view @param o.
    3159  */
    3160 Evas_Object* ewk_view_window_create(Evas_Object* o)
     3168 *
     3169 * @see ewk_window_features_ref().
     3170 */
     3171Evas_Object* ewk_view_window_create(Evas_Object* o, Eina_Bool javascript, const WebCore::WindowFeatures* coreFeatures)
    31613172{
    31623173    EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
     
    31653176        return o;
    31663177
    3167     return sd->api->window_create(sd);
     3178    Ewk_Window_Features* window_features = ewk_window_features_new_from_core(coreFeatures);
     3179    Evas_Object* view = sd->api->window_create(sd, javascript, window_features);
     3180    ewk_window_features_unref(window_features);
     3181
     3182    return view;
    31683183}
    31693184
  • trunk/WebKit/efl/ewk/ewk_view.h

    r60454 r61706  
    2222#define ewk_view_h
    2323
     24#include "ewk_history.h"
     25#include "ewk_window_features.h"
     26
    2427#include <Evas.h>
    2528#include <cairo.h>
    26 #include <ewk_history.h>
    2729
    2830#ifdef __cplusplus
     
    9698    unsigned long version;
    9799
    98     Evas_Object *(*window_create)(Ewk_View_Smart_Data *sd); /**< creates a new window, requested by webkit */
     100    Evas_Object *(*window_create)(Ewk_View_Smart_Data *sd, Eina_Bool javascript, const Ewk_Window_Features *window_features); /**< creates a new window, requested by webkit */
    99101    // hooks to allow different backing stores
    100102    Evas_Object *(*backing_store_add)(Ewk_View_Smart_Data *sd); /**< must be defined */
Note: See TracChangeset for help on using the changeset viewer.