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/macros.h" | 8 #include "base/macros.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 namespace autofill { | 38 namespace autofill { |
39 | 39 |
40 namespace { | 40 namespace { |
41 | 41 |
42 void LogDeprecationMessages(const WebFormControlElement& element) { | 42 void LogDeprecationMessages(const WebFormControlElement& element) { |
43 std::string autocomplete_attribute = | 43 std::string autocomplete_attribute = |
44 base::UTF16ToUTF8(base::StringPiece16( | 44 base::UTF16ToUTF8(base::StringPiece16( |
45 element.getAttribute("autocomplete"))); | 45 element.getAttribute("autocomplete"))); |
46 | 46 |
47 static const char* const deprecated[] = { "region", "locality" }; | 47 static const char* const deprecated[] = { "region", "locality" }; |
48 for (size_t i = 0; i < arraysize(deprecated); ++i) { | 48 for (const char* str : deprecated) { |
49 if (autocomplete_attribute.find(deprecated[i]) == std::string::npos) | 49 if (autocomplete_attribute.find(str) == std::string::npos) |
50 continue; | 50 continue; |
51 std::string msg = std::string("autocomplete='") + deprecated[i] + | 51 std::string msg = std::string("autocomplete='") + str + |
52 "' is deprecated and will soon be ignored. See http://goo.gl/YjeSsW"; | 52 "' is deprecated and will soon be ignored. See http://goo.gl/YjeSsW"; |
53 WebConsoleMessage console_message = WebConsoleMessage( | 53 WebConsoleMessage console_message = WebConsoleMessage( |
54 WebConsoleMessage::LevelWarning, | 54 WebConsoleMessage::LevelWarning, |
55 WebString(base::ASCIIToUTF16(msg))); | 55 WebString(base::ASCIIToUTF16(msg))); |
56 element.document().frame()->addMessageToConsole(console_message); | 56 element.document().frame()->addMessageToConsole(console_message); |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 // Determines whether the form is interesting enough to send to the browser | 60 // Determines whether the form is interesting enough to send to the browser |
61 // for further operations. | 61 // for further operations. |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 const WebInputElement* input_element = toWebInputElement(&element); | 369 const WebInputElement* input_element = toWebInputElement(&element); |
370 if (form_util::IsCheckableElement(input_element)) { | 370 if (form_util::IsCheckableElement(input_element)) { |
371 initial_checked_state_.insert( | 371 initial_checked_state_.insert( |
372 std::make_pair(*input_element, input_element->isChecked())); | 372 std::make_pair(*input_element, input_element->isChecked())); |
373 } | 373 } |
374 } | 374 } |
375 } | 375 } |
376 } | 376 } |
377 | 377 |
378 } // namespace autofill | 378 } // namespace autofill |
OLD | NEW |