OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/autofill/content/renderer/form_cache.h" | 5 #include "components/autofill/content/renderer/form_cache.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "components/autofill/content/renderer/form_autofill_util.h" | 10 #include "components/autofill/content/renderer/form_autofill_util.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 using blink::WebString; | 36 using blink::WebString; |
37 using blink::WebTextAreaElement; | 37 using blink::WebTextAreaElement; |
38 using blink::WebVector; | 38 using blink::WebVector; |
39 | 39 |
40 namespace autofill { | 40 namespace autofill { |
41 | 41 |
42 namespace { | 42 namespace { |
43 | 43 |
44 void LogDeprecationMessages(const WebFormControlElement& element) { | 44 void LogDeprecationMessages(const WebFormControlElement& element) { |
45 std::string autocomplete_attribute = | 45 std::string autocomplete_attribute = |
46 base::UTF16ToUTF8(element.getAttribute("autocomplete")); | 46 base::UTF16ToUTF8(base::StringPiece16( |
| 47 element.getAttribute("autocomplete"))); |
47 | 48 |
48 static const char* const deprecated[] = { "region", "locality" }; | 49 static const char* const deprecated[] = { "region", "locality" }; |
49 for (size_t i = 0; i < arraysize(deprecated); ++i) { | 50 for (size_t i = 0; i < arraysize(deprecated); ++i) { |
50 if (autocomplete_attribute.find(deprecated[i]) == std::string::npos) | 51 if (autocomplete_attribute.find(deprecated[i]) == std::string::npos) |
51 continue; | 52 continue; |
52 std::string msg = std::string("autocomplete='") + deprecated[i] + | 53 std::string msg = std::string("autocomplete='") + deprecated[i] + |
53 "' is deprecated and will soon be ignored. See http://goo.gl/YjeSsW"; | 54 "' is deprecated and will soon be ignored. See http://goo.gl/YjeSsW"; |
54 WebConsoleMessage console_message = WebConsoleMessage( | 55 WebConsoleMessage console_message = WebConsoleMessage( |
55 WebConsoleMessage::LevelWarning, | 56 WebConsoleMessage::LevelWarning, |
56 WebString(base::ASCIIToUTF16(msg))); | 57 WebString(base::ASCIIToUTF16(msg))); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 const WebInputElement* input_element = toWebInputElement(&element); | 335 const WebInputElement* input_element = toWebInputElement(&element); |
335 if (IsCheckableElement(input_element)) { | 336 if (IsCheckableElement(input_element)) { |
336 initial_checked_state_.insert( | 337 initial_checked_state_.insert( |
337 std::make_pair(*input_element, input_element->isChecked())); | 338 std::make_pair(*input_element, input_element->isChecked())); |
338 } | 339 } |
339 } | 340 } |
340 } | 341 } |
341 } | 342 } |
342 | 343 |
343 } // namespace autofill | 344 } // namespace autofill |
OLD | NEW |