Diff
Modified: trunk/Source/WebKit2/ChangeLog (120426 => 120427)
--- trunk/Source/WebKit2/ChangeLog 2012-06-15 09:07:53 UTC (rev 120426)
+++ trunk/Source/WebKit2/ChangeLog 2012-06-15 09:20:26 UTC (rev 120427)
@@ -1,3 +1,18 @@
+2012-06-15 Christophe Dumez <[email protected]>
+
+ [EFL][WK2] Implement reload / stop in Ewk_View
+ https://bugs.webkit.org/show_bug.cgi?id=89168
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ 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:
+
2012-06-14 Kent Tamura <[email protected]>
Validate form state strings in FormController::setStateForNewFormElements()
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (120426 => 120427)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2012-06-15 09:07:53 UTC (rev 120426)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp 2012-06-15 09:20:26 UTC (rev 120427)
@@ -1,5 +1,6 @@
/*
Copyright (C) 2011 Samsung Electronics
+ Copyright (C) 2012 Intel Corporation. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -523,6 +524,24 @@
return priv->uri;
}
+Eina_Bool ewk_view_reload(Evas_Object* ewkView)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+ EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
+
+ WKPageReload(toAPI(priv->pageClient->page()));
+ return true;
+}
+
+Eina_Bool ewk_view_stop(Evas_Object* ewkView)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
+ EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
+
+ WKPageStopLoading(toAPI(priv->pageClient->page()));
+ return true;
+}
+
void ewk_view_display(Evas_Object* ewkView, const IntRect& rect)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h (120426 => 120427)
--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h 2012-06-15 09:07:53 UTC (rev 120426)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h 2012-06-15 09:20:26 UTC (rev 120427)
@@ -1,5 +1,6 @@
/*
Copyright (C) 2011 Samsung Electronics
+ Copyright (C) 2012 Intel Corporation. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -164,6 +165,26 @@
*/
EAPI const char *ewk_view_uri_get(const Evas_Object *o);
+/**
+ * Asks the main frame to reload the current document.
+ *
+ * @param o view object to reload current document
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
+ *
+ * @see ewk_view_reload_full()
+ */
+EAPI Eina_Bool ewk_view_reload(Evas_Object *o);
+
+/**
+ * Asks the main frame to stop loading.
+ *
+ * @param o view object to stop loading
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise.
+ */
+EAPI Eina_Bool ewk_view_stop(Evas_Object *o);
+
#ifdef __cplusplus
}
#endif
Modified: trunk/Tools/ChangeLog (120426 => 120427)
--- trunk/Tools/ChangeLog 2012-06-15 09:07:53 UTC (rev 120426)
+++ trunk/Tools/ChangeLog 2012-06-15 09:20:26 UTC (rev 120427)
@@ -1,3 +1,17 @@
+2012-06-15 Christophe Dumez <[email protected]>
+
+ [EFL][WK2] Implement reload / stop in Ewk_View
+ https://bugs.webkit.org/show_bug.cgi?id=89168
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ 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):
+
2012-06-15 Hironori Bono <[email protected]>
Allow platforms to choose whether to remove markers on editing
Modified: trunk/Tools/MiniBrowser/efl/main.c (120426 => 120427)
--- trunk/Tools/MiniBrowser/efl/main.c 2012-06-15 09:07:53 UTC (rev 120426)
+++ trunk/Tools/MiniBrowser/efl/main.c 2012-06-15 09:20:26 UTC (rev 120427)
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2012 Samsung Electronics
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -26,6 +27,14 @@
static const int DEFAULT_HEIGHT = 600;
static const char DEFAULT_URL[] = "http://www.google.com/";
+#define info(format, args...) \
+ do { \
+ if (verbose) \
+ printf(format, ##args); \
+ } while (0)
+
+static int verbose = 0;
+
typedef struct _MiniBrowser {
Ecore_Evas *ee;
Evas *evas;
@@ -56,6 +65,19 @@
evas_object_resize(webview, w, h);
}
+static void
+on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Key_Down *ev = (Evas_Event_Key_Down*) event_info;
+ if (!strcmp(ev->key, "F5")) {
+ info("Reload (F5) was pressed, reloading.\n");
+ ewk_view_reload(obj);
+ } else if (!strcmp(ev->key, "F6")) {
+ info("Stop (F6) was pressed, stop loading.\n");
+ ewk_view_stop(obj);
+ }
+}
+
static MiniBrowser *browserCreate(const char *url)
{
MiniBrowser *app = malloc(sizeof(MiniBrowser));
@@ -81,8 +103,10 @@
/* Create webview */
app->browser = ewk_view_add(app->evas);
evas_object_name_set(app->browser, "browser");
+
+ evas_object_event_callback_add(app->browser, EVAS_CALLBACK_KEY_DOWN, on_key_down, app);
+
evas_object_size_hint_weight_set(app->browser, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
evas_object_resize(app->browser, DEFAULT_WIDTH, DEFAULT_HEIGHT);
evas_object_show(app->browser);
evas_object_focus_set(app->browser, EINA_TRUE);