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/password_autofill_agent.h" | 5 #include "components/autofill/content/renderer/password_autofill_agent.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 FieldPropertiesMask added_flags, | 360 FieldPropertiesMask added_flags, |
361 FieldValueAndPropertiesMaskMap* field_value_and_properties_map) { | 361 FieldValueAndPropertiesMaskMap* field_value_and_properties_map) { |
362 FieldValueAndPropertiesMaskMap::iterator it = | 362 FieldValueAndPropertiesMaskMap::iterator it = |
363 field_value_and_properties_map->find(element); | 363 field_value_and_properties_map->find(element); |
364 if (it != field_value_and_properties_map->end()) { | 364 if (it != field_value_and_properties_map->end()) { |
365 if (value) | 365 if (value) |
366 it->second.first.reset(new base::string16(*value)); | 366 it->second.first.reset(new base::string16(*value)); |
367 it->second.second |= added_flags; | 367 it->second.second |= added_flags; |
368 } else { | 368 } else { |
369 (*field_value_and_properties_map)[element] = std::make_pair( | 369 (*field_value_and_properties_map)[element] = std::make_pair( |
370 value ? base::WrapUnique(new base::string16(*value)) : nullptr, | 370 value ? base::MakeUnique<base::string16>(*value) : nullptr, |
371 added_flags); | 371 added_flags); |
372 } | 372 } |
373 } | 373 } |
374 | 374 |
375 // This function attempts to fill |username_element| and |password_element| | 375 // This function attempts to fill |username_element| and |password_element| |
376 // with values from |fill_data|. The |password_element| will only have the | 376 // with values from |fill_data|. The |password_element| will only have the |
377 // suggestedValue set, and will be registered for copying that to the real | 377 // suggestedValue set, and will be registered for copying that to the real |
378 // value through |registration_callback|. If a match is found, return true and | 378 // value through |registration_callback|. If a match is found, return true and |
379 // |field_value_and_properties_map| will be modified with the autofilled | 379 // |field_value_and_properties_map| will be modified with the autofilled |
380 // credentials and |FieldPropertiesFlags::AUTOFILLED| flag. | 380 // credentials and |FieldPropertiesFlags::AUTOFILLED| flag. |
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 !(provisionally_saved_form_->password_value.empty() && | 1493 !(provisionally_saved_form_->password_value.empty() && |
1494 provisionally_saved_form_->new_password_value.empty()); | 1494 provisionally_saved_form_->new_password_value.empty()); |
1495 } | 1495 } |
1496 | 1496 |
1497 const mojom::AutofillDriverPtr& PasswordAutofillAgent::GetAutofillDriver() { | 1497 const mojom::AutofillDriverPtr& PasswordAutofillAgent::GetAutofillDriver() { |
1498 DCHECK(autofill_agent_); | 1498 DCHECK(autofill_agent_); |
1499 return autofill_agent_->GetAutofillDriver(); | 1499 return autofill_agent_->GetAutofillDriver(); |
1500 } | 1500 } |
1501 | 1501 |
1502 } // namespace autofill | 1502 } // namespace autofill |
OLD | NEW |