Cleanup of settings menu

- Removed obsolete items
- Rearranged similar items together
- Reduced the depth of menu

Change-Id: I693dbb2b3c8cb244329be965f49ab288b73efa1a
diff --git a/res/xml/general_preferences.xml b/res/xml/general_preferences.xml
index 6f42d3d..b965ae6 100644
--- a/res/xml/general_preferences.xml
+++ b/res/xml/general_preferences.xml
@@ -16,24 +16,224 @@
 
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <com.android.browser.preferences.NonformattingListPreference
-        android:key="homepage_picker"
-        android:entries="@array/pref_homepage_choices"
-        android:entryValues="@array/pref_homepage_values"
-        android:title="@string/pref_content_homepage" />
+    <PreferenceCategory android:title="@string/pref_general_title">
+        <com.android.browser.preferences.NonformattingListPreference
+            android:key="homepage_picker"
+            android:entries="@array/pref_homepage_choices"
+            android:entryValues="@array/pref_homepage_values"
+            android:title="@string/pref_content_homepage" />
 
-    <PreferenceCategory android:title="@string/pref_general_autofill_title">
-        <CheckBoxPreference android:key="autofill_enabled"
+        <com.android.browser.search.SearchEnginePreference
+            android:defaultValue="google"
+            android:dialogTitle="@string/pref_content_search_engine"
+            android:key="search_engine"
+            android:summary="@string/pref_content_search_engine_summary"
+            android:title="@string/pref_content_search_engine" />
+
+        <CheckBoxPreference
+            android:defaultValue="false"
+            android:key="fullscreen"
+            android:summary="@string/pref_lab_fullscreen_summary"
+            android:title="@string/pref_lab_fullscreen" />
+
+        <CheckBoxPreference
+            android:key="autofill_enabled"
             android:title="@string/pref_autofill_enabled"
             android:summary="@string/pref_autofill_enabled_summary"
-            android:defaultValue="true"
-        />
+            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>
 
