org.chromium.chrome.browser.preferences.PreferencesLauncher Java Examples

The following examples show how to use org.chromium.chrome.browser.preferences.PreferencesLauncher. 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: PaymentRequestImpl.java    From delion with Apache License 2.0 6 votes vote down vote up
@Override
public boolean onSectionAddOption(
        @PaymentRequestUI.DataType int optionType, Callback<PaymentInformation> callback) {
    if (optionType == PaymentRequestUI.TYPE_SHIPPING_ADDRESSES) {
        editAddress(null);

        if (mMerchantNeedsShippingAddress) {
            mPaymentInformationCallback = callback;
            return true;
        }
    } else if (optionType == PaymentRequestUI.TYPE_CONTACT_DETAILS) {
        editContact(null);
    } else if (optionType == PaymentRequestUI.TYPE_PAYMENT_METHODS) {
        PreferencesLauncher.launchSettingsPage(
                mContext, AutofillLocalCardEditor.class.getName());
    }

    return false;
}
 
Example #2
Source File: AccountSigninActivity.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
public void onAccountSelected(
        final String accountName, boolean isDefaultAccount, final boolean settingsClicked) {
    final Context context = this;
    SigninManager.get(this).signIn(accountName, this, new SignInCallback() {
        @Override
        public void onSignInComplete() {
            if (settingsClicked) {
                Intent intent = PreferencesLauncher.createIntentForSettingsPage(
                        context, AccountManagementFragment.class.getName());
                startActivity(intent);
            }

            finish();
        }

        @Override
        public void onSignInAborted() {}
    });
}
 
Example #3
Source File: SigninAndSyncView.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
private ViewState getStateForEnableChromeSync() {
    int descId = mAccessPoint == SigninAccessPoint.BOOKMARK_MANAGER
            ? R.string.bookmarks_sync_promo_enable_sync
            : R.string.recent_tabs_sync_promo_enable_chrome_sync;

    ButtonState positiveButton = new ButtonPresent(
            R.string.enable_sync_button,
            new OnClickListener() {
                @Override
                public void onClick(View v) {
                    PreferencesLauncher.launchSettingsPage(getContext(),
                            SyncCustomizationFragment.class.getName());
                }
            });

    return new ViewState(descId, positiveButton, new ButtonAbsent());
}
 
Example #4
Source File: SigninAndSyncView.java    From 365browser with Apache License 2.0 6 votes vote down vote up
private ViewState getStateForEnableChromeSync() {
    int descId = mAccessPoint == SigninAccessPoint.BOOKMARK_MANAGER
            ? R.string.bookmarks_sync_promo_enable_sync
            : R.string.recent_tabs_sync_promo_enable_chrome_sync;

    ButtonState positiveButton = new ButtonPresent(
            R.string.enable_sync_button,
            new OnClickListener() {
                @Override
                public void onClick(View v) {
                    PreferencesLauncher.launchSettingsPage(getContext(),
                            SyncCustomizationFragment.class.getName());
                }
            });

    return new ViewState(descId, positiveButton, new ButtonAbsent());
}
 
Example #5
Source File: SigninAndSyncView.java    From delion with Apache License 2.0 6 votes vote down vote up
private ViewState getStateForEnableChromeSync() {
    int descId = mAccessPoint == SigninAccessPoint.BOOKMARK_MANAGER
            ? R.string.bookmarks_sync_promo_enable_sync
            : R.string.recent_tabs_sync_promo_enable_chrome_sync;

    ButtonState positiveButton = new ButtonPresent(
            R.string.enable_sync_button,
            new OnClickListener() {
                @Override
                public void onClick(View v) {
                    PreferencesLauncher.launchSettingsPage(getContext(),
                            SyncCustomizationFragment.class.getName());
                }
            });

    return new ViewState(descId, positiveButton, new ButtonAbsent());
}
 
Example #6
Source File: AccountSigninActivity.java    From delion with Apache License 2.0 6 votes vote down vote up
@Override
public void onAccountSelected(final String accountName, final boolean settingsClicked) {
    final Context context = this;
    SigninManager.get(this).signIn(accountName, this, new SignInCallback(){

        @Override
        public void onSignInComplete() {
            if (settingsClicked) {
                Intent intent = PreferencesLauncher.createIntentForSettingsPage(
                        context, AccountManagementFragment.class.getName());
                startActivity(intent);
            }

            finish();
        }

        @Override
        public void onSignInAborted() {}
    });
}
 
Example #7
Source File: AccountSigninActivity.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@Override
public void onAccountSelected(final String accountName, final boolean settingsClicked) {
    final Context context = this;
    SigninManager.get(this).signIn(accountName, this, new SignInCallback(){

        @Override
        public void onSignInComplete() {
            if (settingsClicked) {
                Intent intent = PreferencesLauncher.createIntentForSettingsPage(
                        context, AccountManagementFragment.class.getName());
                startActivity(intent);
            }

            finish();
        }

        @Override
        public void onSignInAborted() {}
    });
}
 
