| 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 #ifndef COMPONENTS_AUTOFILL_BROWSER_ANDROID_AUXILIARY_PROFILES_ANDROID_H_ | 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_ANDROID_AUXILIARY_PROFILES_ANDROID_H_ |
| 6 #define COMPONENTS_AUTOFILL_BROWSER_ANDROID_AUXILIARY_PROFILES_ANDROID_H_ | 6 #define COMPONENTS_AUTOFILL_BROWSER_ANDROID_AUXILIARY_PROFILES_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "components/autofill/browser/android/auxiliary_profile_loader_android.h
" | 13 #include "components/autofill/browser/android/auxiliary_profile_loader_android.h
" |
| 14 | 14 |
| 15 class AutofillProfile; | 15 class AutofillProfile; |
| 16 | 16 |
| 17 namespace autofill { | 17 namespace autofill { |
| 18 class AuxiliaryProfileLoaderAndroid; | 18 class AuxiliaryProfileLoaderAndroid; |
| 19 | 19 |
| 20 // This class is used to populate an AutofillProfile vector with | 20 // This class is used to populate an AutofillProfile vector with |
| 21 // a 'default' auxiliary profile. It depends on an | 21 // a 'default' auxiliary profile. It depends on an |
| 22 // AuxiliaryProfileLoaderAndroid object to provide contact information | 22 // AuxiliaryProfileLoaderAndroid object to provide contact information |
| 23 // that is re-organized into an Autofill profile. | 23 // that is re-organized into an Autofill profile. |
| 24 class AuxiliaryProfilesAndroid { | 24 class AuxiliaryProfilesAndroid { |
| 25 public: | 25 public: |
| 26 // Takes in an AuxiliaryProfileLoader object which provides contact | 26 // Takes in an AuxiliaryProfileLoader object which provides contact |
| 27 // information methods. | 27 // information methods. |
| 28 explicit AuxiliaryProfilesAndroid( | 28 AuxiliaryProfilesAndroid( |
| 29 const autofill::AuxiliaryProfileLoaderAndroid& profile_loader); | 29 const autofill::AuxiliaryProfileLoaderAndroid& profile_loader, |
| 30 const std::string& app_locale); |
| 30 ~AuxiliaryProfilesAndroid(); | 31 ~AuxiliaryProfilesAndroid(); |
| 31 | 32 |
| 32 // Returns autofill profile constructed from profile_loader_. | 33 // Returns autofill profile constructed from profile_loader_. |
| 33 scoped_ptr<AutofillProfile> LoadContactsProfile(); | 34 scoped_ptr<AutofillProfile> LoadContactsProfile(); |
| 34 | 35 |
| 35 private: | 36 private: |
| 36 // Inserts contact's address data into profile. | 37 // Inserts contact's address data into profile. |
| 37 void LoadAddress(AutofillProfile* profile); | 38 void LoadAddress(AutofillProfile* profile); |
| 38 // Inserts contact's name data into profile. | 39 // Inserts contact's name data into profile. |
| 39 void LoadName(AutofillProfile* profile); | 40 void LoadName(AutofillProfile* profile); |
| 40 // Inserts contact's email address data into profile. | 41 // Inserts contact's email address data into profile. |
| 41 void LoadEmailAddress(AutofillProfile* profile); | 42 void LoadEmailAddress(AutofillProfile* profile); |
| 42 // Inserts contact's phone number data into profile. | 43 // Inserts contact's phone number data into profile. |
| 43 void LoadPhoneNumbers(AutofillProfile* profile); | 44 void LoadPhoneNumbers(AutofillProfile* profile); |
| 44 | 45 |
| 45 const AuxiliaryProfileLoaderAndroid& profile_loader_; | 46 const AuxiliaryProfileLoaderAndroid& profile_loader_; |
| 47 std::string app_locale_; |
| 46 | 48 |
| 47 DISALLOW_COPY_AND_ASSIGN(AuxiliaryProfilesAndroid); | 49 DISALLOW_COPY_AND_ASSIGN(AuxiliaryProfilesAndroid); |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 } // namespace | 52 } // namespace |
| 51 | 53 |
| 52 #endif // COMPONENTS_AUTOFILL_BROWSER_ANDROID_AUXILIARY_PROFILES_ANDROID_H_ | 54 #endif // COMPONENTS_AUTOFILL_BROWSER_ANDROID_AUXILIARY_PROFILES_ANDROID_H_ |
| OLD | NEW |