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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java

Issue 2296943002: Fix Java PersonalDataManagerTest flake. (Closed)
Patch Set: Wait for init event only if not initialized yet. Created 4 years, 3 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
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillTestHelper.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 android.content.Context; 7 import android.content.Context;
8 8
9 import org.chromium.base.ThreadUtils; 9 import org.chromium.base.ThreadUtils;
10 import org.chromium.base.VisibleForTesting; 10 import org.chromium.base.VisibleForTesting;
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 private void personalDataChanged() { 491 private void personalDataChanged() {
492 ThreadUtils.assertOnUiThread(); 492 ThreadUtils.assertOnUiThread();
493 for (PersonalDataManagerObserver observer : mDataObservers) { 493 for (PersonalDataManagerObserver observer : mDataObservers) {
494 observer.onPersonalDataChanged(); 494 observer.onPersonalDataChanged();
495 } 495 }
496 } 496 }
497 497
498 /** 498 /**
499 * Registers a PersonalDataManagerObserver on the native side. 499 * Registers a PersonalDataManagerObserver on the native side.
500 */ 500 */
501 public void registerDataObserver(PersonalDataManagerObserver observer) { 501 public boolean registerDataObserver(PersonalDataManagerObserver observer) {
502 ThreadUtils.assertOnUiThread(); 502 ThreadUtils.assertOnUiThread();
503 assert !mDataObservers.contains(observer); 503 assert !mDataObservers.contains(observer);
504 mDataObservers.add(observer); 504 mDataObservers.add(observer);
505 return nativeIsDataLoaded(mPersonalDataManagerAndroid);
505 } 506 }
506 507
507 /** 508 /**
508 * Unregisters the provided observer. 509 * Unregisters the provided observer.
509 */ 510 */
510 public void unregisterDataObserver(PersonalDataManagerObserver observer) { 511 public void unregisterDataObserver(PersonalDataManagerObserver observer) {
511 ThreadUtils.assertOnUiThread(); 512 ThreadUtils.assertOnUiThread();
512 assert (mDataObservers.size() > 0); 513 assert (mDataObservers.size() > 0);
513 assert (mDataObservers.contains(observer)); 514 assert (mDataObservers.contains(observer));
514 mDataObservers.remove(observer); 515 mDataObservers.remove(observer);
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 748
748 /** 749 /**
749 * Enables or disables the Payments integration. 750 * Enables or disables the Payments integration.
750 * @param enable True to enable Payments data import. 751 * @param enable True to enable Payments data import.
751 */ 752 */
752 public static void setPaymentsIntegrationEnabled(boolean enable) { 753 public static void setPaymentsIntegrationEnabled(boolean enable) {
753 nativeSetPaymentsIntegrationEnabled(enable); 754 nativeSetPaymentsIntegrationEnabled(enable);
754 } 755 }
755 756
756 private native long nativeInit(); 757 private native long nativeInit();
758 private native boolean nativeIsDataLoaded(long nativePersonalDataManagerAndr oid);
757 private native String[] nativeGetProfileGUIDsForSettings(long nativePersonal DataManagerAndroid); 759 private native String[] nativeGetProfileGUIDsForSettings(long nativePersonal DataManagerAndroid);
758 private native String[] nativeGetProfileGUIDsToSuggest(long nativePersonalDa taManagerAndroid); 760 private native String[] nativeGetProfileGUIDsToSuggest(long nativePersonalDa taManagerAndroid);
759 private native String[] nativeGetProfileLabelsForSettings( 761 private native String[] nativeGetProfileLabelsForSettings(
760 long nativePersonalDataManagerAndroid); 762 long nativePersonalDataManagerAndroid);
761 private native String[] nativeGetProfileLabelsToSuggest(long nativePersonalD ataManagerAndroid, 763 private native String[] nativeGetProfileLabelsToSuggest(long nativePersonalD ataManagerAndroid,
762 boolean includeName); 764 boolean includeName);
763 private native AutofillProfile nativeGetProfileByGUID(long nativePersonalDat aManagerAndroid, 765 private native AutofillProfile nativeGetProfileByGUID(long nativePersonalDat aManagerAndroid,
764 String guid); 766 String guid);
765 private native String nativeSetProfile(long nativePersonalDataManagerAndroid , 767 private native String nativeSetProfile(long nativePersonalDataManagerAndroid ,
766 AutofillProfile profile); 768 AutofillProfile profile);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 long nativePersonalDataManagerAndroid, String guid); 806 long nativePersonalDataManagerAndroid, String guid);
805 private native void nativeGetFullCardForPaymentRequest(long nativePersonalDa taManagerAndroid, 807 private native void nativeGetFullCardForPaymentRequest(long nativePersonalDa taManagerAndroid,
806 WebContents webContents, CreditCard card, FullCardRequestDelegate de legate); 808 WebContents webContents, CreditCard card, FullCardRequestDelegate de legate);
807 private static native boolean nativeIsAutofillEnabled(); 809 private static native boolean nativeIsAutofillEnabled();
808 private static native void nativeSetAutofillEnabled(boolean enable); 810 private static native void nativeSetAutofillEnabled(boolean enable);
809 private static native boolean nativeIsAutofillManaged(); 811 private static native boolean nativeIsAutofillManaged();
810 private static native boolean nativeIsPaymentsIntegrationEnabled(); 812 private static native boolean nativeIsPaymentsIntegrationEnabled();
811 private static native void nativeSetPaymentsIntegrationEnabled(boolean enabl e); 813 private static native void nativeSetPaymentsIntegrationEnabled(boolean enabl e);
812 private static native String nativeToCountryCode(String countryName); 814 private static native String nativeToCountryCode(String countryName);
813 } 815 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillTestHelper.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698