Example #8
Source File: ChromeApplication.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Opens the UI to clear browsing data.
 * @param tab The tab that triggered the request.
 */
@CalledByNative
protected void openClearBrowsingData(Tab tab) {
    Activity activity = tab.getWindowAndroid().getActivity().get();
    if (activity == null) {
        Log.e(TAG,
                "Attempting to open clear browsing data for a tab without a valid activity");
        return;
    }
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(activity,
            ClearBrowsingDataPreferences.class.getName());
    activity.startActivity(intent);
}
 
Example #9
Source File: ContextualSearchPromoControl.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Handles a click in the settings link located in the Promo.
 */
private void handleClickSettingsLink() {
    new Handler().post(new Runnable() {
        @Override
        public void run() {
            PreferencesLauncher.launchSettingsPage(getContext(),
                    ContextualSearchPreferenceFragment.class.getName());
        }
    });
}
 
Example #10
Source File: GeolocationSnackbarController.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public void onAction(Object actionData) {
    View view = (View) actionData;
    UiUtils.hideKeyboard(view);

    Context context = view.getContext();
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(
            context, SearchEnginePreference.class.getName());
    context.startActivity(intent);
}
 
Example #11
Source File: AccountManagementFragment.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Open the account management UI.
 * @param applicationContext An application context.
 * @param profile A user profile.
 * @param serviceType A signin::GAIAServiceType that triggered the dialog.
 */
public static void openAccountManagementScreen(
        Context applicationContext, Profile profile, int serviceType) {
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(applicationContext,
            AccountManagementFragment.class.getName());
    Bundle arguments = new Bundle();
    arguments.putInt(SHOW_GAIA_SERVICE_TYPE_EXTRA, serviceType);
    intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, arguments);
    applicationContext.startActivity(intent);
}
 
Example #12
Source File: SearchGeolocationDisclosureInfoBar.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@CalledByNative
private static void showSettingsPage(String searchUrl) {
    Context context = ContextUtils.getApplicationContext();
    Intent settingsIntent = PreferencesLauncher.createIntentForSettingsPage(
            context, SingleWebsitePreferences.class.getName());
    Bundle fragmentArgs = SingleWebsitePreferences.createFragmentArgsForSite(searchUrl);
    settingsIntent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs);
    IntentUtils.safeStartActivity(context, settingsIntent);
}
 
Example #13
Source File: PaymentRequestImpl.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void onCardAndAddressSettingsClicked() {
    Context context = ChromeActivity.fromWebContents(mWebContents);
    if (context == null) {
        mJourneyLogger.setAborted(AbortReason.OTHER);
        disconnectFromClientWithDebugMessage("Unable to find Chrome activity");
        return;
    }

    Intent intent = PreferencesLauncher.createIntentForSettingsPage(
            context, AutofillAndPaymentsPreferences.class.getName());
    context.startActivity(intent);
    mJourneyLogger.setAborted(AbortReason.ABORTED_BY_USER);
    disconnectFromClientWithDebugMessage("Card and address settings clicked");
}
 
Example #14
Source File: ContextualSearchPromoControl.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Handles a click in the settings link located in the Promo.
 */
private void handleClickSettingsLink() {
    new Handler().post(new Runnable() {
        @Override
        public void run() {
            PreferencesLauncher.launchSettingsPage(getContext(),
                    ContextualSearchPreferenceFragment.class.getName());
        }
    });
}
 
Example #15
Source File: LocaleManager.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void onAction(Object actionData) {
    Context context = ContextUtils.getApplicationContext();
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(context,
            SearchEnginePreference.class.getName());
    context.startActivity(intent);
}
 
Example #16
Source File: SogouPromoDialog.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void onClick(View widget) {
    mChoice = CHOICE_SETTINGS;
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(
            getContext(), SearchEnginePreference.class.getName());
    getContext().startActivity(intent);
    dismiss();
}
 
Example #17
Source File: GeolocationSnackbarController.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void onAction(Object actionData) {
    View view = (View) actionData;
    UiUtils.hideKeyboard(view);

    Context context = view.getContext();
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(
            context, SearchEnginePreference.class.getName());
    context.startActivity(intent);
}
 
Example #18
Source File: AccountManagementFragment.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Open the account management UI.
 * @param serviceType A signin::GAIAServiceType that triggered the dialog.
 */
public static void openAccountManagementScreen(int serviceType) {
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(
            ContextUtils.getApplicationContext(), AccountManagementFragment.class.getName());
    Bundle arguments = new Bundle();
    arguments.putInt(SHOW_GAIA_SERVICE_TYPE_EXTRA, serviceType);
    intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, arguments);
    ContextUtils.getApplicationContext().startActivity(intent);
}
 
