⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 120427 in webkit


Ignore:
Timestamp:
Jun 15, 2012, 2:20:26 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL][WK2] Implement reload / stop in Ewk_View
https://bugs.webkit.org/show_bug.cgi?id=89168

Patch by Christophe Dumez <Christophe Dumez> on 2012-06-15
Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2:

Add API on the Ewk_View to reload the main frame
and to stop the current load.

  • UIProcess/API/efl/ewk_view.cpp:

(ewk_view_reload):
(ewk_view_stop):

  • UIProcess/API/efl/ewk_view.h:

Tools:

Implement view reload / stop loading in MiniBrowser.
Use 'F5' for reload and 'F6' for stopping the load.

  • MiniBrowser/efl/main.c:

(on_key_down):
(browserCreate):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r120397 r120427  
     12012-06-15  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [EFL][WK2] Implement reload / stop in Ewk_View
     4        https://bugs.webkit.org/show_bug.cgi?id=89168
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Add API on the Ewk_View to reload the main frame
     9        and to stop the current load.
     10
     11        * UIProcess/API/efl/ewk_view.cpp:
     12        (ewk_view_reload):
     13        (ewk_view_stop):
     14        * UIProcess/API/efl/ewk_view.h:
     15
    1162012-06-14  Kent Tamura  <tkent@chromium.org>
    217
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp

    r119928 r120427  
    11/*
    22   Copyright (C) 2011 Samsung Electronics
     3   Copyright (C) 2012 Intel Corporation. All rights reserved.
    34
    45    This library is free software; you can redistribute it and/or
     
    524525}
    525526
     527Eina_Bool ewk_view_reload(Evas_Object* ewkView)
     528{
     529    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
     530    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
     531
     532    WKPageReload(toAPI(priv->pageClient->page()));
     533    return true;
     534}
     535
     536Eina_Bool ewk_view_stop(Evas_Object* ewkView)
     537{
     538    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
     539    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
     540
     541    WKPageStopLoading(toAPI(priv->pageClient->page()));
     542    return true;
     543}
     544
    526545void ewk_view_display(Evas_Object* ewkView, const IntRect& rect)
    527546{
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h

    r119928 r120427  
    11/*
    22   Copyright (C) 2011 Samsung Electronics
     3   Copyright (C) 2012 Intel Corporation. All rights reserved.
    34
    45    This library is free software; you can redistribute it and/or
     
    165166EAPI const char *ewk_view_uri_get(const Evas_Object *o);
    166167
     168/**
     169 * Asks the main frame to reload the current document.
     170 *
     171 * @param o view object to reload current document
     172 *
     173 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
     174 *
     175 * @see ewk_view_reload_full()
     176 */
     177EAPI Eina_Bool    ewk_view_reload(Evas_Object *o);
     178
     179/**
     180 * Asks the main frame to stop loading.
     181 *
     182 * @param o view object to stop loading
     183 *
     184 * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
     185 */
     186EAPI Eina_Bool    ewk_view_stop(Evas_Object *o);
     187
    167188#ifdef __cplusplus
    168189}
  • trunk/Tools/ChangeLog

    r120423 r120427  
     12012-06-15  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [EFL][WK2] Implement reload / stop in Ewk_View
     4        https://bugs.webkit.org/show_bug.cgi?id=89168
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Implement view reload / stop loading in MiniBrowser.
     9        Use 'F5' for reload and 'F6' for stopping the load.
     10
     11        * MiniBrowser/efl/main.c:
     12        (on_key_down):
     13        (browserCreate):
     14
    1152012-06-15  Hironori Bono  <hbono@chromium.org>
    216
  • trunk/Tools/MiniBrowser/efl/main.c

    r120130 r120427  
    11/*
    22 * Copyright (C) 2012 Samsung Electronics
     3 * Copyright (C) 2012 Intel Corporation. All rights reserved.
    34 *
    45 *  This library is free software; you can redistribute it and/or
     
    2627static const int DEFAULT_HEIGHT = 600;
    2728static const char DEFAULT_URL[] = "http://www.google.com/";
     29
     30#define info(format, args...)       \
     31    do {                            \
     32        if (verbose)                \
     33            printf(format, ##args); \
     34    } while (0)
     35
     36static int verbose = 0;
    2837
    2938typedef struct _MiniBrowser {
     
    5766}
    5867
     68static void
     69on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
     70{
     71    Evas_Event_Key_Down *ev = (Evas_Event_Key_Down*) event_info;
     72    if (!strcmp(ev->key, "F5")) {
     73            info("Reload (F5) was pressed, reloading.\n");
     74            ewk_view_reload(obj);
     75    } else if (!strcmp(ev->key, "F6")) {
     76            info("Stop (F6) was pressed, stop loading.\n");
     77            ewk_view_stop(obj);
     78    }
     79}
     80
    5981static MiniBrowser *browserCreate(const char *url)
    6082{
     
    82104    app->browser = ewk_view_add(app->evas);
    83105    evas_object_name_set(app->browser, "browser");
     106
     107    evas_object_event_callback_add(app->browser, EVAS_CALLBACK_KEY_DOWN, on_key_down, app);
     108
    84109    evas_object_size_hint_weight_set(app->browser, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    85 
    86110    evas_object_resize(app->browser, DEFAULT_WIDTH, DEFAULT_HEIGHT);
    87111    evas_object_show(app->browser);
Note: See TracChangeset for help on using the changeset viewer.