Index: chrome/browser/autofill/android/auxiliary_profiles_android.h |
diff --git a/chrome/browser/autofill/android/auxiliary_profiles_android.h b/chrome/browser/autofill/android/auxiliary_profiles_android.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..87d0b40ce2cbdb0fdf20bf97fd90eb876a39f585 |
--- /dev/null |
+++ b/chrome/browser/autofill/android/auxiliary_profiles_android.h |
@@ -0,0 +1,64 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_AUTOFILL_ANDROID_AUXILIARY_PROFILES_ANDROID_H_ |
+#define CHROME_BROWSER_AUTOFILL_ANDROID_AUXILIARY_PROFILES_ANDROID_H_ |
+ |
+#include <jni.h> |
+#include <vector> |
+ |
+#include "base/string16.h" |
+#include "chrome/browser/autofill/android/auxiliary_profile_loader_android.h" |
+ |
+class AutofillProfile; |
+class AuxiliaryProfileLoader; |
+ |
+namespace autofill { |
+ |
+ class AuxiliaryProfileLoader; |
+ |
+} // 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.
|
+ |
+namespace autofill { |
+ |
+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
|
+ |
+ // This class is used to populate an AutofillProfile vector with |
+ // a 'default' auxiliary profile. It depends on an AuxiliaryProfileLoader |
+ // object to provide contact information that is re-organized into an Autofill |
+ // 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.
|
+ public: |
+ |
+ // 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.
|
+ // contact information methods. |
+ explicit AuxiliaryProfilesAndroid( |
+ const autofill::AuxiliaryProfileLoader& profileLoader); |
Ilya Sherman
2013/03/05 00:42:38
nit: Use hacker_case.
apiccion
2013/03/09 00:53:41
Done.
|
+ ~AuxiliaryProfilesAndroid(); |
+ |
+ // Mutates profiles vector injecting an autofill profile |
+ // constructed from profileLoader. |
+ 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.
|
+ |
+ private: |
+ // Formats pobox and neighborhood into one string |
+ // (e.g. to go into address line 2 on most forms) |
+ 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.
|
+ 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.
|
+ // 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.
|
+ void LoadAddress(AutofillProfile* profile); |
+ // inserts contact's name data into profile. |
+ void LoadName(AutofillProfile* profile); |
+ // inserts contact's email address data into profile. |
+ void LoadEmailAddress(AutofillProfile* profile); |
+ // inserts contact's phone number data into profile. |
+ void LoadPhoneNumbers(AutofillProfile* profile); |
+ |
+ const AuxiliaryProfileLoader& profile_loader_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AuxiliaryProfilesAndroid); |
+}; |
+ |
+} // namespace |
+ |
+#endif // CHROME_BROWSER_AUTOFILL_ANDROID_AUXILIARY_PROFILES_ANDROID_H_ |