Example #19
Source File: DataReductionMainMenuFooter.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public void onClick(View v) {
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(
            getContext(), DataReductionPreferences.class.getName());
    RecordUserAction.record("MobileMenuDataSaverOpened");
    intent.putExtra(DataReductionPreferences.FROM_MAIN_MENU, true);
    getContext().startActivity(intent);
}
 
Example #20
Source File: SearchGeolocationDisclosureInfoBar.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@CalledByNative
private static void showSettingsPage(String searchUrl) {
    Context context = ContextUtils.getApplicationContext();
    Intent settingsIntent = PreferencesLauncher.createIntentForSettingsPage(
            context, SingleWebsitePreferences.class.getName());
    Bundle fragmentArgs = SingleWebsitePreferences.createFragmentArgsForSite(searchUrl);
    settingsIntent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs);
    IntentUtils.safeStartActivity(context, settingsIntent);
}
 
Example #21
Source File: SearchEnginePromoDialog.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public void onClick(View widget) {
    mChoice = CHOICE_SETTINGS;
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(getContext(),
            SearchEnginePreference.class.getName());
    getContext().startActivity(intent);
    dismiss();
}
 
Example #22
Source File: LocaleManager.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public void onAction(Object actionData) {
    Context context = ContextUtils.getApplicationContext();
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(context,
            SearchEnginePreference.class.getName());
    context.startActivity(intent);
}
 
Example #23
Source File: ContextualSearchPromoControl.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * Handles a click in the settings link located in the Promo.
 */
private void handleClickSettingsLink() {
    new Handler().post(new Runnable() {
        @Override
        public void run() {
            PreferencesLauncher.launchSettingsPage(getContext(),
                    ContextualSearchPreferenceFragment.class.getName());
        }
    });
}
 
Example #24
Source File: ChromeApplication.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Opens the single origin settings page for the given URL.
 *
 * @param url The URL to show the single origin settings for. This is a complete url
 *            including scheme, domain, port, path, etc.
 */
protected void showSingleOriginSettings(String url) {
    Bundle fragmentArgs = SingleWebsitePreferences.createFragmentArgsForSite(url);
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(
            this, SingleWebsitePreferences.class.getName());
    intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs);
    startActivity(intent);
}
 
Example #25
Source File: ChromeApplication.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Opens the UI to clear browsing data.
 * @param tab The tab that triggered the request.
 */
@CalledByNative
protected void openClearBrowsingData(Tab tab) {
    Activity activity = tab.getWindowAndroid().getActivity().get();
    if (activity == null) {
        Log.e(TAG,
                "Attempting to open clear browsing data for a tab without a valid activity");
        return;
    }
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(activity,
            ClearBrowsingDataPreferences.class.getName());
    activity.startActivity(intent);
}
 
Example #26
Source File: GeolocationSnackbarController.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public void onAction(Object actionData) {
    View view = (View) actionData;
    UiUtils.hideKeyboard(view);

    Context context = view.getContext();
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(context, null);
    Bundle fragmentArgs = new Bundle();
    fragmentArgs.putBoolean(MainPreferences.EXTRA_SHOW_SEARCH_ENGINE_PICKER, true);
    intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs);
    context.startActivity(intent);
}
 
Example #27
Source File: AccountManagementFragment.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * Open the account management UI.
 * @param applicationContext An application context.
 * @param profile A user profile.
 * @param serviceType A signin::GAIAServiceType that triggered the dialog.
 */
public static void openAccountManagementScreen(
        Context applicationContext, Profile profile, int serviceType) {
    Intent intent = PreferencesLauncher.createIntentForSettingsPage(applicationContext,
            AccountManagementFragment.class.getName());
    Bundle arguments = new Bundle();
    arguments.putInt(SHOW_GAIA_SERVICE_TYPE_EXTRA, serviceType);
    intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, arguments);
    applicationContext.startActivity(intent);
}
 
Example #28
Source File: StatusListItem.java    From delion with Apache License 2.0 4 votes vote down vote up
@Override
protected void performAction(Context context) {
    PreferencesLauncher.launchSettingsPage(
            context, SyncCustomizationFragment.class.getName());
}
 
Example #29
Source File: HistoryManager.java    From 365browser with Apache License 2.0 4 votes vote down vote up
/**
 * Opens the clear browsing data preference.
 */
public void openClearBrowsingDataPreference() {
    recordUserAction("ClearBrowsingData");
    Intent intent = PreferencesLauncher.createIntentForClearBrowsingDataPage(mActivity);
    IntentUtils.safeStartActivity(mActivity, intent);
}
 
Example #30
Source File: ChromeApplication.java    From delion with Apache License 2.0 4 votes vote down vote up
@CalledByNative
protected void showAutofillSettings() {
    PreferencesLauncher.launchSettingsPage(this,
            AutofillPreferences.class.getName());
}