mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-20 00:20:37 +00:00
Bug 1648157 - Reword TrackingProtection menu item in GVE. r=esawin
Differential Revision: https://phabricator.services.mozilla.com/D92486
This commit is contained in:
parent
41821739e4
commit
fbf157e6ef
@ -394,6 +394,7 @@ public class GeckoViewActivity
|
||||
private boolean mEnableRemoteDebugging;
|
||||
private boolean mKillProcessOnDestroy;
|
||||
private boolean mDesktopMode;
|
||||
private boolean mTrackingProtectionException;
|
||||
private String mUserAgentOverride;
|
||||
private boolean mAllowExtensionsInPrivateBrowsing;
|
||||
|
||||
@ -936,10 +937,26 @@ public class GeckoViewActivity
|
||||
return true;
|
||||
}
|
||||
|
||||
private void updateTrackingProtectionException() {
|
||||
if (sGeckoRuntime == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final GeckoSession session = mTabSessionManager.getCurrentSession();
|
||||
if (session == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
sGeckoRuntime.getContentBlockingController()
|
||||
.checkException(session)
|
||||
.accept(value -> mTrackingProtectionException = value.booleanValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
menu.findItem(R.id.action_pb).setChecked(mUsePrivateBrowsing);
|
||||
menu.findItem(R.id.desktop_mode).setChecked(mDesktopMode);
|
||||
menu.findItem(R.id.action_tpe).setChecked(mTrackingProtectionException);
|
||||
menu.findItem(R.id.action_forward).setEnabled(mCanGoForward);
|
||||
return true;
|
||||
}
|
||||
@ -958,10 +975,8 @@ public class GeckoViewActivity
|
||||
sGeckoRuntime.getContentBlockingController().checkException(session).accept(value -> {
|
||||
if (value.booleanValue()) {
|
||||
sGeckoRuntime.getContentBlockingController().removeException(session);
|
||||
item.setTitle(R.string.tracking_protection_ex);
|
||||
} else {
|
||||
sGeckoRuntime.getContentBlockingController().addException(session);
|
||||
item.setTitle(R.string.tracking_protection_ex2);
|
||||
}
|
||||
session.reload();
|
||||
});
|
||||
@ -1704,6 +1719,7 @@ public class GeckoViewActivity
|
||||
tabSession.onLocationChange(url);
|
||||
}
|
||||
mCurrentUri = url;
|
||||
updateTrackingProtectionException();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item android:title="@string/tracking_protection_ex" android:id="@+id/action_tpe" app:showAsAction="never" />
|
||||
<item android:title="@string/tracking_protection_ex" android:checkable="true"
|
||||
android:id="@+id/action_tpe" app:showAsAction="never" />
|
||||
<item android:title="@string/desktop_mode" android:id="@+id/desktop_mode" android:checkable="true"
|
||||
app:showAsAction="never" />
|
||||
<item android:title="@string/private_browsing" android:checkable="true" android:id="@+id/action_pb"/>
|
||||
|
@ -23,8 +23,7 @@
|
||||
<string name="crash_java">Java</string>
|
||||
<string name="crash_content_native">Content (Native)</string>
|
||||
<string name="tracking_protection">Tracking Protection</string>
|
||||
<string name="tracking_protection_ex">Disable TP</string>
|
||||
<string name="tracking_protection_ex2">Reenable TP</string>
|
||||
<string name="tracking_protection_ex">TP exception</string>
|
||||
<string name="private_browsing">Private Browsing</string>
|
||||
<string name="remote_debugging">Remote Debugging</string>
|
||||
<string name="forward">Forward</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user