Changeset 86091 in webkit


Ignore:
Timestamp:
May 9, 2011 3:04:34 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-05-09 Tao Bai <michaelbai@chromium.org>

Reviewed by David Levin.

Handle the touch icon.
https://bugs.webkit.org/show_bug.cgi?id=60247

Added WebIconURL for the corresponding IconURL.
Added a parameter to favIconURL() to specify the type of icon need to
return.

  • WebKit.gyp:
  • features.gypi:
  • public/WebFrame.h:
  • public/WebFrameClient.h: (WebKit::WebFrameClient::didChangeIcons):
  • public/WebIconURL.h: Added. (WebKit::WebIconURL::WebIconURL):
  • src/AssertMatchingEnums.cpp:
  • src/FrameLoaderClientImpl.cpp: (WebKit::FrameLoaderClientImpl::dispatchDidChangeIcons):
  • src/WebFrameImpl.cpp: (WebKit::WebFrameImpl::favIconURL):
  • src/WebFrameImpl.h:
Location:
trunk/Source/WebKit/chromium
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r86080 r86091  
     12011-05-09  Tao Bai  <michaelbai@chromium.org>
     2
     3        Reviewed by David Levin.
     4
     5        Handle the touch icon.
     6        https://bugs.webkit.org/show_bug.cgi?id=60247
     7
     8        Added WebIconURL for the corresponding IconURL.
     9        Added a parameter to favIconURL() to specify the type of icon need to
     10        return.
     11
     12        * WebKit.gyp:
     13        * features.gypi:
     14        * public/WebFrame.h:
     15        * public/WebFrameClient.h:
     16        (WebKit::WebFrameClient::didChangeIcons):
     17        * public/WebIconURL.h: Added.
     18        (WebKit::WebIconURL::WebIconURL):
     19        * src/AssertMatchingEnums.cpp:
     20        * src/FrameLoaderClientImpl.cpp:
     21        (WebKit::FrameLoaderClientImpl::dispatchDidChangeIcons):
     22        * src/WebFrameImpl.cpp:
     23        (WebKit::WebFrameImpl::favIconURL):
     24        * src/WebFrameImpl.h:
     25
    1262011-05-09  Evan Martin  <evan@chromium.org>
    227
  • trunk/Source/WebKit/chromium/WebKit.gyp

    r86080 r86091  
    186186                'public/WebHTTPLoadInfo.h',
    187187                'public/WebIconLoadingCompletion.h',
     188                'public/WebIconType.h',
    188189                'public/WebImage.h',
    189190                'public/WebImageDecoder.h',
  • trunk/Source/WebKit/chromium/features.gypi

    r84991 r86091  
    8989        'ENABLE_SVG_USE=1',
    9090        'ENABLE_TOUCH_EVENTS=1',
     91        'ENABLE_TOUCH_ICON_LOADING=1',
    9192        'ENABLE_V8_SCRIPT_DEBUG_SERVER=1',
    9293        'ENABLE_VIDEO=1',
  • trunk/Source/WebKit/chromium/public/WebFrame.h

    r85001 r86091  
    3434#include "WebCanvas.h"
    3535#include "WebFileSystem.h"
     36#include "WebIconURL.h"
    3637#include "WebNode.h"
    3738#include "WebURL.h"
     
    130131    virtual WebURL url() const = 0;
    131132
    132     // The url of the favicon (if any) specified by the document loaded in
    133     // this frame.
    134     virtual WebURL favIconURL() const = 0;
     133    // The urls of the given combination types of favicon (if any) specified by
     134    // the document loaded in this frame.
     135    virtual WebVector<WebIconURL> favIconURL(int iconTypes) const = 0;
    135136
    136137    // The url of the OpenSearch Desription Document (if any) specified by
  • trunk/Source/WebKit/chromium/public/WebFrameClient.h

    r85703 r86091  
    3434#include "WebCommon.h"
    3535#include "WebFileSystem.h"
     36#include "WebIconURL.h"
    3637#include "WebNavigationPolicy.h"
    3738#include "WebNavigationType.h"
     
    203204
    204205    // The icons for the page have changed.
    205     virtual void didChangeIcons(WebFrame*) { }
     206    virtual void didChangeIcons(WebFrame*, WebIconURL::WebIconType) { }
    206207
    207208    // The frame's document finished loading.
  • trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp

    r86047 r86091  
    4747#include "GeolocationPosition.h"
    4848#include "HTMLInputElement.h"
     49#include "IconURL.h"
    4950#include "IDBFactoryBackendInterface.h"
    5051#include "IDBKey.h"
     
    7475#include "WebIDBFactory.h"
    7576#include "WebIDBKey.h"
     77#include "WebIconURL.h"
    7678#include "WebInputElement.h"
    7779#include "WebMediaPlayer.h"
     
    305307COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::WeightBold, FontWeightBold);
    306308
     309COMPILE_ASSERT_MATCHING_ENUM(WebIconURL::WebIconTypeInvalid, InvalidIcon);
     310COMPILE_ASSERT_MATCHING_ENUM(WebIconURL::WebIconTypeFavicon, Favicon);
     311COMPILE_ASSERT_MATCHING_ENUM(WebIconURL::WebIconTypeTouch, TouchIcon);
     312COMPILE_ASSERT_MATCHING_ENUM(WebIconURL::WebIconTypeTouchPrecomposed, TouchPrecomposedIcon);
     313
    307314COMPILE_ASSERT_MATCHING_ENUM(WebNode::ElementNode, Node::ELEMENT_NODE);
    308315COMPILE_ASSERT_MATCHING_ENUM(WebNode::AttributeNode, Node::ATTRIBUTE_NODE);
  • trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp

    r85785 r86091  
    761761{
    762762    if (m_webFrame->client())
    763         m_webFrame->client()->didChangeIcons(m_webFrame);
     763        m_webFrame->client()->didChangeIcons(m_webFrame, static_cast<WebIconURL::WebIconType>(type));
    764764}
    765765
  • trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp

    r85864 r86091  
    102102#include "HistoryItem.h"
    103103#include "HitTestResult.h"
     104#include "IconURL.h"
    104105#include "InspectorController.h"
    105106#include "Page.h"
     
    138139#include "WebFrameClient.h"
    139140#include "WebHistoryItem.h"
     141#include "WebIconURL.h"
    140142#include "WebInputElement.h"
    141143#include "WebNode.h"
     
    519521}
    520522
    521 WebURL WebFrameImpl::favIconURL() const
     523WebVector<WebIconURL> WebFrameImpl::favIconURL(int webIconTypes) const
    522524{
    523525    FrameLoader* frameLoader = m_frame->loader();
     
    525527    // ask the loader for the favicon if it's finished loading.
    526528    if (frameLoader->state() == FrameStateComplete) {
    527         const KURL& url = frameLoader->iconURL();
    528         if (!url.isEmpty())
    529             return url;
    530     }
    531     return WebURL();
     529        WTF::Vector<WebCore::IconURL> iconURLs = frameLoader->iconURLs(webIconTypes);
     530        WebVector<WebIconURL> webIconURLs(iconURLs.size());
     531        for (size_t i = 0; i < iconURLs.size(); i++)
     532            webIconURLs[i] = WebIconURL(iconURLs[i].m_iconURL, static_cast<WebIconURL::WebIconType>(iconURLs[i].m_iconType));
     533        return webIconURLs;
     534    }
     535    return WebVector<WebIconURL>();
    532536}
    533537
  • trunk/Source/WebKit/chromium/src/WebFrameImpl.h

    r85787 r86091  
    7171    virtual long long identifier() const;
    7272    virtual WebURL url() const;
    73     virtual WebURL favIconURL() const;
     73    virtual WebVector<WebIconURL> favIconURL(int iconTypes) const;
    7474    virtual WebURL openSearchDescriptionURL() const;
    7575    virtual WebString encoding() const;
Note: See TracChangeset for help on using the changeset viewer.