org.chromium.chrome.browser.help.HelpAndFeedback Java Examples

The following examples show how to use org.chromium.chrome.browser.help.HelpAndFeedback. 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: LanguagePreferences.java    From delion with Apache License 2.0 6 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int itemId = item.getItemId();
    if (itemId == R.id.menu_id_targeted_help) {
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_translate),
                        Profile.getLastUsedProfile(), null);
        return true;
    } else if (itemId == R.id.menu_id_reset) {
        PrefServiceBridge.getInstance().resetTranslateDefaults();
        Toast.makeText(getActivity(), getString(
                R.string.translate_prefs_toast_description),
                Toast.LENGTH_SHORT).show();
        return true;
    }
    return false;
}
 
Example #2
Source File: TranslatePreferences.java    From AndroidChromium with Apache License 2.0 6 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int itemId = item.getItemId();
    if (itemId == R.id.menu_id_targeted_help) {
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_translate),
                        Profile.getLastUsedProfile(), null);
        return true;
    } else if (itemId == R.id.menu_id_reset) {
        PrefServiceBridge.getInstance().resetTranslateDefaults();
        Toast.makeText(getActivity(), getString(
                R.string.translate_prefs_toast_description),
                Toast.LENGTH_SHORT).show();
        return true;
    }
    return false;
}
 
Example #3
Source File: TranslatePreferences.java    From 365browser with Apache License 2.0 6 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int itemId = item.getItemId();
    if (itemId == R.id.menu_id_targeted_help) {
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_translate),
                        Profile.getLastUsedProfile(), null);
        return true;
    } else if (itemId == R.id.menu_id_reset) {
        PrefServiceBridge.getInstance().resetTranslateDefaults();
        Toast.makeText(getActivity(), getString(
                R.string.translate_prefs_toast_description),
                Toast.LENGTH_SHORT).show();
        return true;
    }
    return false;
}
 
Example #4
Source File: DataReductionPreferences.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_data_reduction),
                        Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #5
Source File: Preferences.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == android.R.id.home) {
        finish();
        return true;
    } else if (item.getItemId() == R.id.menu_id_general_help) {
        HelpAndFeedback.getInstance(this).show(this, getString(R.string.help_context_settings),
                Profile.getLastUsedProfile(), null);
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 
Example #6
Source File: PassphraseCreationDialogFragment.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
private SpannableString getInstructionsText() {
    final Activity activity = getActivity();
    return SpanApplier.applySpans(
            activity.getString(R.string.sync_custom_passphrase),
            new SpanInfo("<learnmore>", "</learnmore>", new ClickableSpan() {
                @Override
                public void onClick(View view) {
                    HelpAndFeedback.getInstance(activity).show(activity,
                            activity.getString(R.string.help_context_change_sync_passphrase),
                            Profile.getLastUsedProfile(), null);
                }
            }));
}
 
Example #7
Source File: VrShellDelegate.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private static void startFeedback(Tab tab) {
    // TODO(ymalik): This call will connect to the Google Services api which can be slow. Can we
    // connect to it beforehand when we know that we'll be prompting for feedback?
    HelpAndFeedback.getInstance(tab.getActivity())
            .showFeedback(tab.getActivity(), tab.getProfile(), tab.getUrl(),
                    ContextUtils.getApplicationContext().getPackageName() + "."
                            + FEEDBACK_REPORT_TYPE);
}
 
Example #8
Source File: IncognitoBottomSheetContent.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs a new IncognitoBottomSheetContent.
 * @param activity The {@link Activity} displaying this bottom sheet content.
 */
public IncognitoBottomSheetContent(final Activity activity) {
    LayoutInflater inflater = LayoutInflater.from(activity);
    mView = inflater.inflate(R.layout.incognito_bottom_sheet_content, null);

    View learnMore = mView.findViewById(R.id.learn_more);
    learnMore.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            HelpAndFeedback.getInstance(activity).show(activity,
                    activity.getString(R.string.help_context_incognito_learn_more),
                    Profile.getLastUsedProfile(), null);
        }
    });

    final FadingShadowView shadow = (FadingShadowView) mView.findViewById(R.id.shadow);
    shadow.init(
            ApiCompatibilityUtils.getColor(mView.getResources(), R.color.toolbar_shadow_color),
            FadingShadow.POSITION_TOP);

    mScrollView = (ScrollView) mView.findViewById(R.id.scroll_view);
    mScrollView.getViewTreeObserver().addOnScrollChangedListener(new OnScrollChangedListener() {
        @Override
        public void onScrollChanged() {
            boolean shadowVisible = mScrollView.canScrollVertically(-1);
            shadow.setVisibility(shadowVisible ? View.VISIBLE : View.GONE);
        }
    });
}
 
