[EFL][WK2] Add --window-size command line option to EFL MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=100942

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-11-05
Reviewed by Kenneth Rohde Christiansen.

Added window-size (-s) command line option to EFL MiniBrowser.

* MiniBrowser/efl/main.c:
(window_create):
(parse_window_size):
(elm_main):

git-svn-id: svn://svn.chromium.org/blink/trunk@133450 bbb929c8-8fbe-4397-9dbb-9b2b20218538
on_favicon_received(const char *page_url, Evas_Object *icon, void *event_info)
{
    Browser_Window *app_data = (Browser_Window *)event_info;
    if (strcmp(page_url, ewk_view_url_get(app_data->webview)))
        return;

    /* Remove previous icon from URL bar */
    Evas_Object *old_icon = elm_object_part_content_unset(app_data->url_bar, "icon");
    if (old_icon) {
        evas_object_unref(old_icon);
        evas_object_del(old_icon);
    }

    /* Show new icon in URL bar */
    if (icon) {
        /* Workaround for icon display bug:
         * http://trac.enlightenment.org/e/ticket/1616 */
        evas_object_size_hint_min_set(icon, 48, 24);
        evas_object_image_filled_set(icon, EINA_FALSE);
        evas_object_image_fill_set(icon, 24, 0, 24, 24);
        elm_object_part_content_set(app_data->url_bar, "icon", icon);
        evas_object_ref(icon);
    }
}

on_favicon_received(const char *page_url, Evas_Object *icon, void *event_info)
{
    Browser_Window *app_data = (Browser_Window *)event_info;
    if (strcmp(page_url, ewk_view_url_get(app_data->webview)))
        return;

    /* Remove previous icon from URL bar */
    Evas_Object *old_icon = elm_object_part_content_unset(app_data->url_bar, "icon");
    if (old_icon) {
        evas_object_unref(old_icon);
        evas_object_del(old_icon);
    }

    /* Show new icon in URL bar */
    if (icon) {
        /* Workaround for icon display bug:
         * http://trac.enlightenment.org/e/ticket/1616 */
        evas_object_size_hint_min_set(icon, 48, 24);
        evas_object_image_filled_set(icon, EINA_FALSE);
        evas_object_image_fill_set(icon, 24, 0, 24, 24);
        elm_object_part_content_set(app_data->url_bar, "icon", icon);
        evas_object_ref(icon);
    }
}
