52 lines
2.9 KiB
Diff
52 lines
2.9 KiB
Diff
|
From: uazo <uazo@users.noreply.github.com>
|
||
|
Date: Mon, 17 May 2021 12:30:12 +0000
|
||
|
Subject: Add support for ISupportHelpAndFeedback
|
||
|
|
||
|
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||
|
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||
|
---
|
||
|
.../chrome/browser/settings/SettingsActivity.java | 9 +++++++--
|
||
|
.../components/browser_ui/settings/SettingsUtils.java | 4 ++++
|
||
|
2 files changed, 11 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
|
||
|
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
|
||
|
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
|
||
|
@@ -86,6 +86,7 @@ import org.chromium.components.browser_ui.settings.CustomDividerFragment;
|
||
|
import org.chromium.components.browser_ui.settings.FragmentSettingsLauncher;
|
||
|
import org.chromium.components.browser_ui.settings.PaddedDividerItemDecoration;
|
||
|
import org.chromium.components.browser_ui.settings.SettingsLauncher;
|
||
|
+import org.chromium.components.browser_ui.settings.SettingsUtils;
|
||
|
import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory;
|
||
|
import org.chromium.components.browser_ui.site_settings.BaseSiteSettingsFragment;
|
||
|
import org.chromium.components.browser_ui.util.TraceEventVectorDrawableCompat;
|
||
|
@@ -417,8 +418,12 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity
|
||
|
finish();
|
||
|
return true;
|
||
|
} else if (item.getItemId() == R.id.menu_id_general_help) {
|
||
|
- HelpAndFeedbackLauncherImpl.getForProfile(mProfile).show(
|
||
|
- this, getString(R.string.help_context_settings), null);
|
||
|
+ if (mainFragment instanceof SettingsUtils.ISupportHelpAndFeedback) {
|
||
|
+ ((SettingsUtils.ISupportHelpAndFeedback)mainFragment).onHelpAndFeebackPressed();
|
||
|
+ } else {
|
||
|
+ HelpAndFeedbackLauncherImpl.getForProfile(mProfile).show(
|
||
|
+ this, getString(R.string.help_context_settings), null);
|
||
|
+ }
|
||
|
return true;
|
||
|
}
|
||
|
return super.onOptionsItemSelected(item);
|
||
|
diff --git a/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
|
||
|
--- a/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
|
||
|
+++ b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
|
||
|
@@ -97,4 +97,8 @@ public class SettingsUtils {
|
||
|
ToolbarUtils.setOverflowMenuVisibility(toolbar, visibility);
|
||
|
return true;
|
||
|
}
|
||
|
+
|
||
|
+ public interface ISupportHelpAndFeedback {
|
||
|
+ void onHelpAndFeebackPressed();
|
||
|
+ }
|
||
|
}
|
||
|
--
|
||
|
2.25.1
|