| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/glue/dom_operations.h" | 5 #include "webkit/glue/dom_operations.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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 WebElement element = web_frame->document().getElementById( | 246 WebElement element = web_frame->document().getElementById( |
| 247 WebString::fromUTF8(element_id)); | 247 WebString::fromUTF8(element_id)); |
| 248 if (element.isNull() || !element.hasHTMLTagName("input")) | 248 if (element.isNull() || !element.hasHTMLTagName("input")) |
| 249 return false; | 249 return false; |
| 250 | 250 |
| 251 WebInputElement input_element = element.to<WebInputElement>(); | 251 WebInputElement input_element = element.to<WebInputElement>(); |
| 252 return input_element.autoComplete(); | 252 return input_element.autoComplete(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 void GetMetaElementsWithAttribute(WebDocument* document, | 255 void GetMetaElementsWithAttribute(WebDocument* document, |
| 256 const string16& attribute_name, | 256 const base::string16& attribute_name, |
| 257 const string16& attribute_value, | 257 const base::string16& attribute_value, |
| 258 std::vector<WebElement>* meta_elements) { | 258 std::vector<WebElement>* meta_elements) { |
| 259 DCHECK(document); | 259 DCHECK(document); |
| 260 DCHECK(meta_elements); | 260 DCHECK(meta_elements); |
| 261 meta_elements->clear(); | 261 meta_elements->clear(); |
| 262 WebElement head = document->head(); | 262 WebElement head = document->head(); |
| 263 if (head.isNull() || !head.hasChildNodes()) | 263 if (head.isNull() || !head.hasChildNodes()) |
| 264 return; | 264 return; |
| 265 | 265 |
| 266 WebNodeList children = head.childNodes(); | 266 WebNodeList children = head.childNodes(); |
| 267 for (size_t i = 0; i < children.length(); ++i) { | 267 for (size_t i = 0; i < children.length(); ++i) { |
| 268 WebNode node = children.item(i); | 268 WebNode node = children.item(i); |
| 269 if (!node.isElementNode()) | 269 if (!node.isElementNode()) |
| 270 continue; | 270 continue; |
| 271 WebElement element = node.to<WebElement>(); | 271 WebElement element = node.to<WebElement>(); |
| 272 if (!element.hasTagName("meta")) | 272 if (!element.hasTagName("meta")) |
| 273 continue; | 273 continue; |
| 274 WebString value = element.getAttribute(attribute_name); | 274 WebString value = element.getAttribute(attribute_name); |
| 275 if (value.isNull() || value != attribute_value) | 275 if (value.isNull() || value != attribute_value) |
| 276 continue; | 276 continue; |
| 277 meta_elements->push_back(element); | 277 meta_elements->push_back(element); |
| 278 } | 278 } |
| 279 } | 279 } |
| 280 | 280 |
| 281 } // webkit_glue | 281 } // webkit_glue |
| OLD | NEW |