Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: components/autofill/browser/android/auxiliary_profile_loader_android.h

Issue 17392006: In components/autofill, move browser/ to core/browser/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to fix conflicts Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_AUTOFILL_BROWSER_ANDROID_AUXILIARY_PROFILE_LOADER_ANDROID_H_
6 #define COMPONENTS_AUTOFILL_BROWSER_ANDROID_AUXILIARY_PROFILE_LOADER_ANDROID_H_
7
8 #include <vector>
9
10 #include "base/android/jni_android.h"
11 #include "base/strings/string16.h"
12
13 namespace autofill {
14
15 bool RegisterAuxiliaryProfileLoader(JNIEnv* env);
16
17 // This class loads user's contact information from their device.
18 // The populated data corresponds to the user's 'Me' profile in their
19 // contact list.
20 class AuxiliaryProfileLoaderAndroid {
21 public:
22 AuxiliaryProfileLoaderAndroid();
23 virtual ~AuxiliaryProfileLoaderAndroid();
24
25 // Init method should be called after object initialization.
26 // context parameter is an Android context.
27 void Init(JNIEnv* env, const jobject& context);
28
29 // Returns true IFF the application has priviledges to access the user's
30 // contact information.
31 virtual bool GetHasPermissions() const;
32 // Returns address street.
33 virtual base::string16 GetStreet() const;
34 // Returns address post office box.
35 virtual base::string16 GetPostOfficeBox() const;
36 // Returns address neighborhood (e.g. Noe Valley, Nob Hill, Twin Peaks, ...).
37 virtual base::string16 GetNeighborhood() const;
38 // Returns address region such as state or province information
39 // (e.g. Ontario, California, Hubei).
40 virtual base::string16 GetRegion() const;
41 // Returns address city.
42 virtual base::string16 GetCity() const;
43 // Returns address postal code or zip code.
44 virtual base::string16 GetPostalCode() const;
45 // Returns address country.
46 virtual base::string16 GetCountry() const;
47
48 // Returns contact's first name.
49 virtual base::string16 GetFirstName() const;
50 // Returns contact's middle name.
51 virtual base::string16 GetMiddleName() const;
52 // Returns contact's last name.
53 virtual base::string16 GetLastName() const;
54 // Returns contact's suffix (e.g. Ph.D, M.D., ...).
55 virtual base::string16 GetSuffix() const;
56
57 // Populates string vector parameter with contact's email addresses.
58 virtual void GetEmailAddresses(
59 std::vector<base::string16>* email_addresses) const;
60
61 // Populates string vector parameter with contact's phones numbers.
62 virtual void GetPhoneNumbers(
63 std::vector<base::string16>* phone_numbers) const;
64
65 private:
66 JNIEnv* env_;
67 // The reference to java |PersonalAutofillPopulator| which
68 // actually extracts users contact information from the physical device
69 base::android::ScopedJavaLocalRef<jobject> populator_;
70 DISALLOW_COPY_AND_ASSIGN(AuxiliaryProfileLoaderAndroid);
71 };
72
73 } // namespace
74
75 #endif // COMPONENTS_AUTOFILL_BROWSER_ANDROID_AUXILIARY_PROFILE_LOADER_ANDROID_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698