Skip to content
Permalink
Browse files
2011-06-27 Jongseok Yang <js45.yang@samsung.com>
        Reviewed by Kent Tamura.

        [EFL] Use accept attribute when executing the file picker for input element
        https://bugs.webkit.org/show_bug.cgi?id=63063

        This patch:
        - remove the argument "suggested_filenames" from ewk_view_run_open_panel
        - add the argument "accept" to ewk_view_run_open_panel
        - get the accept attribute and pass to ewk_view_run_open_panel within runOpenPanel

        * WebCoreSupport/ChromeClientEfl.cpp:
        (WebCore::ChromeClientEfl::runOpenPanel):
        * ewk/ewk_view.cpp:
        (ewk_view_run_open_panel):
        * ewk/ewk_view.h

Canonical link: https://commits.webkit.org/79108@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89812 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Jun 27, 2011
1 parent 3f906f9 commit 6e0c97aefbfa4d19f9aa2b7d2043c9d884d30f16
Showing 5 changed files with 25 additions and 16 deletions.
@@ -1,3 +1,21 @@
2011-06-27 Jongseok Yang <js45.yang@samsung.com>

Reviewed by Kent Tamura.

[EFL] Use accept attribute when executing the file picker for input element
https://bugs.webkit.org/show_bug.cgi?id=63063

This patch:
- remove the argument "suggested_filenames" from ewk_view_run_open_panel
- add the argument "accept" to ewk_view_run_open_panel
- get the accept attribute and pass to ewk_view_run_open_panel within runOpenPanel

* WebCoreSupport/ChromeClientEfl.cpp:
(WebCore::ChromeClientEfl::runOpenPanel):
* ewk/ewk_view.cpp:
(ewk_view_run_open_panel):
* ewk/ewk_view.h

2011-06-27 Gyuyoung Kim <gyuyoung.kim@samsung.com>

Unreviewed. Fix style error.
@@ -422,19 +422,11 @@ void ChromeClientEfl::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFile
RefPtr<FileChooser> chooser = prpFileChooser;
bool confirm;
Eina_List* selectedFilenames = 0;
Eina_List* suggestedFilenames = 0;
void* filename;
Vector<String> filenames;

for (unsigned i = 0; i < chooser->settings().selectedFiles.size(); i++) {
CString str = chooser->settings().selectedFiles[i].utf8();
filename = strdup(str.data());
suggestedFilenames = eina_list_append(suggestedFilenames, filename);
}

confirm = ewk_view_run_open_panel(m_view, kit(frame), chooser->settings().allowsMultipleFiles, suggestedFilenames, &selectedFilenames);
EINA_LIST_FREE(suggestedFilenames, filename)
free(filename);
CString accept = chooser->settings().acceptTypes.utf8();
confirm = ewk_view_run_open_panel(m_view, kit(frame), chooser->settings().allowsMultipleFiles, accept.data(), &selectedFilenames);

if (!confirm)
return;
@@ -96,7 +96,7 @@ Eina_Bool ewk_view_run_javascript_prompt(Evas_Object *o, Evas_Object *frame, con
Eina_Bool ewk_view_should_interrupt_javascript(Evas_Object *o);
uint64_t ewk_view_exceeded_database_quota(Evas_Object *o, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size);

Eina_Bool ewk_view_run_open_panel(Evas_Object *o, Evas_Object *frame, Eina_Bool allows_multiple_files, const Eina_List *suggested_filenames, Eina_List **selected_filenames);
Eina_Bool ewk_view_run_open_panel(Evas_Object* o, Evas_Object* frame, Eina_Bool allows_multiple_files, const char* accept_types, Eina_List** selected_filenames);

void ewk_view_repaint(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
void ewk_view_scroll(Evas_Object *o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch, Eina_Bool main_frame);
@@ -4006,13 +4006,12 @@ uint64_t ewk_view_exceeded_database_quota(Evas_Object* o, Evas_Object* frame, co
* @param frame Frame in which operation is required.
* @param allows_multiple_files @c EINA_TRUE when more than one file may be
* selected, @c EINA_FALSE otherwise
* @suggested_filenames List of suggested files to select. It's advisable to
* just ignore this value, since it's a source of security flaw.
* @param accept_types accept mime types
* @selected_filenames List of files selected.
*
* @return @EINA_FALSE if user canceled file selection; @EINA_TRUE if confirmed.
*/
Eina_Bool ewk_view_run_open_panel(Evas_Object* o, Evas_Object* frame, Eina_Bool allows_multiple_files, const Eina_List* suggested_filenames, Eina_List** selected_filenames)
Eina_Bool ewk_view_run_open_panel(Evas_Object* o, Evas_Object* frame, Eina_Bool allows_multiple_files, const char* accept_types, Eina_List** selected_filenames)
{
DBG("o=%p frame=%p allows_multiple_files=%d", o, frame, allows_multiple_files);
EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE);
@@ -4024,7 +4023,7 @@ Eina_Bool ewk_view_run_open_panel(Evas_Object* o, Evas_Object* frame, Eina_Bool

*selected_filenames = 0;

confirm = sd->api->run_open_panel(sd, frame, allows_multiple_files, suggested_filenames, selected_filenames);
confirm = sd->api->run_open_panel(sd, frame, allows_multiple_files, accept_types, selected_filenames);
if (!confirm && *selected_filenames)
ERR("Canceled file selection, but selected filenames != 0. Free names before return.");
return confirm;
@@ -138,7 +138,7 @@ struct _Ewk_View_Smart_Class {
Eina_Bool (*should_interrupt_javascript)(Ewk_View_Smart_Data *sd);
uint64_t (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size);

Eina_Bool (*run_open_panel)(Ewk_View_Smart_Data *sd, Evas_Object *frame, Eina_Bool allows_multiple_files, const Eina_List *suggested_filenames, Eina_List **selected_filenames);
Eina_Bool (*run_open_panel)(Ewk_View_Smart_Data *sd, Evas_Object *frame, Eina_Bool allows_multiple_files, const char *accept_types, Eina_List **selected_filenames);

Eina_Bool (*navigation_policy_decision)(Ewk_View_Smart_Data *sd, Ewk_Frame_Resource_Request *request);
};

0 comments on commit 6e0c97a

Please sign in to comment.