Bug 1471599 - [2.0] Use per-session tracking protection setting in the example app. r=snorp, a=lizzard
authorEugen Sawin <esawin@mozilla.com>
Wed, 27 Jun 2018 15:10:20 +0200
changeset 477905 f45fd24c7beb0a45bd371b9a35fae8acd0d08154
parent 477904 9ebb30b4f366ccde8af4507cc84580563211187e
child 477906 799e2bc3b592965fe806bcb740d48615db15cc36
push id9462
push userryanvm@gmail.com
push dateThu, 12 Jul 2018 00:35:00 +0000
treeherdermozilla-beta@bf0bb0c06878 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, lizzard
bugs1471599
milestone62.0
Bug 1471599 - [2.0] Use per-session tracking protection setting in the example app. r=snorp, a=lizzard
mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
--- a/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
+++ b/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
@@ -138,17 +138,18 @@ public class GeckoViewActivity extends A
 
         mLocationView.setCommitListener(mCommitListener);
     }
 
     private GeckoSession createSession() {
         GeckoSession session = new GeckoSession();
         session.getSettings().setBoolean(GeckoSessionSettings.USE_MULTIPROCESS, mUseMultiprocess);
         session.getSettings().setBoolean(GeckoSessionSettings.USE_PRIVATE_MODE, mUsePrivateBrowsing);
-        session.getSettings().setBoolean(GeckoSessionSettings.USE_TRACKING_PROTECTION, true);
+        session.getSettings().setBoolean(
+            GeckoSessionSettings.USE_TRACKING_PROTECTION, mUseTrackingProtection);
 
         connectSession(session);
 
         return session;
     }
 
     private void connectSession(GeckoSession session) {
         session.setContentDelegate(new ExampleContentDelegate());
@@ -175,21 +176,18 @@ public class GeckoViewActivity extends A
 
         mGeckoSession = createSession();
         mGeckoSession.open(sGeckoRuntime);
         mGeckoView.setSession(mGeckoSession);
         mGeckoSession.loadUri(mCurrentUri != null ? mCurrentUri : DEFAULT_URL);
     }
 
     private void updateTrackingProtection(GeckoSession session) {
-        int categories = mUseTrackingProtection ?
-                TrackingProtectionDelegate.CATEGORY_ALL :
-                TrackingProtectionDelegate.CATEGORY_NONE;
-
-        sGeckoRuntime.getSettings().setTrackingProtectionCategories(categories);
+        session.getSettings().setBoolean(
+            GeckoSessionSettings.USE_TRACKING_PROTECTION, mUseTrackingProtection);
     }
 
     @Override
     protected void onPause() {
         mGeckoSession.setActive(false);
         super.onPause();
     }