Java Code Examples for org.chromium.chrome.browser.PasswordUIView#SavedPasswordEntry

The following examples show how to use org.chromium.chrome.browser.PasswordUIView#SavedPasswordEntry . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SavePasswordsPreferences.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public void passwordListAvailable(int count) {
    resetList(PREF_CATEGORY_SAVED_PASSWORDS);
    mNoPasswords = count == 0;
    if (mNoPasswords) {
        if (mNoPasswordExceptions) displayEmptyScreenMessage();
        return;
    }

    displayManageAccountLink();

    PreferenceCategory profileCategory = new PreferenceCategory(getActivity());
    profileCategory.setKey(PREF_CATEGORY_SAVED_PASSWORDS);
    profileCategory.setTitle(R.string.section_saved_passwords);
    profileCategory.setOrder(ORDER_SAVED_PASSWORDS);
    getPreferenceScreen().addPreference(profileCategory);
    for (int i = 0; i < count; i++) {
        PasswordUIView.SavedPasswordEntry saved =
                mPasswordManagerHandler.getSavedPasswordEntry(i);
        PreferenceScreen screen = getPreferenceManager().createPreferenceScreen(getActivity());
        String url = saved.getUrl();
        String name = saved.getUserName();
        screen.setTitle(url);
        screen.setOnPreferenceClickListener(this);
        screen.setSummary(name);
        Bundle args = screen.getExtras();
        args.putString(PASSWORD_LIST_NAME, name);
        args.putString(PASSWORD_LIST_URL, url);
        args.putInt(PASSWORD_LIST_ID, i);
        profileCategory.addPreference(screen);
    }
}
 
Example 2
Source File: SavePasswordsPreferences.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public void passwordListAvailable(int count) {
    resetList(PREF_CATEGORY_SAVED_PASSWORDS);
    mNoPasswords = count == 0;
    if (mNoPasswords) {
        if (mNoPasswordExceptions) displayEmptyScreenMessage();
        return;
    }

    displayManageAccountLink();

    PreferenceCategory profileCategory = new PreferenceCategory(getActivity());
    profileCategory.setKey(PREF_CATEGORY_SAVED_PASSWORDS);
    profileCategory.setTitle(R.string.section_saved_passwords);
    profileCategory.setOrder(ORDER_SAVED_PASSWORDS);
    getPreferenceScreen().addPreference(profileCategory);
    for (int i = 0; i < count; i++) {
        PasswordUIView.SavedPasswordEntry saved =
                mPasswordManagerHandler.getSavedPasswordEntry(i);
        PreferenceScreen screen = getPreferenceManager().createPreferenceScreen(getActivity());
        String url = saved.getUrl();
        String name = saved.getUserName();
        screen.setTitle(url);
        screen.setOnPreferenceClickListener(this);
        screen.setSummary(name);
        Bundle args = screen.getExtras();
        args.putString(PASSWORD_LIST_NAME, name);
        args.putString(PASSWORD_LIST_URL, url);
        args.putInt(PASSWORD_LIST_ID, i);
        profileCategory.addPreference(screen);
    }
}
 
Example 3
Source File: SavePasswordsPreferences.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void passwordListAvailable(int count) {
    resetList(PREF_CATEGORY_SAVED_PASSWORDS);
    resetList(PREF_CATEGORY_SAVED_PASSWORDS_NO_TEXT);

    mNoPasswords = count == 0;
    if (mNoPasswords) {
        if (mNoPasswordExceptions) displayEmptyScreenMessage();
        return;
    }

    displayManageAccountLink();

    PreferenceCategory profileCategory = new PreferenceCategory(getActivity());
    profileCategory.setKey(PREF_CATEGORY_SAVED_PASSWORDS);
    profileCategory.setTitle(R.string.section_saved_passwords);
    profileCategory.setOrder(ORDER_SAVED_PASSWORDS);
    getPreferenceScreen().addPreference(profileCategory);
    for (int i = 0; i < count; i++) {
        PasswordUIView.SavedPasswordEntry saved =
                mPasswordManagerHandler.getSavedPasswordEntry(i);
        PreferenceScreen screen = getPreferenceManager().createPreferenceScreen(getActivity());
        String url = saved.getUrl();
        String name = saved.getUserName();
        screen.setTitle(url);
        screen.setOnPreferenceClickListener(this);
        screen.setSummary(name);
        Bundle args = screen.getExtras();
        args.putString(PASSWORD_LIST_NAME, name);
        args.putString(PASSWORD_LIST_URL, url);
        args.putInt(PASSWORD_LIST_ID, i);
        profileCategory.addPreference(screen);
    }
}