]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Remove the third-party cookies icon from the list of additional icons to display...
authorSoren Stoutner <soren@stoutner.com>
Wed, 14 Sep 2016 03:15:41 +0000 (20:15 -0700)
committerSoren Stoutner <soren@stoutner.com>
Wed, 14 Sep 2016 03:15:41 +0000 (20:15 -0700)
app/src/main/java/com/stoutner/privacybrowser/MainWebViewActivity.java
app/src/main/java/com/stoutner/privacybrowser/SettingsFragment.java
app/src/main/res/drawable/cookies_enabled.xml
app/src/main/res/drawable/cookies_ghosted.xml [deleted file]
app/src/main/res/drawable/cookies_warning.xml [deleted file]

index 4ac2ceedfffd47441a0025061a4ad15e84843ba3..4433cf386ed82e30037aa660848c5950a5b2ee42 100644 (file)
@@ -529,12 +529,10 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation
         // Set the status of the additional app bar icons.  The default is `false`.
         if (sharedPreferences.getBoolean("display_additional_app_bar_icons", false)) {
             toggleFirstPartyCookies.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
-            toggleThirdPartyCookies.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
             toggleDomStorage.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
             toggleSaveFormData.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
         } else { //Do not display the additional icons.
             toggleFirstPartyCookies.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
-            toggleThirdPartyCookies.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
             toggleDomStorage.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
             toggleSaveFormData.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
         }
@@ -1112,62 +1110,38 @@ public class MainWebViewActivity extends AppCompatActivity implements Navigation
         // Get handles for the icons.
         MenuItem privacyIcon = mainMenu.findItem(R.id.toggleJavaScript);
         MenuItem firstPartyCookiesIcon = mainMenu.findItem(R.id.toggleFirstPartyCookies);
-        MenuItem thirdPartyCookiesIcon = mainMenu.findItem(R.id.toggleThirdPartyCookies);
         MenuItem domStorageIcon = mainMenu.findItem(R.id.toggleDomStorage);
         MenuItem formDataIcon = mainMenu.findItem(R.id.toggleSaveFormData);
 
         // Update `privacyIcon`.
