OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. |
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> | 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> |
8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 IconURLs IconController::urlsForTypes(int iconTypesMask) | 72 IconURLs IconController::urlsForTypes(int iconTypesMask) |
73 { | 73 { |
74 IconURLs iconURLs; | 74 IconURLs iconURLs; |
75 if (m_frame->tree() && m_frame->tree()->parent()) | 75 if (m_frame->tree() && m_frame->tree()->parent()) |
76 return iconURLs; | 76 return iconURLs; |
77 | 77 |
78 if (iconTypesMask & Favicon && !appendToIconURLs(Favicon, &iconURLs)) | 78 if (iconTypesMask & Favicon && !appendToIconURLs(Favicon, &iconURLs)) |
79 iconURLs.append(defaultURL(Favicon)); | 79 iconURLs.append(defaultURL(Favicon)); |
80 | 80 |
81 #if ENABLE(TOUCH_ICON_LOADING) | 81 #if ENABLE(TOUCH_ICON_LOADING) |
82 int missedIcons = 0; | 82 appendToIconURLs(TouchPrecomposedIcon, &iconURLs); |
83 if (iconTypesMask & TouchPrecomposedIcon) | 83 appendToIconURLs(TouchIcon, &iconURLs); |
84 missedIcons += appendToIconURLs(TouchPrecomposedIcon, &iconURLs) ? 0:1; | |
85 | |
86 if (iconTypesMask & TouchIcon) | |
87 missedIcons += appendToIconURLs(TouchIcon, &iconURLs) ? 0:1; | |
88 | |
89 // Only return the default touch icons when the both were required and neith
er was gotten. | |
90 if (missedIcons == 2) { | |
91 iconURLs.append(defaultURL(TouchPrecomposedIcon)); | |
92 iconURLs.append(defaultURL(TouchIcon)); | |
93 } | |
94 #endif | 84 #endif |
95 | 85 |
96 // Finally, append all remaining icons of this type. | 86 // Finally, append all remaining icons of this type. |
97 const Vector<IconURL>& allIconURLs = m_frame->document()->iconURLs(iconTypes
Mask); | 87 const Vector<IconURL>& allIconURLs = m_frame->document()->iconURLs(iconTypes
Mask); |
98 for (Vector<IconURL>::const_iterator iter = allIconURLs.begin(); iter != all
IconURLs.end(); ++iter) { | 88 for (Vector<IconURL>::const_iterator iter = allIconURLs.begin(); iter != all
IconURLs.end(); ++iter) { |
99 int i; | 89 int i; |
100 int iconCount = iconURLs.size(); | 90 int iconCount = iconURLs.size(); |
101 for (i = 0; i < iconCount; ++i) { | 91 for (i = 0; i < iconCount; ++i) { |
102 if (*iter == iconURLs.at(i)) | 92 if (*iter == iconURLs.at(i)) |
103 break; | 93 break; |
(...skipping 26 matching lines...) Expand all Loading... |
130 bool couldSetProtocol = url.setProtocol(documentURL.protocol()); | 120 bool couldSetProtocol = url.setProtocol(documentURL.protocol()); |
131 ASSERT_UNUSED(couldSetProtocol, couldSetProtocol); | 121 ASSERT_UNUSED(couldSetProtocol, couldSetProtocol); |
132 url.setHost(documentURL.host()); | 122 url.setHost(documentURL.host()); |
133 if (documentURL.hasPort()) | 123 if (documentURL.hasPort()) |
134 url.setPort(documentURL.port()); | 124 url.setPort(documentURL.port()); |
135 | 125 |
136 if (iconType == Favicon) { | 126 if (iconType == Favicon) { |
137 url.setPath("/favicon.ico"); | 127 url.setPath("/favicon.ico"); |
138 return IconURL::defaultIconURL(url, Favicon); | 128 return IconURL::defaultIconURL(url, Favicon); |
139 } | 129 } |
140 #if ENABLE(TOUCH_ICON_LOADING) | |
141 if (iconType == TouchPrecomposedIcon) { | |
142 url.setPath("/apple-touch-icon-precomposed.png"); | |
143 return IconURL::defaultIconURL(url, TouchPrecomposedIcon); | |
144 } | |
145 if (iconType == TouchIcon) { | |
146 url.setPath("/apple-touch-icon.png"); | |
147 return IconURL::defaultIconURL(url, TouchIcon); | |
148 } | |
149 #endif | |
150 return IconURL(); | 130 return IconURL(); |
151 } | 131 } |
152 | 132 |
153 } | 133 } |
OLD | NEW |