Example #9
Source File: UsbChooserPreferences.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_settings),
                        Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #10
Source File: SingleCategoryPreferences.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        int helpContextResId = R.string.help_context_settings;
        if (mCategory.showProtectedMediaSites()) {
            helpContextResId = R.string.help_context_protected_content;
        }
        HelpAndFeedback.getInstance(getActivity()).show(
                getActivity(), getString(helpContextResId), Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #11
Source File: UsbDevicePreferences.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_settings),
                        Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #12
Source File: ContentSuggestionsPreferences.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        // TODO(dgn): The help page needs to be added and the context reserved.
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_suggestions),
                        Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #13
Source File: PrivacyPreferences.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_privacy),
                        Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #14
Source File: ClearBrowsingDataPreferences.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Set the texts that notify the user about data in their google account and that deleting
 * cookies doesn't sign you out of chrome.
 */
protected void initFootnote() {
    // The general information footnote informs users about data that will not be deleted.
    // If the user is signed in, it also informs users about the behavior of synced deletions.
    // and we show an additional Google-specific footnote. This footnote informs users that they
    // will not be signed out of their Google account, and if the web history service indicates
    // that they have other forms of browsing history, then also about that.
    TextMessageWithLinkAndIconPreference google_summary =
            (TextMessageWithLinkAndIconPreference) findPreference(PREF_GOOGLE_SUMMARY);
    TextMessageWithLinkAndIconPreference general_summary =
            (TextMessageWithLinkAndIconPreference) findPreference(PREF_GENERAL_SUMMARY);

    google_summary.setLinkClickDelegate(new Runnable() {
        @Override
        public void run() {
            new TabDelegate(false /* incognito */).launchUrl(
                    WEB_HISTORY_URL, TabLaunchType.FROM_CHROME_UI);
        }
    });
    general_summary.setLinkClickDelegate(new Runnable() {
        @Override
        public void run() {
            HelpAndFeedback.getInstance(getActivity()).show(
                    getActivity(),
                    getResources().getString(R.string.help_context_clear_browsing_data),
                    Profile.getLastUsedProfile(),
                    null);
        }
    });
    if (ChromeSigninController.get().isSignedIn()) {
        general_summary.setSummary(
                R.string.clear_browsing_data_footnote_sync_and_site_settings);
    } else {
        getPreferenceScreen().removePreference(google_summary);
        general_summary.setSummary(R.string.clear_browsing_data_footnote_site_settings);
    }
}
 
Example #15
Source File: DataReductionPreferences.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_data_reduction),
                        Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #16