+    <PreferenceCategory android:title="@string/pref_extras_title"
+        android:key="advanced">
+
+        <PreferenceScreen android:title="@string/pref_privacy_security_title">
+            <PreferenceScreen android:title="@string/webstorage_clear_data_title">
+                <com.android.browser.BrowserYesNoPreference
+                    android:dialogIcon="@android:drawable/ic_dialog_alert"
+                    android:dialogMessage="@string/pref_privacy_clear_selected_dlg"
+                    android:key="privacy_clear_selected"
+                    android:summary="@string/pref_privacy_clear_selected_summary"
+                    android:title="@string/pref_privacy_clear_selected" />
+
+                <CheckBoxPreference
+                    android:defaultValue="true"
+                    android:key="privacy_clear_history"
+                    android:summary="@string/pref_privacy_clear_history_summary"
+                    android:title="@string/pref_privacy_clear_history" />
+
+                <CheckBoxPreference
+                    android:defaultValue="true"
+                    android:key="privacy_clear_cache"
+                    android:summary="@string/pref_privacy_clear_cache_summary"
+                    android:title="@string/pref_privacy_clear_cache" />
+
+                <CheckBoxPreference
+                    android:defaultValue="true"
+                    android:key="privacy_clear_cookies"
+                    android:summary="@string/pref_privacy_clear_cookies_summary"
+                    android:title="@string/pref_privacy_clear_cookies" />
+
+                <CheckBoxPreference
+                    android:defaultValue="true"
+                    android:key="privacy_clear_form_data"
+                    android:summary="@string/pref_privacy_clear_form_data_summary"
+                    android:title="@string/pref_privacy_clear_form_data" />
+
+                <CheckBoxPreference
+                    android:defaultValue="true"
+                    android:key="privacy_clear_passwords"
+                    android:summary="@string/pref_privacy_clear_passwords_summary"
+                    android:title="@string/pref_privacy_clear_passwords" />
+
+                <CheckBoxPreference
+                    android:defaultValue="true"
+                    android:dependency="enable_geolocation"
+                    android:key="privacy_clear_geolocation_access"
+                    android:summary="@string/pref_privacy_clear_geolocation_access_summary"
+                    android:title="@string/pref_privacy_clear_geolocation_access" />
+
+            </PreferenceScreen>
+
+            <CheckBoxPreference
+                android:defaultValue="true"
+                android:key="show_security_warnings"
+                android:summary="@string/pref_security_show_security_warning_summary"
+                android:title="@string/pref_security_show_security_warning" />
+
+            <CheckBoxPreference
+                android:defaultValue="true"
+                android:key="do_not_track"
+                android:summary="@string/pref_do_not_track_summary"
+                android:title="@string/pref_do_not_track" />
+
+            <CheckBoxPreference
+                android:defaultValue="true"
+                android:key="accept_cookies"
+                android:summary="@string/pref_security_accept_cookies_summary"
+                android:title="@string/pref_security_accept_cookies" />
+
+            <CheckBoxPreference
+                android:defaultValue="true"
+                android:key="save_formdata"
+                android:summary="@string/pref_security_save_form_data_summary"
+                android:title="@string/pref_security_save_form_data" />
+
+            <CheckBoxPreference
+                android:defaultValue="true"
+                android:key="enable_geolocation"
+                android:summary="@string/pref_privacy_enable_geolocation_summary"
+                android:title="@string/pref_privacy_enable_geolocation" />
+
+            <CheckBoxPreference
+                android:defaultValue="true"
+                android:key="remember_passwords"
+                android:summary="@string/pref_security_remember_passwords_summary"
+                android:title="@string/pref_security_remember_passwords" />
+
+        </PreferenceScreen>
+
+        <PreferenceScreen android:title="@string/pref_accessibility_title">
+
+            <PreferenceCategory android:title="@string/pref_font_size_category">
+                <com.android.browser.preferences.FontSizePreview android:title="@string/preview" />
+                <com.android.browser.preferences.SeekBarSummaryPreference
+                    android:defaultValue="10"
+                    android:key="text_zoom"
+                    android:max="30"
+                    android:title="@string/pref_text_zoom" />
+
+                <com.android.browser.preferences.SeekBarSummaryPreference
+                    android:defaultValue="0"
+                    android:key="min_font_size"
+                    android:max="20"
+                    android:title="@string/pref_min_font_size" />
+
+                <CheckBoxPreference
+                    android:defaultValue="false"
+                    android:key="force_userscalable"
+                    android:summary="@string/pref_force_userscalable_summary"
+                    android:title="@string/pref_force_userscalable" />
+
+                <ListPreference
+                    android:defaultValue="MEDIUM"
+                    android:dialogTitle="@string/pref_default_zoom_dialogtitle"
+                    android:entries="@array/pref_default_zoom_choices"
+                    android:entryValues="@array/pref_default_zoom_values"
+                    android:key="default_zoom"
+                    android:title="@string/pref_default_zoom" />
+
+            </PreferenceCategory>
+
+            <!-- // SWE_TODO: Commenting out inverted rendering settings
+            <PreferenceCategory android:title="@string/pref_inverted_category">
+
+                <com.android.browser.preferences.InvertedContrastPreview
+                    android:title="@string/preview" />
+
+                <CheckBoxPreference
+                    android:key="inverted"
+                    android:defaultValue="false"
+                    android:title="@string/pref_inverted"
+                    android:summary="@string/pref_inverted_summary" />
+
+                <com.android.browser.preferences.SeekBarSummaryPreference
+                    android:key="inverted_contrast"
+                    android:title="@string/pref_inverted_contrast"
+                    android:dependency="inverted"
+                    android:defaultValue="0"
+                    android:max="20" />
+            </PreferenceCategory>
+            -->
+
+        </PreferenceScreen>
+
+
+        <PreferenceScreen android:title="@string/pref_content_title">
+            <CheckBoxPreference
+                android:defaultValue="true"
+                android:key="block_popup_windows"
+                android:title="@string/pref_content_block_popups" />
+
+            <CheckBoxPreference
+                android:defaultValue="false"
+                android:key="open_in_background"
+                android:summary="@string/pref_content_open_in_background_summary"
+                android:title="@string/pref_content_open_in_background" />
+
+            <CheckBoxPreference
+                android:defaultValue="true"
+                android:key="enable_javascript"
+                android:title="@string/pref_content_javascript" />
+
+            <CheckBoxPreference
+                android:key="allow_media_downloads"
+                android:title="@string/pref_allow_media_downloads" />
+
+            <PreferenceScreen
+                android:key="download_path_setting_screen"
+                android:title="@string/pref_download_path_setting_screen_title"/>
+        </PreferenceScreen>
+
+
+        <PreferenceScreen
+            android:key="website_settings"
+            android:summary="@string/pref_extras_website_settings_summary"
+            android:title="@string/pref_extras_website_settings" />
+
+        <com.android.browser.BrowserYesNoPreference
+            android:key="reset_default_preferences"
+            android:title="@string/pref_extras_reset_default"
+            android:summary="@string/pref_extras_reset_default_summary"
+            android:dialogMessage="@string/pref_extras_reset_default_dlg"
+            android:dialogIcon="@android:drawable/ic_dialog_alert" />
+
+        <PreferenceScreen
+            android:key="debug_menu"
+            android:title="@string/pref_development_title" />
+    </PreferenceCategory>
 </PreferenceScreen>