Changeset 86452 in webkit


Ignore:
Timestamp:
May 13, 2011 12:28:53 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

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

Reviewed by Darin Fisher.

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

Added WebIconURL for the corresponding IconURL.
Added method iconURLs() to specify the type of icon need to return.
The favIconURL() is deprecated and will be removed later.

  • WebKit.gyp:
  • features.gypi:
  • public/WebFrame.h:
  • public/WebFrameClient.h: (WebKit::WebFrameClient::didChangeIcons):
  • public/WebIconURL.h: Added. (WebKit::WebIconURL::WebIconURL): (WebKit::WebIconURL::iconType): (WebKit::WebIconURL::iconURL):
  • 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

    r86451 r86452  
     12011-05-13  Tao Bai  <michaelbai@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     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 method iconURLs() to specify the type of icon need to return.
     10        The favIconURL() is deprecated and will be removed later.
     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        (WebKit::WebIconURL::iconType):
     20        (WebKit::WebIconURL::iconURL):
     21        * src/AssertMatchingEnums.cpp:
     22        * src/FrameLoaderClientImpl.cpp:
     23        (WebKit::FrameLoaderClientImpl::dispatchDidChangeIcons):
     24        * src/WebFrameImpl.cpp:
     25        (WebKit::WebFrameImpl::favIconURL):
     26        * src/WebFrameImpl.h:
     27
    1282011-05-13  Sam Weinig  <sam@webkit.org>
    229
     
    265292
    266293        Added WebIconURL for the corresponding IconURL.
    267         Added a parameter to favIconURL() to specify the type of icon need to
    268         return.
     294        Added method iconURLs() to specify the type of icon need to return.
     295        The favIconURL() is deprecated.
    269296
    270297        * WebKit.gyp:
  • trunk/Source/WebKit/chromium/WebKit.gyp

    r86094 r86452  
    186186                'public/WebHTTPLoadInfo.h',
    187187                'public/WebIconLoadingCompletion.h',
     188                'public/WebIconURL.h',
    188189                'public/WebImage.h',
    189190                'public/WebImageDecoder.h',
  • trunk/Source/WebKit/chromium/features.gypi

    r86094 r86452  
    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

    r86094 r86452  
    3434#include "WebCanvas.h"
    3535#include "WebFileSystem.h"
     36#include "WebIconURL.h"
    3637#include "WebNode.h"
    3738#include "WebURL.h"
     39// FIXME : Remove this file when transient done.
     40#include "WebVector.h"
    3841
    3942struct NPObject;
     
    130133    virtual WebURL url() const = 0;
    131134
    132     // The url of the favicon (if any) specified by the document loaded in
    133     // this frame.
     135    // DEPRECATED: Use iconIRLs instead.
    134136    virtual WebURL favIconURL() const = 0;
     137
     138    // The urls of the given combination types of favicon (if any) specified by
     139    // the document loaded in this frame. The iconTypes is a bit-mask of
     140    // WebIconURL::Type values, used to select from the available set of icon
     141    // URLs
     142    virtual WebVector<WebIconURL> iconURLs(int iconTypes) const
     143    {
     144        // FIXME : Remove the implementation, this make buildbot happy during
     145        //         the transient.
     146        return WebVector<WebIconURL>();
     147    }
    135148
    136149    // The url of the OpenSearch Desription Document (if any) specified by
  • trunk/Source/WebKit/chromium/public/WebFrameClient.h

    r86094 r86452  
    3434#include "WebCommon.h"
    3535#include "WebFileSystem.h"
     36#include "WebIconURL.h"
    3637#include "WebNavigationPolicy.h"
    3738#include "WebNavigationType.h"
     
    202203    }
    203204
    204     // The icons for the page have changed.
     205    // DEPRECATED: Implement didChangeIcon instead.
    205206    virtual void didChangeIcons(WebFrame*) { }
     207
     208    // The icon for the page have changed.
     209    virtual void didChangeIcon(WebFrame*, WebIconURL::Type) { }
    206210
    207211    // The frame's document finished loading.
  • trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp

    r86094 r86452  
    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::TypeInvalid, InvalidIcon);
     310COMPILE_ASSERT_MATCHING_ENUM(WebIconURL::TypeFavicon, Favicon);
     311COMPILE_ASSERT_MATCHING_ENUM(WebIconURL::TypeTouch, TouchIcon);
     312COMPILE_ASSERT_MATCHING_ENUM(WebIconURL::TypeTouchPrecomposed, 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

    r86094 r86452  
    760760void FrameLoaderClientImpl::dispatchDidChangeIcons(WebCore::IconType type)
    761761{
    762     if (m_webFrame->client())
    763         m_webFrame->client()->didChangeIcons(m_webFrame);
     762    if (m_webFrame->client()) {
     763        m_webFrame->client()->didChangeIcon(m_webFrame, static_cast<WebIconURL::Type>(type));
     764        // FIXME : Keep the API work in the transient.
     765        if (type == WebCore::Favicon)
     766            m_webFrame->client()->didChangeIcons(m_webFrame);
     767    }
    764768}
    765769
  • trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp

    r86219 r86452  
    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"
     
    521523WebURL WebFrameImpl::favIconURL() const
    522524{
     525    WebVector<WebIconURL> urls = iconURLs(WebIconURL::TypeFavicon);
     526    if (urls.size())
     527        return urls[0].iconURL();
     528    return WebURL();
     529}
     530
     531WebVector<WebIconURL> WebFrameImpl::iconURLs(int iconTypes) const
     532{
    523533    FrameLoader* frameLoader = m_frame->loader();
    524     // The URL to the favicon may be in the header. As such, only
    525     // ask the loader for the favicon if it's finished loading.
    526     if (frameLoader->state() == FrameStateComplete) {
    527         const KURL& url = frameLoader->iconURL();
    528         if (!url.isEmpty())
    529             return url;
    530     }
    531     return WebURL();
     534    // The URL to the icon may be in the header. As such, only
     535    // ask the loader for the icon if it's finished loading.
     536    if (frameLoader->state() == FrameStateComplete)
     537        return frameLoader->iconURLs(iconTypes);
     538    return WebVector<WebIconURL>();
    532539}
    533540
  • trunk/Source/WebKit/chromium/src/WebFrameImpl.h

    r86094 r86452  
    7272    virtual WebURL url() const;
    7373    virtual WebURL favIconURL() const;
     74    virtual WebVector<WebIconURL> iconURLs(int iconTypes) const;
    7475    virtual WebURL openSearchDescriptionURL() const;
    7576    virtual WebString encoding() const;
Note: See TracChangeset for help on using the changeset viewer.