Changeset 95983 in webkit


Ignore:
Timestamp:
Sep 26, 2011 12:58:24 PM (13 years ago)
Author:
demarchi@webkit.org
Message:

[EFL] Add virtual method to notify user when wrapping focus
https://bugs.webkit.org/show_bug.cgi?id=68699

Reviewed by Antonio Gomes.

Add a virtual method to ewk_view, so the Chrome gets notified if we
finished focusing all the items and would start over. This way the
browser can decide to handle the subsequent focus changes among its
widgets.

  • WebCoreSupport/ChromeClientEfl.cpp: call ewk_view's virtual method to

give it a chance to grab focus
(WebCore::ChromeClientEfl::canTakeFocus):

  • ewk/ewk_private.h:
  • ewk/ewk_view.cpp: add virtual method

(ewk_view_focus_can_cycle):

  • ewk/ewk_view.h: add focus direction enum and virtual method
Location:
trunk/Source/WebKit/efl
Files:
5 edited

Legend:

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

    r95919 r95983  
     12011-09-26  Lucas De Marchi  <lucas.demarchi@profusion.mobi>
     2
     3        [EFL] Add virtual method to notify user when wrapping focus
     4        https://bugs.webkit.org/show_bug.cgi?id=68699
     5
     6        Reviewed by Antonio Gomes.
     7
     8        Add a virtual method to ewk_view, so the Chrome gets notified if we
     9        finished focusing all the items and would start over. This way the
     10        browser can decide to handle the subsequent focus changes among its
     11        widgets.
     12
     13        * WebCoreSupport/ChromeClientEfl.cpp: call ewk_view's virtual method to
     14        give it a chance to grab focus
     15        (WebCore::ChromeClientEfl::canTakeFocus):
     16        * ewk/ewk_private.h:
     17        * ewk/ewk_view.cpp: add virtual method
     18        (ewk_view_focus_can_cycle):
     19        * ewk/ewk_view.h: add focus direction enum and virtual method
     20
    1212011-09-24  Adam Barth  <abarth@webkit.org>
    222
  • trunk/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp

    r95919 r95983  
    237237}
    238238
    239 bool ChromeClientEfl::canTakeFocus(FocusDirection)
     239bool ChromeClientEfl::canTakeFocus(FocusDirection coreDirection)
    240240{
    241241    // This is called when cycling through links/focusable objects and we
    242242    // reach the last focusable object.
    243     return false;
     243    ASSERT(coreDirection == FocusDirectionForward || coreDirection == FocusDirectionBackward);
     244
     245    Ewk_Focus_Direction direction = static_cast<Ewk_Focus_Direction>(coreDirection);
     246
     247    return !ewk_view_focus_can_cycle(m_view, direction);
    244248}
    245249
  • trunk/Source/WebKit/efl/ewk/ewk_private.h

    r95901 r95983  
    140140void ewk_view_editor_client_selection_changed(Evas_Object* o);
    141141
     142bool ewk_view_focus_can_cycle(Evas_Object *o, Ewk_Focus_Direction direction);
     143
    142144#if ENABLE(NETSCAPE_PLUGIN_API)
    143145void ewk_view_js_window_object_clear(Evas_Object* o, Evas_Object* frame);
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r95901 r95983  
    31083108}
    31093109
     3110bool ewk_view_focus_can_cycle(Evas_Object* o, Ewk_Focus_Direction direction)
     3111{
     3112    DBG("o=%p direction=%d", o, direction);
     3113    EWK_VIEW_SD_GET_OR_RETURN(o, sd, false);
     3114    EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, false);
     3115
     3116    if (!sd->api->focus_can_cycle)
     3117        return false;
     3118
     3119    return sd->api->focus_can_cycle(sd, direction);
     3120}
     3121
    31103122void ewk_view_run_javascript_alert(Evas_Object* o, Evas_Object* frame, const char* message)
    31113123{
  • trunk/Source/WebKit/efl/ewk/ewk_view.h

    r95901 r95983  
    105105/// Creates a type name for @a _Ewk_View_Smart_Class.
    106106typedef struct _Ewk_View_Smart_Class Ewk_View_Smart_Class;
     107
     108// Defines the direction of focus change. Keep in sync with
     109// WebCore::FocusDirection.
     110enum _Ewk_Focus_Direction {
     111    EWK_FOCUS_DIRECTION_FORWARD = 1,
     112    EWK_FOCUS_DIRECTION_BACKWARD,
     113};
     114typedef enum _Ewk_Focus_Direction Ewk_Focus_Direction;
     115
    107116/// Ewk view's class, to be overridden by sub-classes.
    108117struct _Ewk_View_Smart_Class {
     
    150159
    151160    Eina_Bool (*navigation_policy_decision)(Ewk_View_Smart_Data *sd, Ewk_Frame_Resource_Request *request);
     161    Eina_Bool (*focus_can_cycle)(Ewk_View_Smart_Data *sd, Ewk_Focus_Direction direction);
    152162};
    153163
     
    156166 * in the @a Ewk_View_Smart_Class structure.
    157167 */
    158 #define EWK_VIEW_SMART_CLASS_VERSION 1UL
     168#define EWK_VIEW_SMART_CLASS_VERSION 2UL
    159169
    160170/**
     
    168178 * @see EWK_VIEW_SMART_CLASS_INIT_NAME_VERSION
    169179 */
    170 #define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
     180#define EWK_VIEW_SMART_CLASS_INIT(smart_class_init) {smart_class_init, EWK_VIEW_SMART_CLASS_VERSION, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
    171181
    172182/**
Note: See TracChangeset for help on using the changeset viewer.