Changeset 120442 in webkit
- Timestamp:
- Jun 15, 2012, 5:16:55 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
-
Source/WebKit2/ChangeLog (modified) (1 diff)
-
Source/WebKit2/PlatformEfl.cmake (modified) (1 diff)
-
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (modified) (5 diffs)
-
Source/WebKit2/UIProcess/API/efl/ewk_view.h (modified) (2 diffs)
-
Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client.cpp (added)
-
Source/WebKit2/UIProcess/API/efl/ewk_view_loader_client_private.h (added)
-
Source/WebKit2/UIProcess/API/efl/ewk_view_private.h (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/MiniBrowser/efl/main.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r120437 r120442 1 2012-06-15 Christophe Dumez <christophe.dumez@intel.com> 2 3 [EFL][WK2] Add title support to Ewk_View 4 https://bugs.webkit.org/show_bug.cgi?id=89095 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Add a method to get the title of the main frame in 9 an Ewk_View. A "title,changed" signal is now emitted 10 on the view to notify clients that the main frame 11 title was changed. 12 13 * PlatformEfl.cmake: 14 * UIProcess/API/efl/ewk_view.cpp: 15 (_Ewk_View_Private_Data): 16 (_ewk_view_priv_del): 17 (ewk_view_base_add): 18 (ewk_view_title_get): 19 (ewk_view_title_changed): 20 * UIProcess/API/efl/ewk_view.h: 21 * UIProcess/API/efl/ewk_view_loader_client.cpp: Added. 22 (didReceiveTitleForFrame): 23 (ewk_view_loader_client_attach): 24 * UIProcess/API/efl/ewk_view_loader_client_private.h: Added. 25 * UIProcess/API/efl/ewk_view_private.h: 26 1 27 2012-06-15 Christophe Dumez <christophe.dumez@intel.com> 2 28 -
trunk/Source/WebKit2/PlatformEfl.cmake
r119928 r120442 32 32 UIProcess/API/efl/ewk_context.cpp 33 33 UIProcess/API/efl/ewk_view.cpp 34 UIProcess/API/efl/ewk_view_loader_client.cpp 34 35 35 36 UIProcess/cairo/BackingStoreCairo.cpp -
trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
r120437 r120442 31 31 #include "ewk_context.h" 32 32 #include "ewk_context_private.h" 33 #include "ewk_view_loader_client_private.h" 33 34 #include "ewk_view_private.h" 34 35 #include <wtf/text/CString.h> … … 42 43 OwnPtr<PageClientImpl> pageClient; 43 44 const char* uri; 45 const char* title; 44 46 }; 45 47 … … 269 271 priv->pageClient = nullptr; 270 272 eina_stringshare_del(priv->uri); 273 eina_stringshare_del(priv->title); 271 274 free(priv); 272 275 } … … 490 493 491 494 priv->pageClient = PageClientImpl::create(toImpl(contextRef), toImpl(pageGroupRef), ewkView); 495 ewk_view_loader_client_attach(toAPI(priv->pageClient->page()), ewkView); 492 496 493 497 return ewkView; … … 541 545 WKPageStopLoading(toAPI(priv->pageClient->page())); 542 546 return true; 547 } 548 549 const char* ewk_view_title_get(const Evas_Object* ewkView) 550 { 551 EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0); 552 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0); 553 554 CString title = priv->pageClient->page()->pageTitle().utf8(); 555 eina_stringshare_replace(&priv->title, title.data()); 556 557 return priv->title; 558 } 559 560 /** 561 * @internal 562 * The view title was changed by the frame loader. 563 * 564 * Emits signal: "title,changed" with pointer to new title string. 565 */ 566 void ewk_view_title_changed(Evas_Object* ewkView, const char* title) 567 { 568 evas_object_smart_callback_call(ewkView, "title,changed", const_cast<char*>(title)); 543 569 } 544 570 -
trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h
r120437 r120442 24 24 * 25 25 * This object provides view related APIs of WebKit2 to EFL object. 26 * 27 * The following signals (see evas_object_smart_callback_add()) are emitted: 28 * 29 * - "title,changed", const char*: title of the main frame was changed. 26 30 */ 27 31 … … 226 230 EAPI Eina_Bool ewk_view_forward_possible(Evas_Object *o); 227 231 232 /** 233 * Gets the current title of the main frame. 234 * 235 * It returns an internal string and should not 236 * be modified. The string is guaranteed to be stringshared. 237 * 238 * @param o view object to get current title 239 * 240 * @return current title on success or @c 0 on failure 241 */ 242 EAPI const char *ewk_view_title_get(const Evas_Object *o); 243 228 244 #ifdef __cplusplus 229 245 } -
trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_private.h
r119928 r120442 33 33 void ewk_view_display(Evas_Object* ewkView, const WebCore::IntRect& rect); 34 34 void ewk_view_image_data_set(Evas_Object* ewkView, void* imageData, const WebCore::IntSize& size); 35 void ewk_view_title_changed(Evas_Object* ewkView, const char* title); 35 36 36 37 Evas_Object* ewk_view_base_add(Evas* canvas, WKContextRef, WKPageGroupRef); -
trunk/Tools/ChangeLog
r120437 r120442 1 2012-06-15 Christophe Dumez <christophe.dumez@intel.com> 2 3 [EFL][WK2] Add title support to Ewk_View 4 https://bugs.webkit.org/show_bug.cgi?id=89095 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Update the MiniBrowser so it listens for the "title,change" 9 signal on the view and keeps the browser window title 10 up-to-date. 11 12 * MiniBrowser/efl/main.c: 13 (on_title_changed): 14 (browserCreate): 15 1 16 2012-06-15 Christophe Dumez <christophe.dumez@intel.com> 2 17 -
trunk/Tools/MiniBrowser/efl/main.c
r120437 r120442 87 87 } 88 88 89 static void 90 on_title_changed(void *user_data, Evas_Object *webview, void *event_info) 91 { 92 MiniBrowser *app = (MiniBrowser *)user_data; 93 const char *title = (const char *)event_info; 94 95 ecore_evas_title_set(app->ee, title); 96 } 97 89 98 static MiniBrowser *browserCreate(const char *url) 90 99 { … … 112 121 app->browser = ewk_view_add(app->evas); 113 122 evas_object_name_set(app->browser, "browser"); 123 124 evas_object_smart_callback_add(app->browser, "title,changed", on_title_changed, app); 114 125 115 126 evas_object_event_callback_add(app->browser, EVAS_CALLBACK_KEY_DOWN, on_key_down, app);
Note:
See TracChangeset
for help on using the changeset viewer.