Changeset 121830 in webkit
- Timestamp:
- Jul 3, 2012 11:34:49 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r121808 r121830 1 2012-07-03 Christophe Dumez <christophe.dumez@intel.com> 2 3 [WK2][EFL] Ewk_View should report the load progress 4 https://bugs.webkit.org/show_bug.cgi?id=90457 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 The Ewk_View now reports the estimated load progress 9 of the page via the new "load,progress". 10 A method is also added to Ewk_View in order to 11 retrieve the current load progress. 12 13 * UIProcess/API/efl/ewk_view.cpp: 14 (ewk_view_load_progress_get): 15 (ewk_view_load_progress_changed): 16 * UIProcess/API/efl/ewk_view.h: 17 * UIProcess/API/efl/ewk_view_loader_client.cpp: 18 (didChangeProgress): 19 (ewk_view_loader_client_attach): 20 * UIProcess/API/efl/ewk_view_private.h: 21 1 22 2012-07-03 Christophe Dumez <christophe.dumez@intel.com> 2 23 -
trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
r121770 r121830 570 570 } 571 571 572 double ewk_view_load_progress_get(const Evas_Object* ewkView) 573 { 574 EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0); 575 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0); 576 577 return WKPageGetEstimatedProgress(toAPI(priv->pageClient->page())); 578 } 579 580 /** 581 * @internal 582 * Reports load progress changed. 583 * 584 * Emits signal: "load,progress" with pointer to a double from 0.0 to 1.0. 585 */ 586 void ewk_view_load_progress_changed(Evas_Object* ewkView, double progress) 587 { 588 evas_object_smart_callback_call(ewkView, "load,progress", &progress); 589 } 590 572 591 /** 573 592 * @internal -
trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h
r121733 r121830 29 29 * - "intent,request,new", Ewk_Intent_Request*: reports new Web intent request. 30 30 * - "intent,service,register", Ewk_Intent_Service*: reports new Web intent service registration. 31 * - "load,progress", double*: load progress has changed (value from 0.0 to 1.0). 31 32 * - "title,changed", const char*: title of the main frame was changed. 32 33 */ … … 254 255 EAPI const char *ewk_view_title_get(const Evas_Object *o); 255 256 257 /** 258 * Gets the current load progress of page. 259 * 260 * The progress estimation from 0.0 to 1.0. 261 * 262 * @param o view object to get the current progress 263 * 264 * @return the load progres of page, value from 0.0 to 1.0. 265 */ 266 EAPI double ewk_view_load_progress_get(const Evas_Object *o); 267 256 268 #ifdef __cplusplus 257 269 } -
trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp
r121732 r121830 66 66 #endif 67 67 68 static void didChangeProgress(WKPageRef page, const void* clientInfo) 69 { 70 Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo)); 71 ewk_view_load_progress_changed(ewkView, WKPageGetEstimatedProgress(page)); 72 } 73 68 74 void ewk_view_loader_client_attach(WKPageRef pageRef, Evas_Object* ewkView) 69 75 { … … 79 85 loadClient.registerIntentServiceForFrame = registerIntentServiceForFrame; 80 86 #endif 87 loadClient.didStartProgress = didChangeProgress; 88 loadClient.didChangeProgress = didChangeProgress; 89 loadClient.didFinishProgress = didChangeProgress; 81 90 WKPageSetPageLoaderClient(pageRef, &loadClient); 82 91 } -
trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h
r121732 r121830 40 40 void ewk_view_display(Evas_Object* ewkView, const WebCore::IntRect& rect); 41 41 void ewk_view_image_data_set(Evas_Object* ewkView, void* imageData, const WebCore::IntSize& size); 42 void ewk_view_load_progress_changed(Evas_Object* ewkView, double progress); 42 43 void ewk_view_title_changed(Evas_Object* ewkView, const char* title); 43 44 -
trunk/Tools/ChangeLog
r121825 r121830 1 2012-07-03 Christophe Dumez <christophe.dumez@intel.com> 2 3 [WK2][EFL] Ewk_View should report the load progress 4 https://bugs.webkit.org/show_bug.cgi?id=90457 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Update EFL MiniBrowser so that it listens for the 9 "load,progress" on the Ewk_View and updates its 10 window title accordingly. 11 12 * MiniBrowser/efl/main.c: 13 (title_set): 14 (on_title_changed): 15 (on_progress): 16 (browserCreate): 17 1 18 2012-07-03 Dirk Pranke <dpranke@chromium.org> 2 19 -
trunk/Tools/MiniBrowser/efl/main.c
r120442 r121830 27 27 static const int DEFAULT_HEIGHT = 600; 28 28 static const char DEFAULT_URL[] = "http://www.google.com/"; 29 static const char APP_NAME[] = "EFL MiniBrowser"; 29 30 30 31 #define info(format, args...) \ … … 88 89 89 90 static void 91 title_set(Ecore_Evas *ee, const char *title, int progress) 92 { 93 Eina_Strbuf* buffer; 94 95 if (!title || !*title) { 96 ecore_evas_title_set(ee, APP_NAME); 97 return; 98 } 99 100 buffer = eina_strbuf_new(); 101 if (progress < 100) 102 eina_strbuf_append_printf(buffer, "%s (%d%%) - %s", title, progress, APP_NAME); 103 else 104 eina_strbuf_append_printf(buffer, "%s - %s", title, APP_NAME); 105 106 ecore_evas_title_set(ee, eina_strbuf_string_get(buffer)); 107 eina_strbuf_free(buffer); 108 } 109 110 static void 90 111 on_title_changed(void *user_data, Evas_Object *webview, void *event_info) 91 112 { … … 93 114 const char *title = (const char *)event_info; 94 115 95 ecore_evas_title_set(app->ee, title); 116 title_set(app->ee, title, 100); 117 } 118 119 static void 120 on_progress(void *user_data, Evas_Object *webview, void *event_info) 121 { 122 MiniBrowser *app = (MiniBrowser *)user_data; 123 double progress = *(double *)event_info; 124 125 title_set(app->ee, ewk_view_title_get(app->browser), progress * 100); 96 126 } 97 127 … … 102 132 app->ee = ecore_evas_new(0, 0, 0, DEFAULT_WIDTH, DEFAULT_HEIGHT, 0); 103 133 104 ecore_evas_title_set(app->ee, "EFL MiniBrowser");134 ecore_evas_title_set(app->ee, APP_NAME); 105 135 ecore_evas_callback_resize_set(app->ee, on_ecore_evas_resize); 106 136 ecore_evas_borderless_set(app->ee, 0); … … 122 152 evas_object_name_set(app->browser, "browser"); 123 153 154 evas_object_smart_callback_add(app->browser, "load,progress", on_progress, app); 124 155 evas_object_smart_callback_add(app->browser, "title,changed", on_title_changed, app); 125 156
Note: See TracChangeset
for help on using the changeset viewer.