summaryrefslogtreecommitdiffstats
path: root/webkit/glue/dom_operations.cc
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-17 17:21:32 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-17 17:21:32 +0000
commit007a917f99c8bc06bd6ca0785ac5b01689570215 (patch)
treef7b819954d84d47dcf4f04b1c39dbe9e2543c822 /webkit/glue/dom_operations.cc
parenta96146e10c55f6e0033706d62b17ee958ab0c76d (diff)
downloadchromium_src-007a917f99c8bc06bd6ca0785ac5b01689570215.zip
chromium_src-007a917f99c8bc06bd6ca0785ac5b01689570215.tar.gz
chromium_src-007a917f99c8bc06bd6ca0785ac5b01689570215.tar.bz2
Use better web app icons.
- Accept "link" element of both "icon" and "shortcut icon" type. see also: http://en.wikipedia.org/wiki/Favicon http://dev.w3.org/html5/spec/Overview.html#rel-icon - Get complete url from icon link's href; BUG=none TEST=Create web app shortcut to "Google Reader" and expect to see crispy clear icon rather than the blur favicon. Review URL: http://codereview.chromium.org/611008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39228 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/dom_operations.cc')
-rw-r--r--webkit/glue/dom_operations.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc
index ecc1407..dbf4ea9 100644
--- a/webkit/glue/dom_operations.cc
+++ b/webkit/glue/dom_operations.cc
@@ -475,7 +475,8 @@ static void AddInstallIcon(const WebElement& link,
if (href.isNull() || href.isEmpty())
return;
- GURL url(href);
+ // Get complete url.
+ GURL url = link.document().completeURL(href);
if (!url.is_valid())
return;
@@ -518,7 +519,12 @@ void GetApplicationInfo(WebView* view, WebApplicationInfo* app_info) {
if (elem.hasTagName("link")) {
std::string rel = elem.getAttribute("rel").utf8();
- if (rel == "SHORTCUT ICON")
+ // "rel" attribute may use either "icon" or "shortcut icon".
+ // see also
+ // <http://en.wikipedia.org/wiki/Favicon>
+ // <http://dev.w3.org/html5/spec/Overview.html#rel-icon>
+ if (LowerCaseEqualsASCII(rel, "icon") ||
+ LowerCaseEqualsASCII(rel, "shortcut icon"))
AddInstallIcon(elem, &app_info->icons);
} else if (elem.hasTagName("meta") && elem.hasAttribute("name")) {
std::string name = elem.getAttribute("name").utf8();