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/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "components/autofill/content/renderer/form_autofill_util.h" | 9 #include "components/autofill/content/renderer/form_autofill_util.h" |
10 #include "components/autofill/core/common/autofill_constants.h" | 10 #include "components/autofill/core/common/autofill_constants.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 if (base::string16(element->nameForAutofill()) != | 283 if (base::string16(element->nameForAutofill()) != |
284 form.data.fields[i].name) { | 284 form.data.fields[i].name) { |
285 // Keep things simple. Don't show predictions for elements whose names | 285 // Keep things simple. Don't show predictions for elements whose names |
286 // were modified between page load and the server's response to our query. | 286 // were modified between page load and the server's response to our query. |
287 continue; | 287 continue; |
288 } | 288 } |
289 | 289 |
290 std::string placeholder = form.fields[i].overall_type; | 290 std::string placeholder = form.fields[i].overall_type; |
291 base::string16 title = l10n_util::GetStringFUTF16( | 291 base::string16 title = l10n_util::GetStringFUTF16( |
292 IDS_AUTOFILL_SHOW_PREDICTIONS_TITLE, | 292 IDS_AUTOFILL_SHOW_PREDICTIONS_TITLE, |
293 UTF8ToUTF16(form.fields[i].heuristic_type), | 293 base::UTF8ToUTF16(form.fields[i].heuristic_type), |
294 UTF8ToUTF16(form.fields[i].server_type), | 294 base::UTF8ToUTF16(form.fields[i].server_type), |
295 UTF8ToUTF16(form.fields[i].signature), | 295 base::UTF8ToUTF16(form.fields[i].signature), |
296 UTF8ToUTF16(form.signature), | 296 base::UTF8ToUTF16(form.signature), |
297 UTF8ToUTF16(form.experiment_id)); | 297 base::UTF8ToUTF16(form.experiment_id)); |
298 if (!element->hasAttribute("placeholder")) | 298 if (!element->hasAttribute("placeholder")) { |
299 element->setAttribute("placeholder", WebString(UTF8ToUTF16(placeholder))); | 299 element->setAttribute("placeholder", |
| 300 WebString(base::UTF8ToUTF16(placeholder))); |
| 301 } |
300 element->setAttribute("title", WebString(title)); | 302 element->setAttribute("title", WebString(title)); |
301 } | 303 } |
302 | 304 |
303 return true; | 305 return true; |
304 } | 306 } |
305 | 307 |
306 } // namespace autofill | 308 } // namespace autofill |
OLD | NEW |