OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/savable_resources.h" | 5 #include "content/renderer/savable_resources.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 element.hasHTMLTagName("tr") || | 159 element.hasHTMLTagName("tr") || |
160 element.hasHTMLTagName("td")) { | 160 element.hasHTMLTagName("td")) { |
161 attribute_name = "background"; | 161 attribute_name = "background"; |
162 } else if (element.hasHTMLTagName("blockquote") || | 162 } else if (element.hasHTMLTagName("blockquote") || |
163 element.hasHTMLTagName("q") || | 163 element.hasHTMLTagName("q") || |
164 element.hasHTMLTagName("del") || | 164 element.hasHTMLTagName("del") || |
165 element.hasHTMLTagName("ins")) { | 165 element.hasHTMLTagName("ins")) { |
166 attribute_name = "cite"; | 166 attribute_name = "cite"; |
167 } else if (element.hasHTMLTagName("link")) { | 167 } else if (element.hasHTMLTagName("link")) { |
168 // If the link element is not linked to css, ignore it. | 168 // If the link element is not linked to css, ignore it. |
169 if (base::LowerCaseEqualsASCII( | 169 if (LowerCaseEqualsASCII(element.getAttribute("type"), "text/css")) { |
170 base::string16(element.getAttribute("type")), "text/css")) { | |
171 // TODO(jnd): Add support for extracting links of sub-resources which | 170 // TODO(jnd): Add support for extracting links of sub-resources which |
172 // are inside style-sheet such as @import, url(), etc. | 171 // are inside style-sheet such as @import, url(), etc. |
173 // See bug: http://b/issue?id=1111667. | 172 // See bug: http://b/issue?id=1111667. |
174 attribute_name = "href"; | 173 attribute_name = "href"; |
175 } | 174 } |
176 } | 175 } |
177 if (!attribute_name) | 176 if (!attribute_name) |
178 return WebString(); | 177 return WebString(); |
179 WebString value = element.getAttribute(WebString::fromUTF8(attribute_name)); | 178 WebString value = element.getAttribute(WebString::fromUTF8(attribute_name)); |
180 // If value has content and not start with "javascript:" then return it, | 179 // If value has content and not start with "javascript:" then return it, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 it != frames_set.end(); ++it) { | 226 it != frames_set.end(); ++it) { |
228 // Append unique frame source to savable frame list. | 227 // Append unique frame source to savable frame list. |
229 if (resources_set.find(*it) == resources_set.end()) | 228 if (resources_set.find(*it) == resources_set.end()) |
230 result->frames_list->push_back(*it); | 229 result->frames_list->push_back(*it); |
231 } | 230 } |
232 | 231 |
233 return true; | 232 return true; |
234 } | 233 } |
235 | 234 |
236 } // namespace content | 235 } // namespace content |
OLD | NEW |