Title: [153059] trunk/Source/WebKit/win
Revision
153059
Author
[email protected]
Date
2013-07-23 12:02:05 -0700 (Tue, 23 Jul 2013)

Log Message

[Win] WebView didReceiveIcon delegate call doesn't have the icon in it
https://bugs.webkit.org/show_bug.cgi?id=100379

Patch by [email protected] <[email protected]> on 2013-07-23
Reviewed by Brent Fulgham.

Added missing icon to WebView didReceiveIcon delegate call, fixes <rdar://problem/5491010>.

* WebView.cpp:
(WebView::dispatchDidReceiveIconFromWebFrame):

Modified Paths

Diff

Modified: trunk/Source/WebKit/win/ChangeLog (153058 => 153059)


--- trunk/Source/WebKit/win/ChangeLog	2013-07-23 18:49:19 UTC (rev 153058)
+++ trunk/Source/WebKit/win/ChangeLog	2013-07-23 19:02:05 UTC (rev 153059)
@@ -1,3 +1,15 @@
+2013-07-23  [email protected]  <[email protected]>
+
+        [Win] WebView didReceiveIcon delegate call doesn't have the icon in it
+        https://bugs.webkit.org/show_bug.cgi?id=100379
+
+        Reviewed by Brent Fulgham.
+
+        Added missing icon to WebView didReceiveIcon delegate call, fixes <rdar://problem/5491010>.
+
+        * WebView.cpp:
+        (WebView::dispatchDidReceiveIconFromWebFrame):
+
 2013-07-22  [email protected]  <[email protected]>
 
         [Curl] Download fails for certain urls.

Modified: trunk/Source/WebKit/win/WebView.cpp (153058 => 153059)


--- trunk/Source/WebKit/win/WebView.cpp	2013-07-23 18:49:19 UTC (rev 153058)
+++ trunk/Source/WebKit/win/WebView.cpp	2013-07-23 19:02:05 UTC (rev 153059)
@@ -2866,9 +2866,27 @@
 {
     registerForIconNotification(false);
 
-    if (m_frameLoadDelegate)
-        // FIXME: <rdar://problem/5491010> - Pass in the right HBITMAP. 
-        m_frameLoadDelegate->didReceiveIcon(this, 0, frame);
+    if (m_frameLoadDelegate) {
+        String str = frame->url().string();
+
+        IntSize sz(16, 16);
+
+        BitmapInfo bmInfo = BitmapInfo::create(sz);
+
+        HBITMAP hBitmap = 0;
+
+        Image* icon = iconDatabase().synchronousIconForPageURL(str, sz);
+
+        if (icon && icon->width()) {
+            HWndDC dc(0);
+            hBitmap = CreateDIBSection(dc, &bmInfo, DIB_RGB_COLORS, 0, 0, 0);
+            icon->getHBITMAPOfSize(hBitmap, &static_cast<SIZE>(sz));
+        }
+
+        HRESULT hr = m_frameLoadDelegate->didReceiveIcon(this, (OLE_HANDLE)hBitmap, frame);
+        if (hr == E_NOTIMPL)
+            DeleteObject(hBitmap);
+    }
 }
 
 HRESULT WebView::setAccessibilityDelegate(
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to