Skip to content

Commit

Permalink
[Android] Rename "show_undo_on_tab_closed" -> "show_undo_when_tabs_cl…
Browse files Browse the repository at this point in the history
…osed".
  • Loading branch information
jagadeshjai authored and bsclifton committed Oct 21, 2024
1 parent 2b2ed37 commit 2e337e7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion android/java/org/chromium/base/BravePreferenceKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public final class BravePreferenceKeys {

public static final String DAY_ZERO_EXPT_FLAG = "day_zero_expt_flag";

public static final String SHOW_UNDO_ON_TAB_CLOSED = "show_undo_on_tab_closed";
public static final String SHOW_UNDO_WHEN_TABS_CLOSED = "show_undo_when_tabs_closed";

/*
* Checks if preference key is used in Brave.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class AppearancePreferences extends BravePreferenceFragment
public static final String PREF_BRAVE_ENABLE_TAB_GROUPS = "brave_enable_tab_groups";
public static final String PREF_BRAVE_ENABLE_SPEEDREADER = "brave_enable_speedreader";
public static final String PREF_ENABLE_MULTI_WINDOWS = "enable_multi_windows";
public static final String PREF_SHOW_UNDO_ON_TAB_CLOSED = "show_undo_on_tab_closed";
public static final String PREF_SHOW_UNDO_WHEN_TABS_CLOSED = "show_undo_when_tabs_closed";

private BraveRewardsNativeWorker mBraveRewardsNativeWorker;

Expand Down Expand Up @@ -175,14 +175,14 @@ public void onActivityCreated(Bundle savedInstanceState) {
}

ChromeSwitchPreference showUndoButtonOnTabClosed =
(ChromeSwitchPreference) findPreference(PREF_SHOW_UNDO_ON_TAB_CLOSED);
(ChromeSwitchPreference) findPreference(PREF_SHOW_UNDO_WHEN_TABS_CLOSED);
if (showUndoButtonOnTabClosed != null) {
showUndoButtonOnTabClosed.setOnPreferenceChangeListener(this);
((ChromeSwitchPreference) showUndoButtonOnTabClosed)
.setChecked(
ChromeSharedPreferences.getInstance()
.readBoolean(
BravePreferenceKeys.SHOW_UNDO_ON_TAB_CLOSED, true));
BravePreferenceKeys.SHOW_UNDO_WHEN_TABS_CLOSED, true));
}
}

Expand Down Expand Up @@ -269,9 +269,10 @@ public void onDismiss() {
}
}
BraveMultiWindowUtils.updateEnableMultiWindows((boolean) newValue);
} else if (PREF_SHOW_UNDO_ON_TAB_CLOSED.equals(key)) {
} else if (PREF_SHOW_UNDO_WHEN_TABS_CLOSED.equals(key)) {
ChromeSharedPreferences.getInstance()
.writeBoolean(BravePreferenceKeys.SHOW_UNDO_ON_TAB_CLOSED, (boolean) newValue);
.writeBoolean(
BravePreferenceKeys.SHOW_UNDO_WHEN_TABS_CLOSED, (boolean) newValue);
}
if (shouldRelaunch) {
BraveRelaunchUtils.askForRelaunch(getActivity());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class BraveUndoBarControllerBase implements SnackbarManager.SnackbarContr
public void showUndoBar(List<Tab> closedTabs, boolean isAllTabs) {
boolean showUndoBar =
ChromeSharedPreferences.getInstance()
.readBoolean(BravePreferenceKeys.SHOW_UNDO_ON_TAB_CLOSED, true);
.readBoolean(BravePreferenceKeys.SHOW_UNDO_WHEN_TABS_CLOSED, true);
if (!showUndoBar) {
if (closedTabs.isEmpty()) {
return;
Expand All @@ -27,7 +27,7 @@ public void showUndoBar(List<Tab> closedTabs, boolean isAllTabs) {
return;
}

BraveReflectionUtil.InvokeMethod(
BraveReflectionUtil.invokeMethod(
UndoBarController.class,
this,
"showUndoBar",
Expand Down
4 changes: 2 additions & 2 deletions android/java/res/xml/appearance_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
android:summary="@string/enable_multi_windows_summary" />

<org.chromium.components.browser_ui.settings.ChromeSwitchPreference
android:key="show_undo_on_tab_closed"
android:title="@string/show_undo_on_tab_closed"
android:key="show_undo_when_tabs_closed"
android:title="@string/show_undo_when_tabs_closed"
android:summaryOn="@string/text_on"
android:summaryOff="@string/text_off" />

Expand Down
4 changes: 2 additions & 2 deletions browser/ui/android/strings/android_brave_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -4063,8 +4063,8 @@ If you don't accept this request, VPN will not reconnect and your internet conne
<message name="IDS_UPDATE_FILTER_LIST_FAIL_TEXT" desc="Text to notify users for the failure of updating filterlist">
Filter list could not be updated. Please try again
</message>
<message name="IDS_SHOW_UNDO_ON_TAB_CLOSED" desc="Menu item to show undo button on tab closed">
Show undo button on tab closed
<message name="IDS_SHOW_UNDO_WHEN_TABS_CLOSED" desc="Menu item to show undo button when tabs are closed">
Show undo button when tabs are closed
</message>
</messages>
</release>
Expand Down
1 change: 0 additions & 1 deletion build/android/bytecode/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ java_binary("java_bytecode_rewriter") {
"//brave/build/android/bytecode/java/org/brave/bytecode/BraveToolbarManagerClassAdapter.java",
"//brave/build/android/bytecode/java/org/brave/bytecode/BraveToolbarSwipeLayoutClassAdapter.java",
"//brave/build/android/bytecode/java/org/brave/bytecode/BraveTopToolbarCoordinatorClassAdapter.java",
"//brave/build/android/bytecode/java/org/brave/bytecode/BraveTranslateCompactInfoBarBaseClassAdapter.java",
"//brave/build/android/bytecode/java/org/brave/bytecode/BraveUndoBarControllerBaseClassAdapter.java",
"//brave/build/android/bytecode/java/org/brave/bytecode/BraveVariationsSeedFetcherClassAdapter.java",
"//brave/build/android/bytecode/java/org/brave/bytecode/BraveWebsiteClassAdapter.java",
Expand Down

0 comments on commit 2e337e7

Please sign in to comment.