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 package org.chromium.chrome.browser.autofill; | 5 package org.chromium.chrome.browser.autofill; |
6 | 6 |
7 import org.chromium.base.ThreadUtils; | 7 import org.chromium.base.ThreadUtils; |
8 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; | 8 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; |
9 import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; | 9 import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; |
10 import org.chromium.chrome.browser.autofill.PersonalDataManager.PersonalDataMana
gerObserver; | 10 import org.chromium.chrome.browser.autofill.PersonalDataManager.PersonalDataMana
gerObserver; |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 AutofillProfile getProfile(final String guid) throws ExecutionException { | 39 AutofillProfile getProfile(final String guid) throws ExecutionException { |
40 return ThreadUtils.runOnUiThreadBlocking(new Callable<AutofillProfile>()
{ | 40 return ThreadUtils.runOnUiThreadBlocking(new Callable<AutofillProfile>()
{ |
41 @Override | 41 @Override |
42 public AutofillProfile call() { | 42 public AutofillProfile call() { |
43 return PersonalDataManager.getInstance().getProfile(guid); | 43 return PersonalDataManager.getInstance().getProfile(guid); |
44 } | 44 } |
45 }); | 45 }); |
46 } | 46 } |
47 | 47 |
48 List<AutofillProfile> getProfilesToSuggest(final boolean includeName) throws | 48 List<AutofillProfile> getProfilesToSuggest(final boolean includeNameInLabel)
throws |
49 ExecutionException { | 49 ExecutionException { |
50 return ThreadUtils.runOnUiThreadBlocking(new Callable<List<AutofillProfi
le>>() { | 50 return ThreadUtils.runOnUiThreadBlocking(new Callable<List<AutofillProfi
le>>() { |
51 @Override | 51 @Override |
52 public List<AutofillProfile> call() { | 52 public List<AutofillProfile> call() { |
53 return PersonalDataManager.getInstance().getProfilesToSuggest(in
cludeName); | 53 return PersonalDataManager.getInstance().getProfilesToSuggest(in
cludeNameInLabel); |
54 } | 54 } |
55 }); | 55 }); |
56 } | 56 } |
57 | 57 |
58 List<AutofillProfile> getProfilesForSettings() throws ExecutionException { | 58 List<AutofillProfile> getProfilesForSettings() throws ExecutionException { |
59 return ThreadUtils.runOnUiThreadBlocking(new Callable<List<AutofillProfi
le>>() { | 59 return ThreadUtils.runOnUiThreadBlocking(new Callable<List<AutofillProfi
le>>() { |
60 @Override | 60 @Override |
61 public List<AutofillProfile> call() { | 61 public List<AutofillProfile> call() { |
62 return PersonalDataManager.getInstance().getProfilesForSettings(
); | 62 return PersonalDataManager.getInstance().getProfilesForSettings(
); |
63 } | 63 } |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 }); | 350 }); |
351 } | 351 } |
352 }); | 352 }); |
353 if (isDataLoaded) return; | 353 if (isDataLoaded) return; |
354 mOnPersonalDataChangedHelper.waitForCallback(callCount); | 354 mOnPersonalDataChangedHelper.waitForCallback(callCount); |
355 } catch (TimeoutException | InterruptedException | ExecutionException e)
{ | 355 } catch (TimeoutException | InterruptedException | ExecutionException e)
{ |
356 throw new AssertionError(e); | 356 throw new AssertionError(e); |
357 } | 357 } |
358 } | 358 } |
359 } | 359 } |
OLD | NEW |