<rdar://problem/5521230> Implement IWebIconDatabase::iconURLForURL in WebKit...
authoradachan <adachan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Oct 2007 22:48:58 +0000 (22:48 +0000)
committeradachan <adachan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Oct 2007 22:48:58 +0000 (22:48 +0000)
        Reviewed by Steve and Brady.

        * Interfaces/IWebIconDatabase.idl:
        * WebIconDatabase.cpp:
        (WebIconDatabase::iconURLForURL):
        * WebIconDatabase.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@26029 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/win/ChangeLog
WebKit/win/Interfaces/IWebIconDatabase.idl
WebKit/win/WebIconDatabase.cpp
WebKit/win/WebIconDatabase.h

index 1b39c21edeb2090547174d5c49beb538c333ecef..9399bf6d5996f72163519d807237f506344422b8 100644 (file)
@@ -1,3 +1,14 @@
+2007-10-03  Ada Chan  <adachan@apple.com>
+
+        <rdar://problem/5521230> Implement IWebIconDatabase::iconURLForURL in WebKit for windows
+
+        Reviewed by Steve and Brady.
+
+        * Interfaces/IWebIconDatabase.idl:
+        * WebIconDatabase.cpp:
+        (WebIconDatabase::iconURLForURL):
+        * WebIconDatabase.h:
+
 2007-10-02  Sam Weinig  <sam@webkit.org>
 
         Rubber-stamped by Adam Roben.
index 9a71d7327e34bb56106e8a5c52942bedada09c30..d944abe034f8d0c3822e0fc79ecaff8bd08e0197 100644 (file)
@@ -163,4 +163,12 @@ interface IWebIconDatabase : IUnknown
         - (void)allowDatabaseCleanup;
     */
     HRESULT allowDatabaseCleanup();
+
+    /*!
+        @method iconURLForURL:withSize:cache:
+        @discussion Returns an icon URL for a web site URL from memory or disk. nil if none is found.
+        @param URL
+        - (NSString *)iconURLForURL:(NSString *)URL;
+    */
+    HRESULT iconURLForURL([in] BSTR url, [out, retval] BSTR* iconURL);
 }
index 5d35c722da69529661080273eac0b4a5724f25e8..aa4e47b371ed4fbac0c52cc8f47ef0ea190fdd37 100644 (file)
@@ -32,6 +32,7 @@
 #include "WebPreferences.h"
 #include "WebNotificationCenter.h"
 #pragma warning(push, 0)
+#include <WebCore/BString.h>
 #include <WebCore/IconDatabase.h>
 #include <WebCore/Image.h>
 #include <WebCore/PlatformString.h>
@@ -239,6 +240,17 @@ HRESULT STDMETHODCALLTYPE WebIconDatabase::allowDatabaseCleanup(void)
     return E_NOTIMPL;
 }
 
+HRESULT STDMETHODCALLTYPE WebIconDatabase::iconURLForURL( 
+        /* [in] */ BSTR url,
+        /* [retval][out] */ BSTR* iconURL)
+{
+    if (!url || !iconURL)
+        return E_POINTER;
+    BString iconURLBSTR(iconDatabase()->iconURLForPageURL(String(url, SysStringLen(url))));
+    *iconURL = iconURLBSTR.release();
+    return S_OK;
+}
+
 HBITMAP createDIB(LPSIZE size)
 {
     HBITMAP result;
index 1a2e59142d4cd7dbad03aeb9d77f9c8b6eddc55b..c37add3843e77b8938b8f5a793b19b2ef3145ceb 100644 (file)
@@ -90,6 +90,10 @@ public:
     
     virtual HRESULT STDMETHODCALLTYPE allowDatabaseCleanup( void);
 
+    virtual HRESULT STDMETHODCALLTYPE iconURLForURL( 
+        /* [in] */ BSTR url,
+        /* [retval][out] */ BSTR *iconURL);
+
     // IconDatabaseClient
     virtual void dispatchDidRemoveAllIcons();
     virtual void dispatchDidAddIconForPageURL(const WebCore::String&);