LeOSium_webview/LeOS/patches/Remove-help-menu-item.patch

286 lines
19 KiB
Diff
Raw Permalink Normal View History

2023-11-18 11:46:19 +01:00
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Wed, 27 Jun 2018 01:32:28 +0200
Subject: Remove help menu item
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
chrome/android/java/res/menu/main_menu.xml | 3 ---
.../menu/save_password_preferences_action_bar_menu.xml | 1 +
.../org/chromium/chrome/browser/KeyboardShortcuts.java | 3 ---
.../chromium/chrome/browser/app/ChromeActivity.java | 10 ----------
.../settings/AutofillPaymentMethodsFragment.java | 1 +
.../autofill/settings/AutofillProfilesFragment.java | 1 +
.../browsing_data/ClearBrowsingDataFragment.java | 1 +
.../browser/customtabs/BaseCustomTabActivity.java | 2 +-
.../browser/directactions/MenuDirectActionHandler.java | 2 --
.../password_manager/settings/PasswordSettings.java | 1 +
.../browser/privacy/settings/PrivacySettings.java | 1 +
.../chrome/browser/settings/SettingsActivity.java | 1 +
.../browser/sync/settings/GoogleServicesSettings.java | 1 +
.../browser/sync/settings/ManageSyncSettings.java | 1 +
.../android/java/res/menu/prefeditor_editor_menu.xml | 1 +
.../autofill/options/AutofillOptionsFragment.java | 1 +
.../password_check/PasswordCheckFragmentView.java | 1 +
.../java/res/menu/credential_edit_action_bar_menu.xml | 3 ++-
.../settings/PreloadPagesSettingsFragmentBase.java | 1 +
.../PrivacySandboxSettingsBaseFragment.java | 1 +
.../settings/SafeBrowsingSettingsFragmentBase.java | 1 +
21 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
--- a/chrome/android/java/res/menu/main_menu.xml
+++ b/chrome/android/java/res/menu/main_menu.xml
@@ -155,9 +155,6 @@ found in the LICENSE file.
<item android:id="@+id/preferences_id"
android:title="@string/menu_settings"
android:icon="@drawable/settings_cog" />
- <item android:id="@+id/help_id"
- android:title="@string/menu_help"
- android:icon="@drawable/help_outline" />
<item android:id="@+id/managed_by_divider_line_id"
android:title="@null" />
<item android:id="@+id/managed_by_menu_id"
diff --git a/chrome/android/java/res/menu/save_password_preferences_action_bar_menu.xml b/chrome/android/java/res/menu/save_password_preferences_action_bar_menu.xml
--- a/chrome/android/java/res/menu/save_password_preferences_action_bar_menu.xml
+++ b/chrome/android/java/res/menu/save_password_preferences_action_bar_menu.xml
@@ -19,6 +19,7 @@ found in the LICENSE file.
android:id="@id/menu_id_targeted_help"
android:icon="@drawable/ic_help_and_feedback"
android:title="@string/menu_help"
+ android:visibility="gone"
app:showAsAction="ifRoom"/>
<item
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
@@ -367,9 +367,6 @@ public class KeyboardShortcuts {
case KeyEvent.KEYCODE_BUTTON_START:
if (currentTab != null && currentTab.canGoForward()) currentTab.goForward();
return true;
- case CTRL | SHIFT | KeyEvent.KEYCODE_SLASH: // i.e. Ctrl+?
- menuOrKeyboardActionController.onMenuOrKeyboardAction(R.id.help_id, false);
- return true;
}
}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
@@ -2398,16 +2398,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
final Tab currentTab = getActivityTab();
- if (id == R.id.help_id) {
- String url = currentTab != null ? currentTab.getUrl().getSpec() : "";
- Profile profile = getTabModelSelector().isIncognitoSelected()
- ? Profile.getLastUsedRegularProfile().getPrimaryOTRProfile(
- /*createIfNeeded=*/true)
- : Profile.getLastUsedRegularProfile();
- startHelpAndFeedback(url, "MobileMenuFeedback", profile);
- return true;
- }
-
if (id == R.id.open_history_menu_id) {
// 'currentTab' could only be null when opening history from start surface, which is
// not available on tablet.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/settings/AutofillPaymentMethodsFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/settings/AutofillPaymentMethodsFragment.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/settings/AutofillPaymentMethodsFragment.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/settings/AutofillPaymentMethodsFragment.java
@@ -89,6 +89,7 @@ public class AutofillPaymentMethodsFragment extends ChromeBaseSettingsFragment
MenuItem help =
menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
help.setIcon(R.drawable.ic_help_and_feedback);
+ help.setVisible(false);
}
@Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/settings/AutofillProfilesFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/settings/AutofillProfilesFragment.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/settings/AutofillProfilesFragment.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/settings/AutofillProfilesFragment.java
@@ -113,6 +113,7 @@ public class AutofillProfilesFragment extends ChromeBaseSettingsFragment
MenuItem help =
menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
help.setIcon(R.drawable.ic_help_and_feedback);
+ help.setVisible(false);
}
@Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragment.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragment.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/browsing_data/ClearBrowsingDataFragment.java
@@ -824,6 +824,7 @@ public abstract class ClearBrowsingDataFragment extends PreferenceFragmentCompat
help.setIcon(TraceEventVectorDrawableCompat.create(
getResources(), R.drawable.ic_help_and_feedback, getActivity().getTheme()));
help.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+ help.setVisible(false);
}
@Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabActivity.java
@@ -580,7 +580,7 @@ public abstract class BaseCustomTabActivity extends ChromeActivity<BaseCustomTab
@Override
public boolean onMenuOrKeyboardAction(int id, boolean fromMenu) {
// Disable creating new tabs, bookmark, history, print, help, focus_url, etc.
- if (id == R.id.focus_url_bar || id == R.id.all_bookmarks_menu_id || id == R.id.help_id
+ if (id == R.id.focus_url_bar || id == R.id.all_bookmarks_menu_id
|| id == R.id.recent_tabs_menu_id || id == R.id.new_incognito_tab_menu_id
|| id == R.id.new_tab_menu_id || id == R.id.open_history_menu_id) {
return true;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/directactions/MenuDirectActionHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/directactions/MenuDirectActionHandler.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/directactions/MenuDirectActionHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/directactions/MenuDirectActionHandler.java
@@ -36,7 +36,6 @@ class MenuDirectActionHandler implements DirectActionHandler {
map.put(ChromeDirectActionIds.RELOAD, R.id.reload_menu_id);
map.put(ChromeDirectActionIds.BOOKMARK_THIS_PAGE, R.id.bookmark_this_page_id);
map.put(ChromeDirectActionIds.DOWNLOADS, R.id.downloads_menu_id);
- map.put(ChromeDirectActionIds.HELP, R.id.help_id);
map.put(ChromeDirectActionIds.NEW_TAB, R.id.new_tab_menu_id);
map.put(ChromeDirectActionIds.OPEN_HISTORY, R.id.open_history_menu_id);
map.put(ChromeDirectActionIds.PREFERENCES, R.id.preferences_id);
@@ -92,7 +91,6 @@ class MenuDirectActionHandler implements DirectActionHandler {
}
availableItemIds.add(R.id.downloads_menu_id);
- availableItemIds.add(R.id.help_id);
availableItemIds.add(R.id.new_tab_menu_id);
availableItemIds.add(R.id.preferences_id);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
@@ -216,6 +216,7 @@ public class PasswordSettings extends ChromeBaseSettingsFragment
mSearchItem = menu.findItem(R.id.menu_id_search);
mSearchItem.setVisible(true);
mHelpItem = menu.findItem(R.id.menu_id_targeted_help);
+ mHelpItem.setVisible(false);
SearchUtils.initializeSearchView(
mSearchItem, mSearchQuery, getActivity(), this::filterPasswords);
}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
@@ -379,6 +379,7 @@ public class PrivacySettings
menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
help.setIcon(TraceEventVectorDrawableCompat.create(
getResources(), R.drawable.ic_help_and_feedback, getActivity().getTheme()));
+ help.setVisible(false);
}
@Override
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
@@ -395,6 +395,7 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity
Menu.NONE, R.id.menu_id_general_help, Menu.CATEGORY_SECONDARY, R.string.menu_help);
help.setIcon(TraceEventVectorDrawableCompat.create(
getResources(), R.drawable.ic_help_and_feedback, getTheme()));
+ help.setVisible(false);
return super.onCreateOptionsMenu(menu);
}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/GoogleServicesSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/GoogleServicesSettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/GoogleServicesSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/GoogleServicesSettings.java
@@ -170,6 +170,7 @@ public class GoogleServicesSettings extends ChromeBaseSettingsFragment
MenuItem help =
menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
help.setIcon(R.drawable.ic_help_and_feedback);
+ help.setVisible(false);
}
@Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java
@@ -264,6 +264,7 @@ public class ManageSyncSettings extends ChromeBaseSettingsFragment
MenuItem help =
menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
help.setIcon(R.drawable.ic_help_and_feedback);
+ help.setVisible(false);
if (mIsFromSigninScreen) {
ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
assert actionBar != null;
diff --git a/chrome/browser/autofill/android/java/res/menu/prefeditor_editor_menu.xml b/chrome/browser/autofill/android/java/res/menu/prefeditor_editor_menu.xml
--- a/chrome/browser/autofill/android/java/res/menu/prefeditor_editor_menu.xml
+++ b/chrome/browser/autofill/android/java/res/menu/prefeditor_editor_menu.xml
@@ -19,6 +19,7 @@ found in the LICENSE file.
android:id="@+id/help_menu_id"
android:icon="@drawable/ic_help_and_feedback"
android:title="@string/help"
+ android:visibility="gone"
app:showAsAction="ifRoom" />
</menu>
diff --git a/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/options/AutofillOptionsFragment.java b/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/options/AutofillOptionsFragment.java
--- a/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/options/AutofillOptionsFragment.java
+++ b/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/options/AutofillOptionsFragment.java
@@ -81,6 +81,7 @@ public class AutofillOptionsFragment extends ChromeBaseSettingsFragment {
MenuItem help =
menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
help.setIcon(R.drawable.ic_help_and_feedback);
+ help.setVisible(false);
}
@Override
diff --git a/chrome/browser/password_check/android/java/src/org/chromium/chrome/browser/password_check/PasswordCheckFragmentView.java b/chrome/browser/password_check/android/java/src/org/chromium/chrome/browser/password_check/PasswordCheckFragmentView.java
--- a/chrome/browser/password_check/android/java/src/org/chromium/chrome/browser/password_check/PasswordCheckFragmentView.java
+++ b/chrome/browser/password_check/android/java/src/org/chromium/chrome/browser/password_check/PasswordCheckFragmentView.java
@@ -51,6 +51,7 @@ public class PasswordCheckFragmentView extends PreferenceFragmentCompat {
menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
help.setIcon(TraceEventVectorDrawableCompat.create(
getResources(), R.drawable.ic_help_and_feedback, getActivity().getTheme()));
+ help.setVisible(false);
}
@Override
diff --git a/chrome/browser/password_entry_edit/android/java/res/menu/credential_edit_action_bar_menu.xml b/chrome/browser/password_entry_edit/android/java/res/menu/credential_edit_action_bar_menu.xml
--- a/chrome/browser/password_entry_edit/android/java/res/menu/credential_edit_action_bar_menu.xml
+++ b/chrome/browser/password_entry_edit/android/java/res/menu/credential_edit_action_bar_menu.xml
@@ -21,5 +21,6 @@ found in the LICENSE file.
android:icon="@drawable/ic_help_and_feedback"
app:iconTint="@macro/default_icon_color"
android:title="@string/menu_help"
+ android:visibility="gone"
app:showAsAction="ifRoom"/>
-</menu>
\ No newline at end of file
+</menu>
diff --git a/chrome/browser/prefetch/android/java/src/org/chromium/chrome/browser/prefetch/settings/PreloadPagesSettingsFragmentBase.java b/chrome/browser/prefetch/android/java/src/org/chromium/chrome/browser/prefetch/settings/PreloadPagesSettingsFragmentBase.java
--- a/chrome/browser/prefetch/android/java/src/org/chromium/chrome/browser/prefetch/settings/PreloadPagesSettingsFragmentBase.java
+++ b/chrome/browser/prefetch/android/java/src/org/chromium/chrome/browser/prefetch/settings/PreloadPagesSettingsFragmentBase.java
@@ -34,6 +34,7 @@ public abstract class PreloadPagesSettingsFragmentBase extends ChromeBaseSetting
menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
help.setIcon(TraceEventVectorDrawableCompat.create(
getResources(), R.drawable.ic_help_and_feedback, getActivity().getTheme()));
+ help.setVisible(false);
}
@Override
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsBaseFragment.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsBaseFragment.java
--- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsBaseFragment.java
+++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsBaseFragment.java
@@ -80,6 +80,7 @@ public abstract class PrivacySandboxSettingsBaseFragment
menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
help.setIcon(TraceEventVectorDrawableCompat.create(
getResources(), R.drawable.ic_help_and_feedback, getActivity().getTheme()));
+ help.setVisible(false);
}
@Override
diff --git a/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/settings/SafeBrowsingSettingsFragmentBase.java b/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/settings/SafeBrowsingSettingsFragmentBase.java
--- a/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/settings/SafeBrowsingSettingsFragmentBase.java
+++ b/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/settings/SafeBrowsingSettingsFragmentBase.java
@@ -66,6 +66,7 @@ public abstract class SafeBrowsingSettingsFragmentBase extends ChromeBaseSetting
menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help);
help.setIcon(TraceEventVectorDrawableCompat.create(
getResources(), R.drawable.ic_help_and_feedback, getActivity().getTheme()));
+ help.setVisible(false);
}
@Override
--
2.25.1