-        if (javaScriptEnabled) {
-            // `JavaScript` is enabled.
+        if (javaScriptEnabled) {  // JavaScript is enabled.
             privacyIcon.setIcon(R.drawable.javascript_enabled);
-        } else {
-            if (firstPartyCookiesEnabled) {
-                // `JavaScript` is disabled but cookies are enabled.
-                privacyIcon.setIcon(R.drawable.warning);
-            } else {
-                // All the dangerous features are disabled.
-                privacyIcon.setIcon(R.drawable.privacy_mode);
-            }
+        } else if (firstPartyCookiesEnabled) {  // JavaScript is disabled but cookies are enabled.
+            privacyIcon.setIcon(R.drawable.warning);
+        } else {  // All the dangerous features are disabled.
+            privacyIcon.setIcon(R.drawable.privacy_mode);
         }
 
         // Update `firstPartyCookiesIcon`.
-        if (firstPartyCookiesEnabled) {
-            // First-party cookies are enabled.
-            firstPartyCookiesIcon.setIcon(R.drawable.cookies_warning);
-        } else {
-            // First-party cookies are disabled.
+        if (firstPartyCookiesEnabled) {  // First-party cookies are enabled.
+            firstPartyCookiesIcon.setIcon(R.drawable.cookies_enabled);
+        } else {  // First-party cookies are disabled.
             firstPartyCookiesIcon.setIcon(R.drawable.cookies_disabled);
         }
 
-        // Update `thirdPartyCookiesIcon`.
-        if (firstPartyCookiesEnabled) {
-            if (thirdPartyCookiesEnabled) {
-                //  Third-party cookies are enabled.  Bad!
-                thirdPartyCookiesIcon.setIcon(R.drawable.cookies_critical);
-            } else {
-                // Third-party cookies are disabled.
-                thirdPartyCookiesIcon.setIcon(R.drawable.cookies_disabled);
-            }
-        } else {
-            // First-party cookies are disabled, so third-party cookies are ghosted.
-            thirdPartyCookiesIcon.setIcon(R.drawable.cookies_ghosted);
-        }
-
         // Update `domStorageIcon`.
-        if (javaScriptEnabled) {
-            if (domStorageEnabled) {
-                domStorageIcon.setIcon(R.drawable.dom_storage_enabled);
-            } else {
-                domStorageIcon.setIcon(R.drawable.dom_storage_disabled);
-            }
-        } else {
+        if (javaScriptEnabled && domStorageEnabled) {  // Both JavaScript and DOM storage is enabled.
+            domStorageIcon.setIcon(R.drawable.dom_storage_enabled);
+        } else if (javaScriptEnabled){  // JavaScript is enabled but DOM storage is disabled.
+            domStorageIcon.setIcon(R.drawable.dom_storage_disabled);
+        } else {  // JavaScript is disabled, so DOM storage is ghosted.
             domStorageIcon.setIcon(R.drawable.dom_storage_ghosted);
         }
 
         // Update `formDataIcon`.
-        if (saveFormDataEnabled) {
+        if (saveFormDataEnabled) {  // Form data is enabled.
             formDataIcon.setIcon(R.drawable.form_data_enabled);
-        } else {
+        } else {  // Form data is disabled.
             formDataIcon.setIcon(R.drawable.form_data_disabled);
         }
 
index 4eef49c2fa7a529d087c3b7ff7669837eafe2ff8..7446ce61c814219dc6ed37ed84901facb62d037a 100644 (file)
@@ -91,12 +91,12 @@ public class SettingsFragment extends PreferenceFragment {
         javaScriptDisabledSearchCustomURLPreference.setEnabled(javaScriptDisabledSearchString.equals("Custom URL"));
 
 
-        // Set the JavaScript-enabed searchURL as the summary text for the JavaScript-enabled search preference when the preference screen is loaded.
+        // Set the JavaScript-enabled searchURL as the summary text for the JavaScript-enabled search preference when the preference screen is loaded.
         // The default is "https://duckduckgo.com/?q=".
         final Preference javaScriptEnabledSearchPreference = findPreference("javascript_enabled_search");
         String javaScriptEnabledSearchString = savedPreferences.getString("javascript_enabled_search", "https://duckduckgo.com/?q=");
         if (javaScriptEnabledSearchString.equals("Custom URL")) {
-            // If set to "Custom URL", use R.string.custom_url, which will be tgranslated, instead of the array value, which will not.
+            // If set to "Custom URL", use R.string.custom_url, which will be translated, instead of the array value, which will not.
             javaScriptEnabledSearchPreference.setSummary(R.string.custom_url);
         } else {
             // Set the array value as the summary text.
@@ -173,9 +173,6 @@ public class SettingsFragment extends PreferenceFragment {
                         if (Build.VERSION.SDK_INT >= 21) {
                             MainWebViewActivity.cookieManager.setAcceptThirdPartyCookies(MainWebViewActivity.mainWebView, MainWebViewActivity.thirdPartyCookiesEnabled);
                         }
-
-                        // Update the privacy icons.
-                        MainWebViewActivity.updatePrivacyIcons(MainWebViewActivity.privacyBrowserActivity);
                         break;
 
                     case "dom_storage_enabled":
index 2ceaf12702c598860dd7c992be660325e6de4bde..3d4ca6731b145bc15c57e40ec5cf845bd249457b 100644 (file)
@@ -11,6 +11,6 @@
 
     <!-- We have to use a hard coded color code until API >= 21.  Then we can use`@color`. -->
     <path
-        android:fillColor="#FFD50000"
+        android:fillColor="#FFF57F17"
         android:pathData="M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12C21,11.5 20.96,11 20.87,10.5C20.6,10 20,10 20,10H18V9C18,8 17,8 17,8H15V7C15,6 14,6 14,6H13V4C13,3 12,3 12,3M9.5,6A1.5,1.5 0 0,1 11,7.5A1.5,1.5 0 0,1 9.5,9A1.5,1.5 0 0,1 8,7.5A1.5,1.5 0 0,1 9.5,6M6.5,10A1.5,1.5 0 0,1 8,11.5A1.5,1.5 0 0,1 6.5,13A1.5,1.5 0 0,1 5,11.5A1.5,1.5 0 0,1 6.5,10M11.5,11A1.5,1.5 0 0,1 13,12.5A1.5,1.5 0 0,1 11.5,14A1.5,1.5 0 0,1 10,12.5A1.5,1.5 0 0,1 11.5,11M16.5,13A1.5,1.5 0 0,1 18,14.5A1.5,1.5 0 0,1 16.5,16H16.5A1.5,1.5 0 0,1 15,14.5H15A1.5,1.5 0 0,1 16.5,13M11,16A1.5,1.5 0 0,1 12.5,17.5A1.5,1.5 0 0,1 11,19A1.5,1.5 0 0,1 9.5,17.5A1.5,1.5 0 0,1 11,16Z" />
 </vector>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/cookies_ghosted.xml b/app/src/main/res/drawable/cookies_ghosted.xml
deleted file mode 100644 (file)
index d5675b3..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<!-- cookies_ghosted.xml was created by Google and downloaded from https://materialdesignicons.com/icon/cookie.
-    It is released under the Apache License 2.0. -->
-
-<vector
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:height="26dp"
-    android:width="26dp"
-    android:viewportHeight="24.0"
-    android:viewportWidth="24.0"
-    android:autoMirrored="true" >
-
-    <!-- We have to use a hard coded color code until API >= 21.  Then we can use`@color`. -->
-    <path
-        android:fillColor="#22000000"
-        android:pathData="M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12C21,11.5 20.96,11 20.87,10.5C20.6,10 20,10 20,10H18V9C18,8 17,8 17,8H15V7C15,6 14,6 14,6H13V4C13,3 12,3 12,3M9.5,6A1.5,1.5 0 0,1 11,7.5A1.5,1.5 0 0,1 9.5,9A1.5,1.5 0 0,1 8,7.5A1.5,1.5 0 0,1 9.5,6M6.5,10A1.5,1.5 0 0,1 8,11.5A1.5,1.5 0 0,1 6.5,13A1.5,1.5 0 0,1 5,11.5A1.5,1.5 0 0,1 6.5,10M11.5,11A1.5,1.5 0 0,1 13,12.5A1.5,1.5 0 0,1 11.5,14A1.5,1.5 0 0,1 10,12.5A1.5,1.5 0 0,1 11.5,11M16.5,13A1.5,1.5 0 0,1 18,14.5A1.5,1.5 0 0,1 16.5,16H16.5A1.5,1.5 0 0,1 15,14.5H15A1.5,1.5 0 0,1 16.5,13M11,16A1.5,1.5 0 0,1 12.5,17.5A1.5,1.5 0 0,1 11,19A1.5,1.5 0 0,1 9.5,17.5A1.5,1.5 0 0,1 11,16Z" />
-</vector>
\ No newline at end of file
diff --git a/app/src/main/res/drawable/cookies_warning.xml b/app/src/main/res/drawable/cookies_warning.xml
deleted file mode 100644 (file)
index 9fc93bc..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<!-- cookies_warning.xml was created by Google and downloaded from https://materialdesignicons.com/icon/cookie.
-    It is released under the Apache License 2.0. -->
-
-<vector
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:height="26dp"
-    android:width="26dp"
-    android:viewportHeight="24.0"
-    android:viewportWidth="24.0"
-    android:autoMirrored="true" >
-
-    <!-- We have to use a hard coded color code until API >= 21.  Then we can use`@color`. -->
-    <path
-        android:fillColor="#FFF57F17"
-        android:pathData="M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12C21,11.5 20.96,11 20.87,10.5C20.6,10 20,10 20,10H18V9C18,8 17,8 17,8H15V7C15,6 14,6 14,6H13V4C13,3 12,3 12,3M9.5,6A1.5,1.5 0 0,1 11,7.5A1.5,1.5 0 0,1 9.5,9A1.5,1.5 0 0,1 8,7.5A1.5,1.5 0 0,1 9.5,6M6.5,10A1.5,1.5 0 0,1 8,11.5A1.5,1.5 0 0,1 6.5,13A1.5,1.5 0 0,1 5,11.5A1.5,1.5 0 0,1 6.5,10M11.5,11A1.5,1.5 0 0,1 13,12.5A1.5,1.5 0 0,1 11.5,14A1.5,1.5 0 0,1 10,12.5A1.5,1.5 0 0,1 11.5,11M16.5,13A1.5,1.5 0 0,1 18,14.5A1.5,1.5 0 0,1 16.5,16H16.5A1.5,1.5 0 0,1 15,14.5H15A1.5,1.5 0 0,1 16.5,13M11,16A1.5,1.5 0 0,1 12.5,17.5A1.5,1.5 0 0,1 11,19A1.5,1.5 0 0,1 9.5,17.5A1.5,1.5 0 0,1 11,16Z" />
-</vector>
\ No newline at end of file