OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_AUTOFILL_ANDROID_AUXILIARY_PROFILES_ANDROID_H_ | |
6 #define CHROME_BROWSER_AUTOFILL_ANDROID_AUXILIARY_PROFILES_ANDROID_H_ | |
7 | |
8 #include <jni.h> | |
9 #include <vector> | |
10 | |
11 #include "base/string16.h" | |
12 #include "chrome/browser/autofill/android/auxiliary_profile_loader_android.h" | |
13 | |
14 class AutofillProfile; | |
15 class AuxiliaryProfileLoader; | |
16 | |
17 namespace autofill { | |
18 | |
19 class AuxiliaryProfileLoader; | |
20 | |
21 } // namespace | |
Ilya Sherman
2013/03/05 00:42:38
nit: Write this as:
namespace autofill {
class Au
apiccion
2013/03/09 00:53:41
Done.
| |
22 | |
23 namespace autofill { | |
24 | |
25 class AuxiliaryProfilesAndroid { | |
Ilya Sherman
2013/03/05 00:42:38
Why do you need this class to be separate from the
apiccion
2013/03/09 00:53:41
Basically, I want to separate the JNI stuff (Auxil
| |
26 | |
27 // This class is used to populate an AutofillProfile vector with | |
28 // a 'default' auxiliary profile. It depends on an AuxiliaryProfileLoader | |
29 // object to provide contact information that is re-organized into an Autofill | |
30 // profile and injected into the vector. | |
Ilya Sherman
2013/03/05 00:42:38
nit: Comment belongs above the class.
apiccion
2013/03/09 00:53:41
Done.
| |
31 public: | |
32 | |
33 // Constructor takes in an AuxiliaryProfileLoader object whicht provides | |
Ilya Sherman
2013/03/05 00:42:38
nit: "whicht" -> "which"
Ilya Sherman
2013/03/05 00:42:38
nit: Drop "Constructor"
apiccion
2013/03/09 00:53:41
Done.
| |
34 // contact information methods. | |
35 explicit AuxiliaryProfilesAndroid( | |
36 const autofill::AuxiliaryProfileLoader& profileLoader); | |
Ilya Sherman
2013/03/05 00:42:38
nit: Use hacker_case.
apiccion
2013/03/09 00:53:41
Done.
| |
37 ~AuxiliaryProfilesAndroid(); | |
38 | |
39 // Mutates profiles vector injecting an autofill profile | |
40 // constructed from profileLoader. | |
41 void LoadContactsProfile(std::vector<AutofillProfile*>* profiles); | |
Ilya Sherman
2013/03/05 00:42:38
Why doesn't this method just return a scoped_ptr<A
apiccion
2013/03/09 00:53:41
Done.
| |
42 | |
43 private: | |
44 // Formats pobox and neighborhood into one string | |
45 // (e.g. to go into address line 2 on most forms) | |
46 string16 CollapseAddress(const string16& pobox, | |
Ilya Sherman
2013/03/05 00:42:38
nit: Spell out post_office_box.
apiccion
2013/03/09 00:53:41
Done.
| |
47 const string16& neighborhood); | |
Ilya Sherman
2013/03/05 00:42:38
nit: Can this be tucked into the anonymous namespa
apiccion
2013/03/09 00:53:41
Done.
| |
48 // inserts contact's address data into profile. | |
Ilya Sherman
2013/03/05 00:42:38
nit: Start the comment with an uppercase letter.
apiccion
2013/03/09 00:53:41
Done.
| |
49 void LoadAddress(AutofillProfile* profile); | |
50 // inserts contact's name data into profile. | |
51 void LoadName(AutofillProfile* profile); | |
52 // inserts contact's email address data into profile. | |
53 void LoadEmailAddress(AutofillProfile* profile); | |
54 // inserts contact's phone number data into profile. | |
55 void LoadPhoneNumbers(AutofillProfile* profile); | |
56 | |
57 const AuxiliaryProfileLoader& profile_loader_; | |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(AuxiliaryProfilesAndroid); | |
60 }; | |
61 | |
62 } // namespace | |
63 | |
64 #endif // CHROME_BROWSER_AUTOFILL_ANDROID_AUXILIARY_PROFILES_ANDROID_H_ | |
OLD | NEW |