Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: mobile/android/base/preferences/GeckoPreferences.java

Issue 29345390: Issue 3001 - FAQ settings item should lead to the Adblock Browser FAQ (Closed)
Patch Set: Created May 31, 2016, 9:56 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | mobile/android/base/resources/xml/preferences_vendor.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*- 1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public 2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 5
6 package org.mozilla.gecko.preferences; 6 package org.mozilla.gecko.preferences;
7 7
8 import org.mozilla.gecko.AboutPages; 8 import org.mozilla.gecko.AboutPages;
9 import org.mozilla.gecko.AdjustConstants; 9 import org.mozilla.gecko.AdjustConstants;
10 import org.mozilla.gecko.AppConstants; 10 import org.mozilla.gecko.AppConstants;
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 // Only enable the ZoomedView / magnifying pref on Nightly. 903 // Only enable the ZoomedView / magnifying pref on Nightly.
904 if (!AppConstants.NIGHTLY_BUILD) { 904 if (!AppConstants.NIGHTLY_BUILD) {
905 preferences.removePreference(pref); 905 preferences.removePreference(pref);
906 i--; 906 i--;
907 continue; 907 continue;
908 } 908 }
909 } else if (PREFS_HOMEPAGE.equals(key)) { 909 } else if (PREFS_HOMEPAGE.equals(key)) {
910 String setUrl = GeckoSharedPrefs.forProfile(getBaseContext() ).getString(PREFS_HOMEPAGE, AboutPages.HOME); 910 String setUrl = GeckoSharedPrefs.forProfile(getBaseContext() ).getString(PREFS_HOMEPAGE, AboutPages.HOME);
911 setHomePageSummary(pref, setUrl); 911 setHomePageSummary(pref, setUrl);
912 pref.setOnPreferenceChangeListener(this); 912 pref.setOnPreferenceChangeListener(this);
913 } else if (PREFS_FAQ_LINK.equals(key)) {
914 // Format the FAQ link
915 final String VERSION = AppConstants.MOZ_APP_VERSION;
916 final String OS = AppConstants.OS_TARGET;
917 final String LOCALE = Locales.getLanguageTag(Locale.getDefau lt());
918
919 final String url = getResources().getString(R.string.faq_lin k, VERSION, OS, LOCALE);
920 ((LinkPreference) pref).setUrl(url);
921 } 913 }
914 // Removed PREFS_FAQ_LINK condition so it won't override the FAQ url programatically
915 // See https://issues.adblockplus.org/ticket/3001
Felix Dahlke 2016/06/16 13:33:34 Do we actually have to remove this code? How I see
922 916
923 // Some Preference UI elements are not actually preferences, 917 // Some Preference UI elements are not actually preferences,
924 // but they require a key to work correctly. For example, 918 // but they require a key to work correctly. For example,
925 // "Clear private data" requires a key for its state to be 919 // "Clear private data" requires a key for its state to be
926 // saved when the orientation changes. It uses the 920 // saved when the orientation changes. It uses the
927 // "android.not_a_preference.privacy.clear" key - which doesn't 921 // "android.not_a_preference.privacy.clear" key - which doesn't
928 // exist in Gecko - to satisfy this requirement. 922 // exist in Gecko - to satisfy this requirement.
929 if (isGeckoPref(key)) { 923 if (isGeckoPref(key)) {
930 prefs.add(key); 924 prefs.add(key);
931 } 925 }
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 intent.putExtra("resource", resource); 1560 intent.putExtra("resource", resource);
1567 } else { 1561 } else {
1568 intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, GeckoPrefere nceFragment.class.getName()); 1562 intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, GeckoPrefere nceFragment.class.getName());
1569 1563
1570 Bundle fragmentArgs = new Bundle(); 1564 Bundle fragmentArgs = new Bundle();
1571 fragmentArgs.putString("resource", resource); 1565 fragmentArgs.putString("resource", resource);
1572 intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fr agmentArgs); 1566 intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fr agmentArgs);
1573 } 1567 }
1574 } 1568 }
1575 } 1569 }
OLDNEW
« no previous file with comments | « no previous file | mobile/android/base/resources/xml/preferences_vendor.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld