Settings cleanup
Bug: 3259885
Cleans up the grouping of the settings and adds categories
Change-Id: I13666b36d8d55e0d9e17a732b5911a28a1223666
diff --git a/res/values/strings.xml b/res/values/strings.xml
index e762f8d..2a00f1d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -343,9 +343,13 @@
<!-- Settings summary -->
<string name="pref_content_autofit_summary">Format web pages to fit the screen</string>
- <!-- Settings screen & section title for "Personal settings". These include things like
+ <!-- Settings screen & section title for "General settings". These include things like
configuring bookmark syncing to Google servers and form auto fill settings. [CHAR-LIMIT=32] -->
- <string name="pref_personal_title">Personal settings</string>
+ <string name="pref_general_title">General</string>
+ <!-- Settings category for sync under general settings. This includes bookmark sync with Chrome [CHAR-LIMIT=50] -->
+ <string name="pref_general_sync_title">Sync</string>
+ <!-- Settings category for autofill under general. [CHAR-LIMIT=50] -->
+ <string name="pref_general_autofill_title">Autofill</string>
<!-- Checkbox setting to enable or disable syncing bookmarks and other data with Google Chrome. [CHAR-LIMIT=48] -->
<string name="pref_personal_sync_with_chrome">Sync with Google Chrome</string>
<!-- Checkbox setting to enable or disable syncing bookmarks and other data with Google Chrome. [CHAR-LIMIT=none] -->
@@ -412,14 +416,16 @@
it through the Browser Settings menu. [CHAR-LIMIT=NONE] -->
<string name="autofill_setup_dialog_negative_toast">AutoFill can always be configured through Browser Settings -> Personal Settings.</string>
- <!-- Settings screen, section title -->
- <string name="pref_privacy_title">Privacy settings</string>
+ <!-- Settings screen, section title [CHAR-LIMIT=50] -->
+ <string name="pref_privacy_security_title">Privacy & Security</string>
<!-- Settings label -->
<string name="pref_privacy_clear_cache">Clear cache</string>
<!-- Settings summary -->
<string name="pref_privacy_clear_cache_summary">Clear locally cached content and databases</string>
<!-- Confirmation dialog message -->
<string name="pref_privacy_clear_cache_dlg">Locally cached content and databases will be deleted.</string>
+ <!-- Cookie settings category [CHAR-LIMIT=50] -->
+ <string name="pref_privacy_cookies_title">Cookies</string>
<!-- Settings label -->
<string name="pref_privacy_clear_cookies">Clear all cookie data</string>
<!-- Settings summary -->
@@ -432,6 +438,8 @@
<string name="pref_privacy_clear_history_summary">Clear the browser navigation history</string>
<!-- Confirmation dialog message -->
<string name="pref_privacy_clear_history_dlg">The browser navigation history will be deleted.</string>
+ <!-- Formdata settings category [CHAR-LIMIT=50] -->
+ <string name="pref_privacy_formdata_title">Form data</string>
<!-- Settings label -->
<string name="pref_privacy_clear_form_data">Clear form data</string>
<!-- Settings summary -->
@@ -444,6 +452,8 @@
<string name="pref_privacy_clear_passwords_summary">Clear all saved passwords</string>
<!-- Confirmation dialog message -->
<string name="pref_privacy_clear_passwords_dlg">All saved passwords will be deleted.</string>
+ <!-- Location settings category [CHAR-LIMIT=50] -->
+ <string name="pref_privacy_location_title">Location</string>
<!-- Settings label -->
<string name="pref_privacy_enable_geolocation">Enable location</string>
<!-- Settings summary -->
@@ -454,8 +464,8 @@
<string name="pref_privacy_clear_geolocation_access_summary">Clear location access for all websites</string>
<!-- Confirmation dialog message -->
<string name="pref_privacy_clear_geolocation_access_dlg">Clear location access for all websites</string>
- <!-- Settings screen, section title -->
- <string name="pref_security_title">Security settings</string>
+ <!-- Passwords settings category [CHAR-LIMIT=50] -->
+ <string name="pref_security_passwords_title">Passwords</string>
<!-- Settings label -->
<string name="pref_security_remember_passwords">Remember passwords</string>
<!-- Settings summary -->
@@ -513,11 +523,13 @@
<!-- Settings summary -->
<string name="pref_content_load_page_summary">Show overview of newly opened pages</string>
<!-- Settings screen, section title -->
- <string name="pref_extras_title">Advanced settings</string>
+ <string name="pref_extras_title">Advanced</string>
<!-- Settings label -->
<string name="pref_extras_website_settings">Website settings</string>
<!-- Settings summary -->
<string name="pref_extras_website_settings_summary">Advanced settings for individual websites</string>
+ <!-- Settings category label [CHAR-LIMIT=50] -->
+ <string name="pref_extras_reset_default_title">Reset defaults</string>
<!-- Settings label -->
<string name="pref_extras_reset_default">Reset to default</string>
<!-- Settings summary -->
diff --git a/res/xml/advanced_preferences.xml b/res/xml/advanced_preferences.xml
index 075232d..3264d22 100644
--- a/res/xml/advanced_preferences.xml
+++ b/res/xml/advanced_preferences.xml
@@ -17,19 +17,89 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
- <!-- Entries and values in this list are set dynamically. -->
- <com.android.browser.search.SearchEnginePreference
- android:key="search_engine"
- android:title="@string/pref_content_search_engine"
- android:defaultValue="google"
- android:summary="@string/pref_content_search_engine_summary"
- android:dialogTitle="@string/pref_content_search_engine" />
+ <!-- Entries and values in this list are set dynamically. -->
+ <com.android.browser.search.SearchEnginePreference
+ android:key="search_engine"
+ android:title="@string/pref_content_search_engine"
+ android:defaultValue="google"
+ android:summary="@string/pref_content_search_engine_summary"
+ android:dialogTitle="@string/pref_content_search_engine" />
- <PreferenceScreen
- android:key="website_settings"
- android:title="@string/pref_extras_website_settings"
- android:summary="@string/pref_extras_website_settings_summary" />
+ <CheckBoxPreference
+ android:key="open_in_background"
+ android:defaultValue="false"
+ android:title="@string/pref_content_open_in_background"
+ android:summary="@string/pref_content_open_in_background_summary" />
+ <CheckBoxPreference
+ android:key="enable_javascript"
+ android:defaultValue="true"
+ android:title="@string/pref_content_javascript" />
+
+ <ListPreference
+ android:key="plugin_state"
+ android:title="@string/pref_content_plugins"
+ android:defaultValue="ON"
+ android:entries="@array/pref_content_plugins_choices"
+ android:entryValues="@array/pref_content_plugins_values"
+ android:dialogTitle="@string/pref_content_plugins" />
+
+ <PreferenceScreen
+ android:key="website_settings"
+ android:title="@string/pref_extras_website_settings"
+ android:summary="@string/pref_extras_website_settings_summary" />
+
+ <PreferenceCategory android:title="@string/pref_content_title">
+ <ListPreference
+ android:key="text_size"
+ android:title="@string/pref_text_size"
+ android:defaultValue="NORMAL"
+ android:entries="@array/pref_text_size_choices"
+ android:entryValues="@array/pref_text_size_values"
+ android:dialogTitle="@string/pref_text_size_dialogtitle" />
+
+ <ListPreference
+ android:key="default_zoom"
+ android:title="@string/pref_default_zoom"
+ android:defaultValue="MEDIUM"
+ android:entries="@array/pref_default_zoom_choices"
+ android:entryValues="@array/pref_default_zoom_values"
+ android:dialogTitle="@string/pref_default_zoom_dialogtitle" />
+
+ <CheckBoxPreference
+ android:key="load_page"
+ android:defaultValue="true"
+ android:title="@string/pref_content_load_page"
+ android:summary="@string/pref_content_load_page_summary" />
+
+ <CheckBoxPreference
+ android:key="autofit_pages"
+ android:defaultValue="true"
+ android:title="@string/pref_content_autofit"
+ android:summary="@string/pref_content_autofit_summary" />
+
+ <CheckBoxPreference
+ android:key="block_popup_windows"
+ android:defaultValue="true"
+ android:title="@string/pref_content_block_popups" />
+
+ <CheckBoxPreference
+ android:key="load_images"
+ android:defaultValue="true"
+ android:title="@string/pref_content_load_images"
+ android:summary="@string/pref_content_load_images_summary" />
+
+ <ListPreference
+ android:key="default_text_encoding"
+ android:title="@string/pref_default_text_encoding"
+ android:defaultValue="@string/pref_default_text_encoding_default"
+ android:entries="@array/pref_default_text_encoding_choices"
+ android:entryValues="@array/pref_default_text_encoding_values"
+ android:dialogTitle="@string/pref_default_text_encoding_dialogtitle" />
+
+ </PreferenceCategory>
+
+ <PreferenceCategory android:title="@string/pref_extras_reset_default_title">
<com.android.browser.BrowserYesNoPreference
android:key="reset_default_preferences"
android:title="@string/pref_extras_reset_default"
@@ -37,5 +107,6 @@
android:dialogMessage="@string/pref_extras_reset_default_dlg"
android:dialogTitle="@string/pref_extras_reset_default_dlg_title"
android:dialogIcon="@android:drawable/ic_dialog_alert" />
+ </PreferenceCategory>
</PreferenceScreen>
diff --git a/res/xml/general_preferences.xml b/res/xml/general_preferences.xml
new file mode 100644
index 0000000..92b1f2a
--- /dev/null
+++ b/res/xml/general_preferences.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <com.android.browser.BrowserHomepagePreference
+ android:key="homepage"
+ android:title="@string/pref_content_homepage"
+ android:hint="@string/http"
+ android:inputType="textUri|textMultiLine" />
+
+ <PreferenceCategory android:title="@string/pref_general_sync_title">
+ <Preference android:key="sync_with_chrome"
+ android:title="@string/pref_personal_sync_with_chrome"
+ android:summary="@string/pref_personal_sync_with_chrome_summary"
+ />
+ </PreferenceCategory>
+
+ <PreferenceCategory android:title="@string/pref_general_autofill_title">
+ <CheckBoxPreference android:key="autofill_enabled"
+ android:title="@string/pref_autofill_enabled"
+ android:summary="@string/pref_autofill_enabled_summary"
+ android:defaultValue="true"
+ />
+
+ <PreferenceScreen
+ android:fragment="com.android.browser.AutoFillSettingsFragment"
+ android:key="autofill_profile"
+ android:title="@string/pref_autofill_profile_editor"
+ android:summary="@string/pref_autofill_profile_editor_summary" />
+ </PreferenceCategory>
+
+</PreferenceScreen>
diff --git a/res/xml/page_content_preferences.xml b/res/xml/page_content_preferences.xml
deleted file mode 100644
index 3d7791c..0000000
--- a/res/xml/page_content_preferences.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<PreferenceScreen
- xmlns:android="http://schemas.android.com/apk/res/android">
-
- <ListPreference
- android:key="text_size"
- android:title="@string/pref_text_size"
- android:defaultValue="NORMAL"
- android:entries="@array/pref_text_size_choices"
- android:entryValues="@array/pref_text_size_values"
- android:dialogTitle="@string/pref_text_size_dialogtitle" />
-
- <ListPreference
- android:key="default_zoom"
- android:title="@string/pref_default_zoom"
- android:defaultValue="MEDIUM"
- android:entries="@array/pref_default_zoom_choices"
- android:entryValues="@array/pref_default_zoom_values"
- android:dialogTitle="@string/pref_default_zoom_dialogtitle" />
-
- <CheckBoxPreference
- android:key="load_page"
- android:defaultValue="true"
- android:title="@string/pref_content_load_page"
- android:summary="@string/pref_content_load_page_summary" />
-
- <ListPreference
- android:key="default_text_encoding"
- android:title="@string/pref_default_text_encoding"
- android:defaultValue="@string/pref_default_text_encoding_default"
- android:entries="@array/pref_default_text_encoding_choices"
- android:entryValues="@array/pref_default_text_encoding_values"
- android:dialogTitle="@string/pref_default_text_encoding_dialogtitle" />
-
- <CheckBoxPreference
- android:key="block_popup_windows"
- android:defaultValue="true"
- android:title="@string/pref_content_block_popups" />
-
- <CheckBoxPreference
- android:key="load_images"
- android:defaultValue="true"
- android:title="@string/pref_content_load_images"
- android:summary="@string/pref_content_load_images_summary" />
-
- <CheckBoxPreference
- android:key="autofit_pages"
- android:defaultValue="true"
- android:title="@string/pref_content_autofit"
- android:summary="@string/pref_content_autofit_summary" />
-
- <CheckBoxPreference
- android:key="enable_javascript"
- android:defaultValue="true"
- android:title="@string/pref_content_javascript" />
-
- <ListPreference
- android:key="plugin_state"
- android:title="@string/pref_content_plugins"
- android:defaultValue="ON"
- android:entries="@array/pref_content_plugins_choices"
- android:entryValues="@array/pref_content_plugins_values"
- android:dialogTitle="@string/pref_content_plugins" />
-
- <CheckBoxPreference
- android:key="open_in_background"
- android:defaultValue="false"
- android:title="@string/pref_content_open_in_background"
- android:summary="@string/pref_content_open_in_background_summary" />
-
- <com.android.browser.BrowserHomepagePreference
- android:key="homepage"
- android:title="@string/pref_content_homepage"
- android:hint="@string/http"
- android:inputType="textUri|textMultiLine" />
-
-</PreferenceScreen>
diff --git a/res/xml/personal_preferences.xml b/res/xml/personal_preferences.xml
deleted file mode 100644
index 30ebae2..0000000
--- a/res/xml/personal_preferences.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
-
- <Preference android:key="sync_with_chrome"
- android:title="@string/pref_personal_sync_with_chrome"
- android:summary="@string/pref_personal_sync_with_chrome_summary"
- />
-
- <CheckBoxPreference android:key="autofill_enabled"
- android:title="@string/pref_autofill_enabled"
- android:summary="@string/pref_autofill_enabled_summary"
- android:defaultValue="true"
- />
-
- <PreferenceScreen
- android:fragment="com.android.browser.AutoFillSettingsFragment"
- android:key="autofill_profile"
- android:title="@string/pref_autofill_profile_editor"
- android:summary="@string/pref_autofill_profile_editor_summary" />
-
-</PreferenceScreen>
diff --git a/res/xml/preference_headers.xml b/res/xml/preference_headers.xml
index 8533a3a..cdf259c 100644
--- a/res/xml/preference_headers.xml
+++ b/res/xml/preference_headers.xml
@@ -16,20 +16,12 @@
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
- <header android:fragment="com.android.browser.preferences.PageContentPreferencesFragment"
- android:title="@string/pref_content_title"
+ <header android:fragment="com.android.browser.preferences.GeneralPreferencesFragment"
+ android:title="@string/pref_general_title"
/>
- <header android:fragment="com.android.browser.preferences.PersonalPreferencesFragment"
- android:title="@string/pref_personal_title"
- />
-
- <header android:fragment="com.android.browser.preferences.PrivacyPreferencesFragment"
- android:title="@string/pref_privacy_title"
- />
-
- <header android:fragment="com.android.browser.preferences.SecurityPreferencesFragment"
- android:title="@string/pref_security_title"
+ <header android:fragment="com.android.browser.preferences.PrivacySecurityPreferencesFragment"
+ android:title="@string/pref_privacy_security_title"
/>
<header android:fragment="com.android.browser.preferences.AdvancedPreferencesFragment"
diff --git a/res/xml/privacy_preferences.xml b/res/xml/privacy_preferences.xml
deleted file mode 100644
index a6ea16b..0000000
--- a/res/xml/privacy_preferences.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<PreferenceScreen
- xmlns:android="http://schemas.android.com/apk/res/android">
-
- <com.android.browser.BrowserYesNoPreference
- android:key="privacy_clear_cache"
- android:title="@string/pref_privacy_clear_cache"
- android:summary="@string/pref_privacy_clear_cache_summary"
- android:dialogMessage="@string/pref_privacy_clear_cache_dlg"
- android:dialogTitle="@string/clear"
- android:dialogIcon="@android:drawable/ic_dialog_alert" />
-
- <com.android.browser.BrowserYesNoPreference
- android:key="privacy_clear_history"
- android:title="@string/pref_privacy_clear_history"
- android:summary="@string/pref_privacy_clear_history_summary"
- android:dialogMessage="@string/pref_privacy_clear_history_dlg"
- android:dialogTitle="@string/clear"
- android:dialogIcon="@android:drawable/ic_dialog_alert"/>
-
- <CheckBoxPreference
- android:key="accept_cookies"
- android:defaultValue="true"
- android:title="@string/pref_security_accept_cookies"
- android:summary="@string/pref_security_accept_cookies_summary" />
-
- <com.android.browser.BrowserYesNoPreference
- android:key="privacy_clear_cookies"
- android:title="@string/pref_privacy_clear_cookies"
- android:summary="@string/pref_privacy_clear_cookies_summary"
- android:dialogMessage="@string/pref_privacy_clear_cookies_dlg"
- android:dialogTitle="@string/clear"
- android:dialogIcon="@android:drawable/ic_dialog_alert"/>
-
- <CheckBoxPreference
- android:key="save_formdata"
- android:defaultValue="true"
- android:title="@string/pref_security_save_form_data"
- android:summary="@string/pref_security_save_form_data_summary" />
-
- <com.android.browser.BrowserYesNoPreference
- android:key="privacy_clear_form_data"
- android:title="@string/pref_privacy_clear_form_data"
- android:summary="@string/pref_privacy_clear_form_data_summary"
- android:dialogMessage="@string/pref_privacy_clear_form_data_dlg"
- android:dialogTitle="@string/clear"
- android:dialogIcon="@android:drawable/ic_dialog_alert"/>
-
- <CheckBoxPreference
- android:key="enable_geolocation"
- android:defaultValue="true"
- android:title="@string/pref_privacy_enable_geolocation"
- android:summary="@string/pref_privacy_enable_geolocation_summary" />
-
- <com.android.browser.BrowserYesNoPreference
- android:key="privacy_clear_geolocation_access"
- android:dependency="enable_geolocation"
- android:title="@string/pref_privacy_clear_geolocation_access"
- android:summary="@string/pref_privacy_clear_geolocation_access_summary"
- android:dialogMessage="@string/pref_privacy_clear_geolocation_access_dlg"
- android:dialogTitle="@string/clear"
- android:dialogIcon="@android:drawable/ic_dialog_alert"/>
-
-</PreferenceScreen>
diff --git a/res/xml/privacy_security_preferences.xml b/res/xml/privacy_security_preferences.xml
new file mode 100644
index 0000000..50802ca
--- /dev/null
+++ b/res/xml/privacy_security_preferences.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <com.android.browser.BrowserYesNoPreference
+ android:key="privacy_clear_cache"
+ android:title="@string/pref_privacy_clear_cache"
+ android:summary="@string/pref_privacy_clear_cache_summary"
+ android:dialogMessage="@string/pref_privacy_clear_cache_dlg"
+ android:dialogTitle="@string/clear"
+ android:dialogIcon="@android:drawable/ic_dialog_alert" />
+
+ <com.android.browser.BrowserYesNoPreference
+ android:key="privacy_clear_history"
+ android:title="@string/pref_privacy_clear_history"
+ android:summary="@string/pref_privacy_clear_history_summary"
+ android:dialogMessage="@string/pref_privacy_clear_history_dlg"
+ android:dialogTitle="@string/clear"
+ android:dialogIcon="@android:drawable/ic_dialog_alert"/>
+
+ <CheckBoxPreference
+ android:key="show_security_warnings"
+ android:defaultValue="true"
+ android:title="@string/pref_security_show_security_warning"
+ android:summary="@string/pref_security_show_security_warning_summary" />
+
+ <PreferenceCategory android:title="@string/pref_privacy_cookies_title">
+ <CheckBoxPreference
+ android:key="accept_cookies"
+ android:defaultValue="true"
+ android:title="@string/pref_security_accept_cookies"
+ android:summary="@string/pref_security_accept_cookies_summary" />
+
+ <com.android.browser.BrowserYesNoPreference
+ android:key="privacy_clear_cookies"
+ android:title="@string/pref_privacy_clear_cookies"
+ android:summary="@string/pref_privacy_clear_cookies_summary"
+ android:dialogMessage="@string/pref_privacy_clear_cookies_dlg"
+ android:dialogTitle="@string/clear"
+ android:dialogIcon="@android:drawable/ic_dialog_alert"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory android:title="@string/pref_privacy_formdata_title">
+ <CheckBoxPreference
+ android:key="save_formdata"
+ android:defaultValue="true"
+ android:title="@string/pref_security_save_form_data"
+ android:summary="@string/pref_security_save_form_data_summary" />
+
+ <com.android.browser.BrowserYesNoPreference
+ android:key="privacy_clear_form_data"
+ android:title="@string/pref_privacy_clear_form_data"
+ android:summary="@string/pref_privacy_clear_form_data_summary"
+ android:dialogMessage="@string/pref_privacy_clear_form_data_dlg"
+ android:dialogTitle="@string/clear"
+ android:dialogIcon="@android:drawable/ic_dialog_alert"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory android:title="@string/pref_privacy_location_title">
+ <CheckBoxPreference
+ android:key="enable_geolocation"
+ android:defaultValue="true"
+ android:title="@string/pref_privacy_enable_geolocation"
+ android:summary="@string/pref_privacy_enable_geolocation_summary" />
+
+ <com.android.browser.BrowserYesNoPreference
+ android:key="privacy_clear_geolocation_access"
+ android:dependency="enable_geolocation"
+ android:title="@string/pref_privacy_clear_geolocation_access"
+ android:summary="@string/pref_privacy_clear_geolocation_access_summary"
+ android:dialogMessage="@string/pref_privacy_clear_geolocation_access_dlg"
+ android:dialogTitle="@string/clear"
+ android:dialogIcon="@android:drawable/ic_dialog_alert"/>
+ </PreferenceCategory>
+
+ <PreferenceCategory android:title="@string/pref_security_passwords_title">
+ <CheckBoxPreference
+ android:key="remember_passwords"
+ android:defaultValue="true"
+ android:title="@string/pref_security_remember_passwords"
+ android:summary="@string/pref_security_remember_passwords_summary" />
+
+ <com.android.browser.BrowserYesNoPreference
+ android:key="privacy_clear_passwords"
+ android:title="@string/pref_privacy_clear_passwords"
+ android:summary="@string/pref_privacy_clear_passwords_summary"
+ android:dialogMessage="@string/pref_privacy_clear_passwords_dlg"
+ android:dialogTitle="@string/clear"
+ android:dialogIcon="@android:drawable/ic_dialog_alert"/>
+ </PreferenceCategory>
+
+</PreferenceScreen>
diff --git a/res/xml/security_preferences.xml b/res/xml/security_preferences.xml
deleted file mode 100644
index 8d4464b..0000000
--- a/res/xml/security_preferences.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<PreferenceScreen
- xmlns:android="http://schemas.android.com/apk/res/android">
-
- <CheckBoxPreference
- android:key="remember_passwords"
- android:defaultValue="true"
- android:title="@string/pref_security_remember_passwords"
- android:summary="@string/pref_security_remember_passwords_summary" />
-
- <com.android.browser.BrowserYesNoPreference
- android:key="privacy_clear_passwords"
- android:title="@string/pref_privacy_clear_passwords"
- android:summary="@string/pref_privacy_clear_passwords_summary"
- android:dialogMessage="@string/pref_privacy_clear_passwords_dlg"
- android:dialogTitle="@string/clear"
- android:dialogIcon="@android:drawable/ic_dialog_alert"/>
-
- <CheckBoxPreference
- android:key="show_security_warnings"
- android:defaultValue="true"
- android:title="@string/pref_security_show_security_warning"
- android:summary="@string/pref_security_show_security_warning_summary" />
-
-</PreferenceScreen>
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index 1b8acc6..267056e 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -739,10 +739,8 @@
reset();
SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(ctx);
p.edit().clear().apply();
- PreferenceManager.setDefaultValues(ctx, R.xml.page_content_preferences, true);
- PreferenceManager.setDefaultValues(ctx, R.xml.personal_preferences, true);
- PreferenceManager.setDefaultValues(ctx, R.xml.privacy_preferences, true);
- PreferenceManager.setDefaultValues(ctx, R.xml.security_preferences, true);
+ PreferenceManager.setDefaultValues(ctx, R.xml.general_preferences, true);
+ PreferenceManager.setDefaultValues(ctx, R.xml.privacy_security_preferences, true);
PreferenceManager.setDefaultValues(ctx, R.xml.advanced_preferences, true);
// reset homeUrl
setHomePage(ctx, getFactoryResetHomeUrl(ctx));
diff --git a/src/com/android/browser/preferences/AdvancedPreferencesFragment.java b/src/com/android/browser/preferences/AdvancedPreferencesFragment.java
index 952e04a..dd3a9ca 100644
--- a/src/com/android/browser/preferences/AdvancedPreferencesFragment.java
+++ b/src/com/android/browser/preferences/AdvancedPreferencesFragment.java
@@ -19,10 +19,12 @@
import com.android.browser.BrowserSettings;
import com.android.browser.R;
+import android.content.res.Resources;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceScreen;
+import android.util.Log;
import android.webkit.GeolocationPermissions;
import android.webkit.ValueCallback;
import android.webkit.WebStorage;
@@ -30,7 +32,7 @@
import java.util.Map;
import java.util.Set;
-public class AdvancedPreferencesFragment extends PreferenceFragment
+public class AdvancedPreferencesFragment extends PreferenceFragment
implements Preference.OnPreferenceChangeListener {
@Override
@@ -43,6 +45,21 @@
PreferenceScreen websiteSettings = (PreferenceScreen) findPreference(
BrowserSettings.PREF_WEBSITE_SETTINGS);
websiteSettings.setFragment(WebsiteSettingsFragment.class.getName());
+
+ Preference e = findPreference(BrowserSettings.PREF_TEXT_SIZE);
+ e.setOnPreferenceChangeListener(this);
+ e.setSummary(getVisualTextSizeName(
+ getPreferenceScreen().getSharedPreferences()
+ .getString(BrowserSettings.PREF_TEXT_SIZE, null)) );
+
+ e = findPreference(BrowserSettings.PREF_DEFAULT_ZOOM);
+ e.setOnPreferenceChangeListener(this);
+ e.setSummary(getVisualDefaultZoomName(
+ getPreferenceScreen().getSharedPreferences()
+ .getString(BrowserSettings.PREF_DEFAULT_ZOOM, null)) );
+
+ e = findPreference(BrowserSettings.PREF_DEFAULT_TEXT_ENCODING);
+ e.setOnPreferenceChangeListener(this);
}
/*
@@ -76,7 +93,23 @@
@Override
public boolean onPreferenceChange(Preference pref, Object objValue) {
- if (pref.getKey().equals(BrowserSettings.PREF_EXTRAS_RESET_DEFAULTS)) {
+ if (getActivity() == null) {
+ // We aren't attached, so don't accept preferences changes from the
+ // invisible UI.
+ Log.w("PageContentPreferencesFragment", "onPreferenceChange called from detached fragment!");
+ return false;
+ }
+
+ if (pref.getKey().equals(BrowserSettings.PREF_TEXT_SIZE)) {
+ pref.setSummary(getVisualTextSizeName((String) objValue));
+ return true;
+ } else if (pref.getKey().equals(BrowserSettings.PREF_DEFAULT_ZOOM)) {
+ pref.setSummary(getVisualDefaultZoomName((String) objValue));
+ return true;
+ } else if (pref.getKey().equals(BrowserSettings.PREF_DEFAULT_TEXT_ENCODING)) {
+ pref.setSummary((String) objValue);
+ return true;
+ } else if (pref.getKey().equals(BrowserSettings.PREF_EXTRAS_RESET_DEFAULTS)) {
Boolean value = (Boolean) objValue;
if (value.booleanValue() == true) {
getActivity().finish();
@@ -85,4 +118,44 @@
}
return false;
}
+
+ private CharSequence getVisualTextSizeName(String enumName) {
+ Resources res = getActivity().getResources();
+ CharSequence[] visualNames = res.getTextArray(R.array.pref_text_size_choices);
+ CharSequence[] enumNames = res.getTextArray(R.array.pref_text_size_values);
+
+ // Sanity check
+ if (visualNames.length != enumNames.length) {
+ return "";
+ }
+
+ int length = enumNames.length;
+ for (int i = 0; i < length; i++) {
+ if (enumNames[i].equals(enumName)) {
+ return visualNames[i];
+ }
+ }
+
+ return "";
+ }
+
+ private CharSequence getVisualDefaultZoomName(String enumName) {
+ Resources res = getActivity().getResources();
+ CharSequence[] visualNames = res.getTextArray(R.array.pref_default_zoom_choices);
+ CharSequence[] enumNames = res.getTextArray(R.array.pref_default_zoom_values);
+
+ // Sanity check
+ if (visualNames.length != enumNames.length) {
+ return "";
+ }
+
+ int length = enumNames.length;
+ for (int i = 0; i < length; i++) {
+ if (enumNames[i].equals(enumName)) {
+ return visualNames[i];
+ }
+ }
+
+ return "";
+ }
}
\ No newline at end of file
diff --git a/src/com/android/browser/preferences/PersonalPreferencesFragment.java b/src/com/android/browser/preferences/GeneralPreferencesFragment.java
similarity index 92%
rename from src/com/android/browser/preferences/PersonalPreferencesFragment.java
rename to src/com/android/browser/preferences/GeneralPreferencesFragment.java
index 38ebbae..7545ba8 100644
--- a/src/com/android/browser/preferences/PersonalPreferencesFragment.java
+++ b/src/com/android/browser/preferences/GeneralPreferencesFragment.java
@@ -17,6 +17,8 @@
package com.android.browser.preferences;
import com.android.browser.BrowserBookmarksPage;
+import com.android.browser.BrowserHomepagePreference;
+import com.android.browser.BrowserPreferencesPage;
import com.android.browser.BrowserSettings;
import com.android.browser.R;
@@ -55,8 +57,8 @@
import java.util.ArrayList;
-public class PersonalPreferencesFragment extends PreferenceFragment
- implements OnPreferenceClickListener {
+public class GeneralPreferencesFragment extends PreferenceFragment
+ implements OnPreferenceClickListener, Preference.OnPreferenceChangeListener {
static final String TAG = "PersonalPreferencesFragment";
static final String PREF_CHROME_SYNC = "sync_with_chrome";
@@ -70,7 +72,31 @@
super.onCreate(savedInstanceState);
// Load the XML preferences file
- addPreferencesFromResource(R.xml.personal_preferences);
+ addPreferencesFromResource(R.xml.general_preferences);
+
+ Preference e = findPreference(BrowserSettings.PREF_HOMEPAGE);
+ e.setOnPreferenceChangeListener(this);
+ e.setSummary(getPreferenceScreen().getSharedPreferences()
+ .getString(BrowserSettings.PREF_HOMEPAGE, null));
+ ((BrowserHomepagePreference) e).setCurrentPage(
+ getActivity().getIntent().getStringExtra(BrowserPreferencesPage.CURRENT_PAGE));
+ }
+
+ @Override
+ public boolean onPreferenceChange(Preference pref, Object objValue) {
+ if (getActivity() == null) {
+ // We aren't attached, so don't accept preferences changes from the
+ // invisible UI.
+ Log.w("PageContentPreferencesFragment", "onPreferenceChange called from detached fragment!");
+ return false;
+ }
+
+ if (pref.getKey().equals(BrowserSettings.PREF_HOMEPAGE)) {
+ pref.setSummary((String) objValue);
+ return true;
+ }
+
+ return false;
}
@Override
@@ -126,7 +152,7 @@
Bundle args = mChromeSync.getExtras();
args.putParcelableArray("accounts", accounts);
mEnabled = BrowserContract.Settings.isSyncEnabled(mContext);
- mChromeSync.setOnPreferenceClickListener(PersonalPreferencesFragment.this);
+ mChromeSync.setOnPreferenceClickListener(GeneralPreferencesFragment.this);
if (!mEnabled) {
// Setup a link to the enable wizard
diff --git a/src/com/android/browser/preferences/PageContentPreferencesFragment.java b/src/com/android/browser/preferences/PageContentPreferencesFragment.java
deleted file mode 100644
index 4be14a6..0000000
--- a/src/com/android/browser/preferences/PageContentPreferencesFragment.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-package com.android.browser.preferences;
-
-import com.android.browser.BrowserHomepagePreference;
-import com.android.browser.BrowserPreferencesPage;
-import com.android.browser.BrowserSettings;
-import com.android.browser.R;
-
-import android.content.res.Resources;
-import android.net.Uri;
-import android.os.Bundle;
-import android.preference.EditTextPreference;
-import android.preference.Preference;
-import android.preference.PreferenceFragment;
-import android.util.Log;
-
-public class PageContentPreferencesFragment extends PreferenceFragment
- implements Preference.OnPreferenceChangeListener {
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- // Load the preferences from an XML resource
- addPreferencesFromResource(R.xml.page_content_preferences);
-
- Preference e = findPreference(BrowserSettings.PREF_HOMEPAGE);
- e.setOnPreferenceChangeListener(this);
- e.setSummary(getPreferenceScreen().getSharedPreferences()
- .getString(BrowserSettings.PREF_HOMEPAGE, null));
- ((BrowserHomepagePreference) e).setCurrentPage(
- getActivity().getIntent().getStringExtra(BrowserPreferencesPage.CURRENT_PAGE));
-
- e = findPreference(BrowserSettings.PREF_TEXT_SIZE);
- e.setOnPreferenceChangeListener(this);
- e.setSummary(getVisualTextSizeName(
- getPreferenceScreen().getSharedPreferences()
- .getString(BrowserSettings.PREF_TEXT_SIZE, null)) );
-
- e = findPreference(BrowserSettings.PREF_DEFAULT_ZOOM);
- e.setOnPreferenceChangeListener(this);
- e.setSummary(getVisualDefaultZoomName(
- getPreferenceScreen().getSharedPreferences()
- .getString(BrowserSettings.PREF_DEFAULT_ZOOM, null)) );
-
- e = findPreference(BrowserSettings.PREF_DEFAULT_TEXT_ENCODING);
- e.setOnPreferenceChangeListener(this);
- }
-
- @Override
- public boolean onPreferenceChange(Preference pref, Object objValue) {
- if (getActivity() == null) {
- // We aren't attached, so don't accept preferences changes from the
- // invisible UI.
- Log.w("PageContentPreferencesFragment", "onPreferenceChange called from detached fragment!");
- return false;
- }
-
- if (pref.getKey().equals(BrowserSettings.PREF_HOMEPAGE)) {
- pref.setSummary((String) objValue);
- return true;
- } else if (pref.getKey().equals(BrowserSettings.PREF_TEXT_SIZE)) {
- pref.setSummary(getVisualTextSizeName((String) objValue));
- return true;
- } else if (pref.getKey().equals(BrowserSettings.PREF_DEFAULT_ZOOM)) {
- pref.setSummary(getVisualDefaultZoomName((String) objValue));
- return true;
- } else if (pref.getKey().equals(BrowserSettings.PREF_DEFAULT_TEXT_ENCODING)) {
- pref.setSummary((String) objValue);
- return true;
- }
-
- return false;
- }
-
- private CharSequence getVisualTextSizeName(String enumName) {
- Resources res = getActivity().getResources();
- CharSequence[] visualNames = res.getTextArray(R.array.pref_text_size_choices);
- CharSequence[] enumNames = res.getTextArray(R.array.pref_text_size_values);
-
- // Sanity check
- if (visualNames.length != enumNames.length) {
- return "";
- }
-
- int length = enumNames.length;
- for (int i = 0; i < length; i++) {
- if (enumNames[i].equals(enumName)) {
- return visualNames[i];
- }
- }
-
- return "";
- }
-
- private CharSequence getVisualDefaultZoomName(String enumName) {
- Resources res = getActivity().getResources();
- CharSequence[] visualNames = res.getTextArray(R.array.pref_default_zoom_choices);
- CharSequence[] enumNames = res.getTextArray(R.array.pref_default_zoom_values);
-
- // Sanity check
- if (visualNames.length != enumNames.length) {
- return "";
- }
-
- int length = enumNames.length;
- for (int i = 0; i < length; i++) {
- if (enumNames[i].equals(enumName)) {
- return visualNames[i];
- }
- }
-
- return "";
- }
-}
\ No newline at end of file
diff --git a/src/com/android/browser/preferences/PrivacyPreferencesFragment.java b/src/com/android/browser/preferences/PrivacySecurityPreferencesFragment.java
similarity index 92%
rename from src/com/android/browser/preferences/PrivacyPreferencesFragment.java
rename to src/com/android/browser/preferences/PrivacySecurityPreferencesFragment.java
index 79f2084..8a5178c 100644
--- a/src/com/android/browser/preferences/PrivacyPreferencesFragment.java
+++ b/src/com/android/browser/preferences/PrivacySecurityPreferencesFragment.java
@@ -25,7 +25,7 @@
import android.preference.Preference;
import android.preference.PreferenceFragment;
-public class PrivacyPreferencesFragment extends PreferenceFragment
+public class PrivacySecurityPreferencesFragment extends PreferenceFragment
implements Preference.OnPreferenceChangeListener {
@Override
@@ -33,7 +33,7 @@
super.onCreate(savedInstanceState);
// Load the preferences from an XML resource
- addPreferencesFromResource(R.xml.privacy_preferences);
+ addPreferencesFromResource(R.xml.privacy_security_preferences);
Preference e = findPreference(BrowserSettings.PREF_CLEAR_HISTORY);
e.setOnPreferenceChangeListener(this);
@@ -49,7 +49,7 @@
pref.getKey()));
return true;
}
-
+
return false;
}
}
diff --git a/src/com/android/browser/preferences/SecurityPreferencesFragment.java b/src/com/android/browser/preferences/SecurityPreferencesFragment.java
deleted file mode 100644
index d20a50c..0000000
--- a/src/com/android/browser/preferences/SecurityPreferencesFragment.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-package com.android.browser.preferences;
-
-import com.android.browser.R;
-
-import android.os.Bundle;
-import android.preference.PreferenceFragment;
-
-public class SecurityPreferencesFragment extends PreferenceFragment {
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- // Load the XML preferences file
- addPreferencesFromResource(R.xml.security_preferences);
- }
-}