Source File: Preferences.java    From 365browser with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == android.R.id.home) {
        finish();
        return true;
    } else if (item.getItemId() == R.id.menu_id_general_help) {
        HelpAndFeedback.getInstance(this).show(this, getString(R.string.help_context_settings),
                Profile.getLastUsedProfile(), null);
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 
Example #17
Source File: PassphraseCreationDialogFragment.java    From 365browser with Apache License 2.0 5 votes vote down vote up
private SpannableString getInstructionsText() {
    final Activity activity = getActivity();
    return SpanApplier.applySpans(
            activity.getString(R.string.sync_custom_passphrase),
            new SpanInfo("<learnmore>", "</learnmore>", new ClickableSpan() {
                @Override
                public void onClick(View view) {
                    HelpAndFeedback.getInstance(activity).show(activity,
                            activity.getString(R.string.help_context_change_sync_passphrase),
                            Profile.getLastUsedProfile(), null);
                }
            }));
}
 
Example #18
Source File: ChromeActivity.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Shows HelpAndFeedback and records the user action as well.
 * @param currentTab The tab that the user is currently on.
 * @param recordAction The user action to record.
 */
public void startHelpAndFeedback(Tab currentTab, String recordAction) {
    // Since reading back the compositor is asynchronous, we need to do the readback
    // before starting the GoogleHelp.
    String helpContextId = HelpAndFeedback.getHelpContextIdFromUrl(
            this, currentTab.getUrl(), getCurrentTabModel().isIncognito());
    HelpAndFeedback.getInstance(this)
            .show(this, helpContextId, currentTab.getProfile(), currentTab.getUrl());
    RecordUserAction.record(recordAction);
}
 
Example #19
Source File: PrivacyPreferences.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_privacy),
                        Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #20
Source File: SingleCategoryPreferences.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        int helpContextResId = R.string.help_context_settings;
        if (mCategory.showProtectedMediaSites()) {
            helpContextResId = R.string.help_context_protected_content;
        }
        HelpAndFeedback.getInstance(getActivity()).show(
                getActivity(), getString(helpContextResId), Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #21
Source File: UsbDevicePreferences.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_settings),
                        Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #22
Source File: PrivacyPreferences.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_privacy),
                        Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #23
Source File: SingleCategoryPreferences.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        int helpContextResId = R.string.help_context_settings;
        if (mCategory.showProtectedMediaSites()) {
            helpContextResId = R.string.help_context_protected_content;
        }
        HelpAndFeedback.getInstance(getActivity()).show(
                getActivity(), getString(helpContextResId), Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #24
Source File: UsbChooserPreferences.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_settings),
                        Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #25
Source File: DataReductionPreferences.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_id_targeted_help) {
        HelpAndFeedback.getInstance(getActivity())
                .show(getActivity(), getString(R.string.help_context_data_reduction),
                        Profile.getLastUsedProfile(), null);
        return true;
    }
    return false;
}
 
Example #26
Source File: Preferences.java    From delion with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == android.R.id.home) {
        finish();
        return true;
    } else if (item.getItemId() == R.id.menu_id_general_help) {
        HelpAndFeedback.getInstance(this).show(this, getString(R.string.help_context_settings),
                Profile.getLastUsedProfile(), null);
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 
Example #27
Source File: PassphraseCreationDialogFragment.java    From delion with Apache License 2.0 5 votes vote down vote up
private SpannableString getInstructionsText() {
    final Activity activity = getActivity();
    return SpanApplier.applySpans(
            activity.getString(R.string.sync_custom_passphrase),
            new SpanInfo("<learnmore>", "</learnmore>", new ClickableSpan() {
                @Override
                public void onClick(View view) {
                    HelpAndFeedback.getInstance(activity).show(activity,
                            activity.getString(R.string.help_context_change_sync_passphrase),
                            Profile.getLastUsedProfile(), null);
                }
            }));
}
 
Example #28
Source File: ChromeApplication.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
/**
 * Returns a new instance of HelpAndFeedback.
 */
public HelpAndFeedback createHelpAndFeedback() {
    return new HelpAndFeedback();
}
 
Example #29
Source File: IncognitoNewTabPage.java    From delion with Apache License 2.0 4 votes vote down vote up
@Override
public void loadIncognitoLearnMore() {
    HelpAndFeedback.getInstance(mActivity).show(mActivity,
            mActivity.getString(R.string.help_context_incognito_learn_more),
            Profile.getLastUsedProfile(), null);
}
 
Example #30
Source File: LearnMorePreference.java    From delion with Apache License 2.0 4 votes vote down vote up
@Override
protected void onClick() {
    HelpAndFeedback.getInstance(getContext())
            .show((Activity) getContext(), getContext().getString(mHelpContext),
                    Profile.getLastUsedProfile(), null);
}