| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 // See bug: http://b/issue?id=1111667. | 172 // See bug: http://b/issue?id=1111667. |
| 173 attribute_name = "href"; | 173 attribute_name = "href"; |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 if (!attribute_name) | 176 if (!attribute_name) |
| 177 return WebString(); | 177 return WebString(); |
| 178 WebString value = element.getAttribute(WebString::fromUTF8(attribute_name)); | 178 WebString value = element.getAttribute(WebString::fromUTF8(attribute_name)); |
| 179 // 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, |
| 180 // otherwise return NULL. | 180 // otherwise return NULL. |
| 181 if (!value.isNull() && !value.isEmpty() && | 181 if (!value.isNull() && !value.isEmpty() && |
| 182 !StartsWithASCII(value.utf8(), "javascript:", false)) | 182 !base::StartsWithASCII(value.utf8(), "javascript:", false)) |
| 183 return value; | 183 return value; |
| 184 | 184 |
| 185 return WebString(); | 185 return WebString(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 // Get all savable resource links from current webview, include main | 188 // Get all savable resource links from current webview, include main |
| 189 // frame and sub-frame | 189 // frame and sub-frame |
| 190 bool GetAllSavableResourceLinksForCurrentPage(WebView* view, | 190 bool GetAllSavableResourceLinksForCurrentPage(WebView* view, |
| 191 const GURL& page_url, SavableResourcesResult* result, | 191 const GURL& page_url, SavableResourcesResult* result, |
| 192 const char** savable_schemes) { | 192 const char** savable_schemes) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 it != frames_set.end(); ++it) { | 226 it != frames_set.end(); ++it) { |
| 227 // Append unique frame source to savable frame list. | 227 // Append unique frame source to savable frame list. |
| 228 if (resources_set.find(*it) == resources_set.end()) | 228 if (resources_set.find(*it) == resources_set.end()) |
| 229 result->frames_list->push_back(*it); | 229 result->frames_list->push_back(*it); |
| 230 } | 230 } |
| 231 | 231 |
| 232 return true; | 232 return true; |
| 233 } | 233 } |
| 234 | 234 |
| 235 } // namespace content | 235 } // namespace content |
| OLD | NEW |