Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: components/autofill/content/renderer/form_cache.cc

Issue 2424793002: Revert of Replace for loops with |arraysize| with for each loops (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/autofill/core/browser/address_i18n_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 (const char* str : deprecated) { 48 for (size_t i = 0; i < arraysize(deprecated); ++i) {
49 if (autocomplete_attribute.find(str) == std::string::npos) 49 if (autocomplete_attribute.find(deprecated[i]) == std::string::npos)
50 continue; 50 continue;
51 std::string msg = std::string("autocomplete='") + str + 51 std::string msg = std::string("autocomplete='") + deprecated[i] +
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
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
OLDNEW
« no previous file with comments | « no previous file | components/autofill/core/browser/address_i18n_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698