Merge "Remove dead code."
diff --git a/res/drawable-hdpi/ic_bookmark_off_holo_dark.png b/res/drawable-hdpi/ic_bookmark_off_holo_dark.png
index 9ec0a44..fd5fdb9 100644
--- a/res/drawable-hdpi/ic_bookmark_off_holo_dark.png
+++ b/res/drawable-hdpi/ic_bookmark_off_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_bookmark_on_holo_dark.png b/res/drawable-hdpi/ic_bookmark_on_holo_dark.png
index 1d67f1a..4651918 100644
--- a/res/drawable-hdpi/ic_bookmark_on_holo_dark.png
+++ b/res/drawable-hdpi/ic_bookmark_on_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_bookmarks_holo_dark.png b/res/drawable-hdpi/ic_bookmarks_holo_dark.png
index d3070bf..76f54a1 100644
--- a/res/drawable-hdpi/ic_bookmarks_holo_dark.png
+++ b/res/drawable-hdpi/ic_bookmarks_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_close_window_holo_dark.png b/res/drawable-hdpi/ic_close_window_holo_dark.png
index d459352..6e852ec 100644
--- a/res/drawable-hdpi/ic_close_window_holo_dark.png
+++ b/res/drawable-hdpi/ic_close_window_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_incognito_holo_dark.png b/res/drawable-hdpi/ic_incognito_holo_dark.png
index f4997ae..9d6bc59 100644
--- a/res/drawable-hdpi/ic_incognito_holo_dark.png
+++ b/res/drawable-hdpi/ic_incognito_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_new_window_holo_dark.png b/res/drawable-hdpi/ic_new_window_holo_dark.png
index bc4017a..2849a16 100644
--- a/res/drawable-hdpi/ic_new_window_holo_dark.png
+++ b/res/drawable-hdpi/ic_new_window_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_refresh_holo_dark.png b/res/drawable-hdpi/ic_refresh_holo_dark.png
index 1da3ea8..f6c4f72 100644
--- a/res/drawable-hdpi/ic_refresh_holo_dark.png
+++ b/res/drawable-hdpi/ic_refresh_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_search_holo_dark.png b/res/drawable-hdpi/ic_search_holo_dark.png
index 688ef5d..8ed044a 100644
--- a/res/drawable-hdpi/ic_search_holo_dark.png
+++ b/res/drawable-hdpi/ic_search_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_stop_holo_dark.png b/res/drawable-hdpi/ic_stop_holo_dark.png
index e31dd22..b68c60f 100644
--- a/res/drawable-hdpi/ic_stop_holo_dark.png
+++ b/res/drawable-hdpi/ic_stop_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_web_holo_dark.png b/res/drawable-hdpi/ic_web_holo_dark.png
index d936c2c..1afe636 100644
--- a/res/drawable-hdpi/ic_web_holo_dark.png
+++ b/res/drawable-hdpi/ic_web_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_windows_holo_dark.png b/res/drawable-hdpi/ic_windows_holo_dark.png
index 98d5693..c79005c 100644
--- a/res/drawable-hdpi/ic_windows_holo_dark.png
+++ b/res/drawable-hdpi/ic_windows_holo_dark.png
Binary files differ
diff --git a/res/drawable-hdpi/nav_tab_bg.9.png b/res/drawable-hdpi/nav_tab_bg.9.png
new file mode 100644
index 0000000..203c358
--- /dev/null
+++ b/res/drawable-hdpi/nav_tab_bg.9.png
Binary files differ
diff --git a/res/drawable-mdpi/browsertab_add.png b/res/drawable-mdpi/browsertab_add.png
index f960c1d..3f20f2a 100644
--- a/res/drawable-mdpi/browsertab_add.png
+++ b/res/drawable-mdpi/browsertab_add.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_bookmark_off_holo_dark.png b/res/drawable-mdpi/ic_bookmark_off_holo_dark.png
index 7446bdf..a863fe6 100644
--- a/res/drawable-mdpi/ic_bookmark_off_holo_dark.png
+++ b/res/drawable-mdpi/ic_bookmark_off_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_bookmark_on_holo_dark.png b/res/drawable-mdpi/ic_bookmark_on_holo_dark.png
index 79a183f..5a6d469 100644
--- a/res/drawable-mdpi/ic_bookmark_on_holo_dark.png
+++ b/res/drawable-mdpi/ic_bookmark_on_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_bookmarks_holo_dark.png b/res/drawable-mdpi/ic_bookmarks_holo_dark.png
index ea45051..8cd9242 100644
--- a/res/drawable-mdpi/ic_bookmarks_holo_dark.png
+++ b/res/drawable-mdpi/ic_bookmarks_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_close_window_holo_dark.png b/res/drawable-mdpi/ic_close_window_holo_dark.png
index 9bb8e87..95d6f62 100644
--- a/res/drawable-mdpi/ic_close_window_holo_dark.png
+++ b/res/drawable-mdpi/ic_close_window_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_incognito_holo_dark.png b/res/drawable-mdpi/ic_incognito_holo_dark.png
index dfb380a..14747b6 100644
--- a/res/drawable-mdpi/ic_incognito_holo_dark.png
+++ b/res/drawable-mdpi/ic_incognito_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_new_window_holo_dark.png b/res/drawable-mdpi/ic_new_window_holo_dark.png
index b16aacc..5cdd4b5 100644
--- a/res/drawable-mdpi/ic_new_window_holo_dark.png
+++ b/res/drawable-mdpi/ic_new_window_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_refresh_holo_dark.png b/res/drawable-mdpi/ic_refresh_holo_dark.png
index 0aec8a0..bcb350f 100644
--- a/res/drawable-mdpi/ic_refresh_holo_dark.png
+++ b/res/drawable-mdpi/ic_refresh_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_search_holo_dark.png b/res/drawable-mdpi/ic_search_holo_dark.png
index a84edf3..b5eeb78 100644
--- a/res/drawable-mdpi/ic_search_holo_dark.png
+++ b/res/drawable-mdpi/ic_search_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_stop_holo_dark.png b/res/drawable-mdpi/ic_stop_holo_dark.png
index 61edb02..b230ab9 100644
--- a/res/drawable-mdpi/ic_stop_holo_dark.png
+++ b/res/drawable-mdpi/ic_stop_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_web_holo_dark.png b/res/drawable-mdpi/ic_web_holo_dark.png
index fcf6785..b394fbb 100644
--- a/res/drawable-mdpi/ic_web_holo_dark.png
+++ b/res/drawable-mdpi/ic_web_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_windows_holo_dark.png b/res/drawable-mdpi/ic_windows_holo_dark.png
index 7eabd08..37891ee 100644
--- a/res/drawable-mdpi/ic_windows_holo_dark.png
+++ b/res/drawable-mdpi/ic_windows_holo_dark.png
Binary files differ
diff --git a/res/drawable-mdpi/nav_tab_bg.9.png b/res/drawable-mdpi/nav_tab_bg.9.png
new file mode 100644
index 0000000..8c466d8
--- /dev/null
+++ b/res/drawable-mdpi/nav_tab_bg.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/app_web_browser_sm.png b/res/drawable-xhdpi/app_web_browser_sm.png
new file mode 100644
index 0000000..35d857b
--- /dev/null
+++ b/res/drawable-xhdpi/app_web_browser_sm.png
Binary files differ
diff --git a/res/drawable-xhdpi/bg_bookmarks_widget_holo.9.png b/res/drawable-xhdpi/bg_bookmarks_widget_holo.9.png
new file mode 100644
index 0000000..62b411e
--- /dev/null
+++ b/res/drawable-xhdpi/bg_bookmarks_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/bookmarks_widget_thumb_selector_focused.9.png b/res/drawable-xhdpi/bookmarks_widget_thumb_selector_focused.9.png
new file mode 100644
index 0000000..e95564f
--- /dev/null
+++ b/res/drawable-xhdpi/bookmarks_widget_thumb_selector_focused.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/bookmarks_widget_thumb_selector_longpressed.9.png b/res/drawable-xhdpi/bookmarks_widget_thumb_selector_longpressed.9.png
new file mode 100644
index 0000000..ed5a00b
--- /dev/null
+++ b/res/drawable-xhdpi/bookmarks_widget_thumb_selector_longpressed.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/bookmarks_widget_thumb_selector_pressed.9.png b/res/drawable-xhdpi/bookmarks_widget_thumb_selector_pressed.9.png
new file mode 100644
index 0000000..20941ec
--- /dev/null
+++ b/res/drawable-xhdpi/bookmarks_widget_thumb_selector_pressed.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/border_thumb_bookmarks_widget_holo.9.png b/res/drawable-xhdpi/border_thumb_bookmarks_widget_holo.9.png
new file mode 100644
index 0000000..40964eb
--- /dev/null
+++ b/res/drawable-xhdpi/border_thumb_bookmarks_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/browser_thumbnail.png b/res/drawable-xhdpi/browser_thumbnail.png
new file mode 100644
index 0000000..a2db941
--- /dev/null
+++ b/res/drawable-xhdpi/browser_thumbnail.png
Binary files differ
diff --git a/res/drawable-xhdpi/browser_widget_preview.png b/res/drawable-xhdpi/browser_widget_preview.png
new file mode 100644
index 0000000..2112b9e
--- /dev/null
+++ b/res/drawable-xhdpi/browser_widget_preview.png
Binary files differ
diff --git a/res/drawable-xhdpi/browsertab_add.png b/res/drawable-xhdpi/browsertab_add.png
new file mode 100644
index 0000000..e44f72b
--- /dev/null
+++ b/res/drawable-xhdpi/browsertab_add.png
Binary files differ
diff --git a/res/drawable-xhdpi/browsertab_add_focused.png b/res/drawable-xhdpi/browsertab_add_focused.png
new file mode 100644
index 0000000..7039974
--- /dev/null
+++ b/res/drawable-xhdpi/browsertab_add_focused.png
Binary files differ
diff --git a/res/drawable-xhdpi/browsertab_inactive.png b/res/drawable-xhdpi/browsertab_inactive.png
new file mode 100644
index 0000000..28eeed4
--- /dev/null
+++ b/res/drawable-xhdpi/browsertab_inactive.png
Binary files differ
diff --git a/res/drawable-xhdpi/default_video_poster.png b/res/drawable-xhdpi/default_video_poster.png
new file mode 100644
index 0000000..5eff15c
--- /dev/null
+++ b/res/drawable-xhdpi/default_video_poster.png
Binary files differ
diff --git a/res/drawable-xhdpi/geolocation_permissions_prompt_background.9.png b/res/drawable-xhdpi/geolocation_permissions_prompt_background.9.png
new file mode 100644
index 0000000..19a35a3
--- /dev/null
+++ b/res/drawable-xhdpi/geolocation_permissions_prompt_background.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_add_string.png b/res/drawable-xhdpi/ic_add_string.png
new file mode 100644
index 0000000..7ea150d
--- /dev/null
+++ b/res/drawable-xhdpi/ic_add_string.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_back_disabled_holo_dark.png b/res/drawable-xhdpi/ic_back_disabled_holo_dark.png
new file mode 100644
index 0000000..9f99c00
--- /dev/null
+++ b/res/drawable-xhdpi/ic_back_disabled_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_back_hierarchy_holo_dark.png b/res/drawable-xhdpi/ic_back_hierarchy_holo_dark.png
new file mode 100644
index 0000000..e459b98
--- /dev/null
+++ b/res/drawable-xhdpi/ic_back_hierarchy_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_back_holo_dark.png b/res/drawable-xhdpi/ic_back_holo_dark.png
new file mode 100644
index 0000000..f79f20a
--- /dev/null
+++ b/res/drawable-xhdpi/ic_back_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_bookmark_off_holo_dark.png b/res/drawable-xhdpi/ic_bookmark_off_holo_dark.png
new file mode 100644
index 0000000..05e9ec8
--- /dev/null
+++ b/res/drawable-xhdpi/ic_bookmark_off_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_bookmark_on_holo_dark.png b/res/drawable-xhdpi/ic_bookmark_on_holo_dark.png
new file mode 100644
index 0000000..764adb3
--- /dev/null
+++ b/res/drawable-xhdpi/ic_bookmark_on_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_bookmark_widget_bookmark_holo_dark.png b/res/drawable-xhdpi/ic_bookmark_widget_bookmark_holo_dark.png
new file mode 100644
index 0000000..8025248
--- /dev/null
+++ b/res/drawable-xhdpi/ic_bookmark_widget_bookmark_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_bookmarks_history_holo_dark.png b/res/drawable-xhdpi/ic_bookmarks_history_holo_dark.png
new file mode 100644
index 0000000..702379b
--- /dev/null
+++ b/res/drawable-xhdpi/ic_bookmarks_history_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_bookmarks_holo_dark.png b/res/drawable-xhdpi/ic_bookmarks_holo_dark.png
new file mode 100644
index 0000000..68b0a61
--- /dev/null
+++ b/res/drawable-xhdpi/ic_bookmarks_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_close_window_holo_dark.png b/res/drawable-xhdpi/ic_close_window_holo_dark.png
new file mode 100644
index 0000000..dc17740
--- /dev/null
+++ b/res/drawable-xhdpi/ic_close_window_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_dialog_browser_certificate_partially_secure.png b/res/drawable-xhdpi/ic_dialog_browser_certificate_partially_secure.png
new file mode 100644
index 0000000..37c0b91
--- /dev/null
+++ b/res/drawable-xhdpi/ic_dialog_browser_certificate_partially_secure.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_dialog_browser_certificate_secure.png b/res/drawable-xhdpi/ic_dialog_browser_certificate_secure.png
new file mode 100644
index 0000000..036eba6
--- /dev/null
+++ b/res/drawable-xhdpi/ic_dialog_browser_certificate_secure.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_dialog_browser_security_bad.png b/res/drawable-xhdpi/ic_dialog_browser_security_bad.png
new file mode 100644
index 0000000..1e3068b
--- /dev/null
+++ b/res/drawable-xhdpi/ic_dialog_browser_security_bad.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_dialog_browser_security_good.png b/res/drawable-xhdpi/ic_dialog_browser_security_good.png
new file mode 100644
index 0000000..e8badf6
--- /dev/null
+++ b/res/drawable-xhdpi/ic_dialog_browser_security_good.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_downloads_holo_dark.png b/res/drawable-xhdpi/ic_downloads_holo_dark.png
new file mode 100644
index 0000000..0681bd2
--- /dev/null
+++ b/res/drawable-xhdpi/ic_downloads_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_folder_holo_dark.png b/res/drawable-xhdpi/ic_folder_holo_dark.png
new file mode 100644
index 0000000..6bdb7d0
--- /dev/null
+++ b/res/drawable-xhdpi/ic_folder_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_forward_disabled_holo_dark.png b/res/drawable-xhdpi/ic_forward_disabled_holo_dark.png
new file mode 100644
index 0000000..bbe6571
--- /dev/null
+++ b/res/drawable-xhdpi/ic_forward_disabled_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_forward_holo_dark.png b/res/drawable-xhdpi/ic_forward_holo_dark.png
new file mode 100644
index 0000000..c0e8371
--- /dev/null
+++ b/res/drawable-xhdpi/ic_forward_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_go_holo_dark.png b/res/drawable-xhdpi/ic_go_holo_dark.png
new file mode 100644
index 0000000..e4b59b3
--- /dev/null
+++ b/res/drawable-xhdpi/ic_go_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_gps_denied_holo_dark.png b/res/drawable-xhdpi/ic_gps_denied_holo_dark.png
new file mode 100644
index 0000000..a695cda
--- /dev/null
+++ b/res/drawable-xhdpi/ic_gps_denied_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_gps_on_holo_dark.png b/res/drawable-xhdpi/ic_gps_on_holo_dark.png
new file mode 100644
index 0000000..38c1892
--- /dev/null
+++ b/res/drawable-xhdpi/ic_gps_on_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_home_holo_dark.png b/res/drawable-xhdpi/ic_home_holo_dark.png
new file mode 100644
index 0000000..177abe9
--- /dev/null
+++ b/res/drawable-xhdpi/ic_home_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_home_info_holo_dark.png b/res/drawable-xhdpi/ic_home_info_holo_dark.png
new file mode 100644
index 0000000..6f43ba5
--- /dev/null
+++ b/res/drawable-xhdpi/ic_home_info_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_incognito_holo_dark.png b/res/drawable-xhdpi/ic_incognito_holo_dark.png
new file mode 100644
index 0000000..50009e9
--- /dev/null
+++ b/res/drawable-xhdpi/ic_incognito_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_launcher_shortcut_browser_bookmark.png b/res/drawable-xhdpi/ic_launcher_shortcut_browser_bookmark.png
new file mode 100644
index 0000000..0711f92
--- /dev/null
+++ b/res/drawable-xhdpi/ic_launcher_shortcut_browser_bookmark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_list_data_large.png b/res/drawable-xhdpi/ic_list_data_large.png
new file mode 100644
index 0000000..4047c4d
--- /dev/null
+++ b/res/drawable-xhdpi/ic_list_data_large.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_list_data_off.png b/res/drawable-xhdpi/ic_list_data_off.png
new file mode 100644
index 0000000..b508b6b
--- /dev/null
+++ b/res/drawable-xhdpi/ic_list_data_off.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_list_data_small.png b/res/drawable-xhdpi/ic_list_data_small.png
new file mode 100644
index 0000000..680e69c
--- /dev/null
+++ b/res/drawable-xhdpi/ic_list_data_small.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_list_view_holo_dark.png b/res/drawable-xhdpi/ic_list_view_holo_dark.png
new file mode 100644
index 0000000..30270da
--- /dev/null
+++ b/res/drawable-xhdpi/ic_list_view_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_findonpage_normal.png b/res/drawable-xhdpi/ic_menu_findonpage_normal.png
new file mode 100644
index 0000000..287b029
--- /dev/null
+++ b/res/drawable-xhdpi/ic_menu_findonpage_normal.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_new_window.png b/res/drawable-xhdpi/ic_menu_new_window.png
new file mode 100644
index 0000000..6caa148
--- /dev/null
+++ b/res/drawable-xhdpi/ic_menu_new_window.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_new_incognito_holo_dark.png b/res/drawable-xhdpi/ic_new_incognito_holo_dark.png
new file mode 100644
index 0000000..2f21240
--- /dev/null
+++ b/res/drawable-xhdpi/ic_new_incognito_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_new_window_holo_dark.png b/res/drawable-xhdpi/ic_new_window_holo_dark.png
new file mode 100644
index 0000000..4f2e240
--- /dev/null
+++ b/res/drawable-xhdpi/ic_new_window_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_pageinfo_holo_dark.png b/res/drawable-xhdpi/ic_pageinfo_holo_dark.png
new file mode 100644
index 0000000..23e948a
--- /dev/null
+++ b/res/drawable-xhdpi/ic_pageinfo_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_partial_secure.png b/res/drawable-xhdpi/ic_partial_secure.png
new file mode 100644
index 0000000..82ff296
--- /dev/null
+++ b/res/drawable-xhdpi/ic_partial_secure.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_querybuilder_disabled.png b/res/drawable-xhdpi/ic_querybuilder_disabled.png
new file mode 100644
index 0000000..79fb478
--- /dev/null
+++ b/res/drawable-xhdpi/ic_querybuilder_disabled.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_querybuilder_normal.png b/res/drawable-xhdpi/ic_querybuilder_normal.png
new file mode 100644
index 0000000..cc3ce59
--- /dev/null
+++ b/res/drawable-xhdpi/ic_querybuilder_normal.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_querybuilder_pressed.png b/res/drawable-xhdpi/ic_querybuilder_pressed.png
new file mode 100644
index 0000000..0693fa3
--- /dev/null
+++ b/res/drawable-xhdpi/ic_querybuilder_pressed.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_refresh_holo_dark.png b/res/drawable-xhdpi/ic_refresh_holo_dark.png
new file mode 100644
index 0000000..716dd53
--- /dev/null
+++ b/res/drawable-xhdpi/ic_refresh_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_search_category_bookmark.png b/res/drawable-xhdpi/ic_search_category_bookmark.png
new file mode 100644
index 0000000..8b5ffa1
--- /dev/null
+++ b/res/drawable-xhdpi/ic_search_category_bookmark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_search_category_browser.png b/res/drawable-xhdpi/ic_search_category_browser.png
new file mode 100644
index 0000000..8b195c1
--- /dev/null
+++ b/res/drawable-xhdpi/ic_search_category_browser.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_search_category_history.png b/res/drawable-xhdpi/ic_search_category_history.png
new file mode 100644
index 0000000..8a0e828
--- /dev/null
+++ b/res/drawable-xhdpi/ic_search_category_history.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_search_category_suggest.png b/res/drawable-xhdpi/ic_search_category_suggest.png
new file mode 100644
index 0000000..985a201
--- /dev/null
+++ b/res/drawable-xhdpi/ic_search_category_suggest.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_search_holo_dark.png b/res/drawable-xhdpi/ic_search_holo_dark.png
new file mode 100644
index 0000000..e94096f
--- /dev/null
+++ b/res/drawable-xhdpi/ic_search_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_secure_holo_dark.png b/res/drawable-xhdpi/ic_secure_holo_dark.png
new file mode 100644
index 0000000..0842acc
--- /dev/null
+++ b/res/drawable-xhdpi/ic_secure_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_holo_dark.png b/res/drawable-xhdpi/ic_settings_holo_dark.png
new file mode 100644
index 0000000..0541407
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_share_holo_dark.png b/res/drawable-xhdpi/ic_share_holo_dark.png
new file mode 100644
index 0000000..5c3047a
--- /dev/null
+++ b/res/drawable-xhdpi/ic_share_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_stop_holo_dark.png b/res/drawable-xhdpi/ic_stop_holo_dark.png
new file mode 100644
index 0000000..11cd91f
--- /dev/null
+++ b/res/drawable-xhdpi/ic_stop_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_tab_close.png b/res/drawable-xhdpi/ic_tab_close.png
new file mode 100644
index 0000000..fa63021
--- /dev/null
+++ b/res/drawable-xhdpi/ic_tab_close.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_thumbnail_view_holo_dark.png b/res/drawable-xhdpi/ic_thumbnail_view_holo_dark.png
new file mode 100644
index 0000000..d03787b
--- /dev/null
+++ b/res/drawable-xhdpi/ic_thumbnail_view_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_voice_search_holo_dark.png b/res/drawable-xhdpi/ic_voice_search_holo_dark.png
new file mode 100644
index 0000000..bfeb7aa
--- /dev/null
+++ b/res/drawable-xhdpi/ic_voice_search_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_web_holo_dark.png b/res/drawable-xhdpi/ic_web_holo_dark.png
new file mode 100644
index 0000000..7271169
--- /dev/null
+++ b/res/drawable-xhdpi/ic_web_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_windows_holo_dark.png b/res/drawable-xhdpi/ic_windows_holo_dark.png
new file mode 100644
index 0000000..f57eb68
--- /dev/null
+++ b/res/drawable-xhdpi/ic_windows_holo_dark.png
Binary files differ
diff --git a/res/drawable-xhdpi/magnifying_glass.png b/res/drawable-xhdpi/magnifying_glass.png
new file mode 100644
index 0000000..62742b7
--- /dev/null
+++ b/res/drawable-xhdpi/magnifying_glass.png
Binary files differ
diff --git a/res/drawable-xhdpi/nav_tab_bg.9.png b/res/drawable-xhdpi/nav_tab_bg.9.png
new file mode 100644
index 0000000..816bbe7
--- /dev/null
+++ b/res/drawable-xhdpi/nav_tab_bg.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/overlay_url_bookmark_widget_holo.9.png b/res/drawable-xhdpi/overlay_url_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..829ea7f
--- /dev/null
+++ b/res/drawable-xhdpi/overlay_url_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/progress.9.png b/res/drawable-xhdpi/progress.9.png
new file mode 100644
index 0000000..72a71cb
--- /dev/null
+++ b/res/drawable-xhdpi/progress.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/qc_background_normal.png b/res/drawable-xhdpi/qc_background_normal.png
new file mode 100644
index 0000000..bea09ca
--- /dev/null
+++ b/res/drawable-xhdpi/qc_background_normal.png
Binary files differ
diff --git a/res/drawable-xhdpi/row_activated_bookmark_widget_holo.9.png b/res/drawable-xhdpi/row_activated_bookmark_widget_holo.9.png
new file mode 100644
index 0000000..c4b1ab3
--- /dev/null
+++ b/res/drawable-xhdpi/row_activated_bookmark_widget_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/tab_nr.png b/res/drawable-xhdpi/tab_nr.png
new file mode 100644
index 0000000..abc2937
--- /dev/null
+++ b/res/drawable-xhdpi/tab_nr.png
Binary files differ
diff --git a/res/drawable-xhdpi/textfield_active_holo_dark.9.png b/res/drawable-xhdpi/textfield_active_holo_dark.9.png
new file mode 100644
index 0000000..b0c52d5
--- /dev/null
+++ b/res/drawable-xhdpi/textfield_active_holo_dark.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/textfield_default_holo_dark.9.png b/res/drawable-xhdpi/textfield_default_holo_dark.9.png
new file mode 100644
index 0000000..c08ed41
--- /dev/null
+++ b/res/drawable-xhdpi/textfield_default_holo_dark.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/thumb_bookmark_widget_folder_back_holo.png b/res/drawable-xhdpi/thumb_bookmark_widget_folder_back_holo.png
new file mode 100644
index 0000000..6216ef1
--- /dev/null
+++ b/res/drawable-xhdpi/thumb_bookmark_widget_folder_back_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/thumb_bookmark_widget_folder_holo.png b/res/drawable-xhdpi/thumb_bookmark_widget_folder_holo.png
new file mode 100644
index 0000000..7e56f0f
--- /dev/null
+++ b/res/drawable-xhdpi/thumb_bookmark_widget_folder_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/thumbnail_bookmarks_widget_no_bookmark_holo.png b/res/drawable-xhdpi/thumbnail_bookmarks_widget_no_bookmark_holo.png
new file mode 100644
index 0000000..7d24d4a
--- /dev/null
+++ b/res/drawable-xhdpi/thumbnail_bookmarks_widget_no_bookmark_holo.png
Binary files differ
diff --git a/res/drawable-xhdpi/trashcan.png b/res/drawable-xhdpi/trashcan.png
new file mode 100644
index 0000000..8b9982c
--- /dev/null
+++ b/res/drawable-xhdpi/trashcan.png
Binary files differ
diff --git a/res/drawable/nav_tab_bg.9.png b/res/drawable/nav_tab_bg.9.png
deleted file mode 100644
index 9e0a23d..0000000
--- a/res/drawable/nav_tab_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/res/mipmap-hdpi/ic_launcher_browser.png b/res/mipmap-hdpi/ic_launcher_browser.png
index 1f3e584..ef42d38 100644
--- a/res/mipmap-hdpi/ic_launcher_browser.png
+++ b/res/mipmap-hdpi/ic_launcher_browser.png
Binary files differ
diff --git a/res/mipmap-mdpi/ic_launcher_browser.png b/res/mipmap-mdpi/ic_launcher_browser.png
index 93c83d4..588d9af 100644
--- a/res/mipmap-mdpi/ic_launcher_browser.png
+++ b/res/mipmap-mdpi/ic_launcher_browser.png
Binary files differ
diff --git a/res/mipmap-xhdpi/ic_launcher_browser.png b/res/mipmap-xhdpi/ic_launcher_browser.png
new file mode 100644
index 0000000..19e045b
--- /dev/null
+++ b/res/mipmap-xhdpi/ic_launcher_browser.png
Binary files differ
diff --git a/res/mipmap-xhdpi/ic_launcher_shortcut_browser_bookmark.png b/res/mipmap-xhdpi/ic_launcher_shortcut_browser_bookmark.png
new file mode 100644
index 0000000..3ef819f
--- /dev/null
+++ b/res/mipmap-xhdpi/ic_launcher_shortcut_browser_bookmark.png
Binary files differ
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java
index 32db550..45b1f8b 100644
--- a/src/com/android/browser/AddBookmarkPage.java
+++ b/src/com/android/browser/AddBookmarkPage.java
@@ -759,7 +759,7 @@
             try {
                 final ContentResolver cr = getContentResolver();
                 Bookmarks.addBookmark(AddBookmarkPage.this, false, url,
-                        title, thumbnail, true, mCurrentFolder);
+                        title, thumbnail, mCurrentFolder);
                 if (touchIconUrl != null) {
                     new DownloadTouchIcon(mContext, cr, url).execute(mTouchIconUrl);
                 }
diff --git a/src/com/android/browser/BackgroundHandler.java b/src/com/android/browser/BackgroundHandler.java
new file mode 100644
index 0000000..a0d9243
--- /dev/null
+++ b/src/com/android/browser/BackgroundHandler.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2011 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;
+
+import android.os.HandlerThread;
+import android.os.Looper;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+public class BackgroundHandler {
+
+    static HandlerThread sLooperThread;
+    static ExecutorService mThreadPool;
+
+    static {
+        sLooperThread = new HandlerThread("BackgroundHandler", HandlerThread.MIN_PRIORITY);
+        sLooperThread.start();
+        mThreadPool = Executors.newCachedThreadPool();
+    }
+
+    public static void execute(Runnable runnable) {
+        mThreadPool.execute(runnable);
+    }
+
+    public static Looper getLooper() {
+        return sLooperThread.getLooper();
+    }
+
+    private BackgroundHandler() {}
+}
diff --git a/src/com/android/browser/Bookmarks.java b/src/com/android/browser/Bookmarks.java
index bd3b872..190ff9d 100644
--- a/src/com/android/browser/Bookmarks.java
+++ b/src/com/android/browser/Bookmarks.java
@@ -67,7 +67,7 @@
      *  @param parent ID of the parent folder.
      */
     /* package */ static void addBookmark(Context context, boolean showToast, String url,
-            String name, Bitmap thumbnail, boolean retainIcon, long parent) {
+            String name, Bitmap thumbnail, long parent) {
         // Want to append to the beginning of the list
         ContentValues values = new ContentValues();
         try {
@@ -82,9 +82,6 @@
         } catch (IllegalStateException e) {
             Log.e(LOGTAG, "addBookmark", e);
         }
-        if (retainIcon) {
-            WebIconDatabase.getInstance().retainIconForPageUrl(url);
-        }
         if (showToast) {
             Toast.makeText(context, R.string.added_to_bookmarks,
                     Toast.LENGTH_LONG).show();
diff --git a/src/com/android/browser/Browser.java b/src/com/android/browser/Browser.java
index c4412e2..76aaa0b 100644
--- a/src/com/android/browser/Browser.java
+++ b/src/com/android/browser/Browser.java
@@ -17,13 +17,9 @@
 package com.android.browser;
 
 import android.app.Application;
-import android.content.Intent;
-import android.os.AsyncTask;
 import android.util.Log;
 import android.webkit.CookieSyncManager;
 
-import dalvik.system.VMRuntime;
-
 public class Browser extends Application { 
 
     private final static String LOGTAG = "browser";
@@ -37,15 +33,6 @@
     // Set to true to enable extra debug logging.
     final static boolean LOGD_ENABLED = true;
 
-    /**
-     * Specifies a heap utilization ratio that works better
-     * for the browser than the default ratio does.
-     */
-    private final static float TARGET_HEAP_UTILIZATION = 0.75f;
-
-    public Browser() {
-    }
-
     @Override
     public void onCreate() {
         super.onCreate();
@@ -53,20 +40,11 @@
         if (LOGV_ENABLED)
             Log.v(LOGTAG, "Browser.onCreate: this=" + this);
 
-        // Fix AsyncTask to use multiple threads
-        AsyncTask.setDefaultExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
-        // Fix heap utilization for better heap size characteristics.
-        VMRuntime.getRuntime().setTargetHeapUtilization(
-                TARGET_HEAP_UTILIZATION);
         // create CookieSyncManager with current Context
         CookieSyncManager.createInstance(this);
         BrowserSettings.initialize(getApplicationContext());
         Preloader.initialize(getApplicationContext());
     }
 
-    static Intent createBrowserViewIntent() {
-        Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
-        return intent;
-    }
 }
 
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index b2a83e1..0df2e94 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -57,6 +57,13 @@
         }
         super.onCreate(icicle);
 
+        // If this was a web search request, pass it on to the default web
+        // search provider and finish this activity.
+        if (IntentHandler.handleWebSearchIntent(this, null, getIntent())) {
+            finish();
+            return;
+        }
+
         BrowserSettings settings = BrowserSettings.getInstance();
 
         // render the browser in OpenGL
@@ -69,20 +76,13 @@
             this.getWindow().setFlags(0, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
         }
 
-        // If this was a web search request, pass it on to the default web
-        // search provider and finish this activity.
-        if (IntentHandler.handleWebSearchIntent(this, null, getIntent())) {
-            finish();
-            return;
-        }
-
         AccessibilityManager accessibilityManager = (AccessibilityManager)
                 getSystemService(ACCESSIBILITY_SERVICE);
         if (accessibilityManager != null && accessibilityManager.isEnabled()) {
             setDefaultKeyMode(DEFAULT_KEYS_DISABLE);
         }
 
-        mController = new Controller(this);
+        mController = new Controller(this, icicle == null);
         boolean xlarge = isTablet(this);
         if (xlarge) {
             mUi = new XLargeUi(this, mController);
diff --git a/src/com/android/browser/BrowserHistoryPage.java b/src/com/android/browser/BrowserHistoryPage.java
index 5d106ce..942a8fd 100644
--- a/src/com/android/browser/BrowserHistoryPage.java
+++ b/src/com/android/browser/BrowserHistoryPage.java
@@ -33,7 +33,6 @@
 import android.content.pm.ResolveInfo;
 import android.database.Cursor;
 import android.database.DataSetObserver;
-import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
@@ -50,7 +49,6 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewStub;
-import android.webkit.WebIconDatabase.IconListener;
 import android.widget.AbsListView;
 import android.widget.AdapterView;
 import android.widget.AdapterView.AdapterContextMenuInfo;
@@ -86,16 +84,6 @@
     private FragmentBreadCrumbs mFragmentBreadCrumbs;
     private ExpandableListView mHistoryList;
 
-    // Implementation of WebIconDatabase.IconListener
-    class IconReceiver implements IconListener {
-        @Override
-        public void onReceivedIcon(String url, Bitmap icon) {
-            mAdapter.notifyDataSetChanged();
-        }
-    }
-
-    // Instance of IconReceiver
-    final IconReceiver mIconReceiver = new IconReceiver();
     private View mRoot;
 
     static interface HistoryQuery {
@@ -238,8 +226,6 @@
         getLoaderManager().restartLoader(LOADER_HISTORY, null, this);
         getLoaderManager().restartLoader(LOADER_MOST_VISITED, null, this);
 
-        // Register to receive icons in case they haven't all been loaded.
-        CombinedBookmarkHistoryView.getIconListenerSet().addListener(mIconReceiver);
         return mRoot;
     }
 
@@ -300,7 +286,6 @@
     @Override
     public void onDestroy() {
         super.onDestroy();
-        CombinedBookmarkHistoryView.getIconListenerSet().removeListener(mIconReceiver);
         getLoaderManager().destroyLoader(LOADER_HISTORY);
         getLoaderManager().destroyLoader(LOADER_MOST_VISITED);
     }
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index 97769fc..8461d30 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -102,7 +102,7 @@
     private WebStorageSizeManager mWebStorageSizeManager;
     private AutofillHandler mAutofillHandler;
     private WeakHashMap<WebSettings, String> mCustomUserAgents;
-    private boolean mInitialized = false;
+    private static boolean sInitialized = false;
 
     // Cached values
     private int mPageCacheCapacity = 1;
@@ -111,6 +111,8 @@
     // Cached settings
     private SearchEngine mSearchEngine;
 
+    private static String sFactoryResetUrl;
+
     public static void initialize(final Context context) {
         sInstance = new BrowserSettings(context);
     }
@@ -127,7 +129,7 @@
         mCustomUserAgents = new WeakHashMap<WebSettings, String>();
         mPrefs.registerOnSharedPreferenceChangeListener(this);
         mAutofillHandler.asyncLoadFromDb();
-        new Thread(mInitialization, "BrowserSettingsInitialization").start();
+        BackgroundHandler.execute(mSetup);
     }
 
     public void setController(Controller controller) {
@@ -147,7 +149,7 @@
         }
     }
 
-    private Runnable mInitialization = new Runnable() {
+    private Runnable mSetup = new Runnable() {
 
         @Override
         public void run() {
@@ -189,18 +191,25 @@
                 }
                 mPrefs.edit().remove(PREF_TEXT_SIZE).apply();
             }
-            synchronized (BrowserSettings.this) {
-                mInitialized = true;
-                BrowserSettings.this.notifyAll();
+
+            sFactoryResetUrl = mContext.getResources().getString(R.string.homepage_base);
+            if (sFactoryResetUrl.indexOf("{CID}") != -1) {
+                sFactoryResetUrl = sFactoryResetUrl.replace("{CID}",
+                    BrowserProvider.getClientId(mContext.getContentResolver()));
+            }
+
+            synchronized (BrowserSettings.class) {
+                sInitialized = true;
+                BrowserSettings.class.notifyAll();
             }
         }
     };
 
-    void requireInitialization() {
-        synchronized (BrowserSettings.this) {
-            while (!mInitialized) {
+    private static void requireInitialization() {
+        synchronized (BrowserSettings.class) {
+            while (!sInitialized) {
                 try {
-                    BrowserSettings.this.wait();
+                    BrowserSettings.class.wait();
                 } catch (InterruptedException e) {
                 }
             }
@@ -321,12 +330,8 @@
     }
 
     public static String getFactoryResetHomeUrl(Context context) {
-        String url = context.getResources().getString(R.string.homepage_base);
-        if (url.indexOf("{CID}") != -1) {
-            url = url.replace("{CID}",
-                    BrowserProvider.getClientId(context.getContentResolver()));
-        }
-        return url;
+        requireInitialization();
+        return sFactoryResetUrl;
     }
 
     public LayoutAlgorithm getLayoutAlgorithm() {
@@ -507,6 +512,10 @@
         return (percent - 100) / TEXT_ZOOM_STEP + TEXT_ZOOM_START_VAL;
     }
 
+    public SharedPreferences getPreferences() {
+        return mPrefs;
+    }
+
     // -----------------------------
     // getter/setters for accessibility_preferences.xml
     // -----------------------------
diff --git a/src/com/android/browser/CombinedBookmarkHistoryView.java b/src/com/android/browser/CombinedBookmarkHistoryView.java
index 191368f..7903709 100644
--- a/src/com/android/browser/CombinedBookmarkHistoryView.java
+++ b/src/com/android/browser/CombinedBookmarkHistoryView.java
@@ -26,16 +26,13 @@
 import android.content.res.Configuration;
 import android.database.Cursor;
 import android.graphics.Bitmap;
-import android.os.AsyncTask;
 import android.os.Bundle;
-import android.provider.Browser;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.View.OnTouchListener;
 import android.view.ViewGroup;
-import android.webkit.WebIconDatabase;
 import android.webkit.WebIconDatabase.IconListener;
 import android.widget.FrameLayout;
 import android.widget.LinearLayout;
@@ -137,21 +134,6 @@
         // Start up the default fragment
         initFragments(mExtras);
 
-        // XXX: Must do this before launching the AsyncTask to avoid a
-        // potential crash if the icon database has not been created.
-        WebIconDatabase.getInstance();
-
-        // Do this every time the view is created in case a new favicon was
-        // added to the webkit db.
-        (new AsyncTask<Void, Void, Void>() {
-            @Override
-            public Void doInBackground(Void... v) {
-                Browser.requestAllIcons(mActivity.getContentResolver(),
-                        Browser.BookmarkColumns.FAVICON + " is NULL", getIconListenerSet());
-                return null;
-            }
-        }).execute();
-
         setupActionBar(startingView);
     }
 
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 03e2d8b..92682c1 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -206,7 +206,6 @@
     // Checks to see when the bookmarks database has changed, and updates the
     // Tabs' notion of whether they represent bookmarked sites.
     private ContentObserver mBookmarksObserver;
-    private DataController mDataController;
     private CrashRecoveryHandler mCrashRecoveryHandler;
 
     private boolean mSimulateActionBarOverlayMode;
@@ -225,13 +224,15 @@
         }
     }
 
-    public Controller(Activity browser) {
+    public Controller(Activity browser, boolean preloadCrashState) {
         mActivity = browser;
         mSettings = BrowserSettings.getInstance();
-        mDataController = DataController.getInstance(mActivity);
         mTabControl = new TabControl(this);
         mSettings.setController(this);
         mCrashRecoveryHandler = CrashRecoveryHandler.initialize(this);
+        if (preloadCrashState) {
+            mCrashRecoveryHandler.preloadCrashState();
+        }
         mFactory = new BrowserWebViewFactory(browser);
 
         mUrlHandler = new UrlHandler(this);
@@ -239,10 +240,6 @@
         mPageDialogsHandler = new PageDialogsHandler(mActivity, this);
         mNfcHandler = new NfcHandler(mActivity, this);
 
-        PowerManager pm = (PowerManager) mActivity
-                .getSystemService(Context.POWER_SERVICE);
-        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Browser");
-
         startHandler();
         mBookmarksObserver = new ContentObserver(mHandler) {
             @Override
@@ -263,7 +260,7 @@
                 new SystemAllowGeolocationOrigins(mActivity.getApplicationContext());
         mSystemAllowGeolocationOrigins.start();
 
-        retainIconsOnStartup();
+        openIconDatabase();
         mSimulateActionBarOverlayMode = !BrowserActivity.isTablet(mActivity);
     }
 
@@ -421,43 +418,17 @@
         return mTabControl.getTabs();
     }
 
-    // Open the icon database and retain all the icons for visited sites.
-    // This is done on a background thread so as not to stall startup.
-    private void retainIconsOnStartup() {
-        // WebIconDatabase needs to be retrieved on the UI thread so that if
-        // it has not been created successfully yet the Handler is started on the
-        // UI thread.
-        new RetainIconsOnStartupTask(WebIconDatabase.getInstance()).execute();
-    }
+    // Open the icon database.
+    private void openIconDatabase() {
+        // We have to call getInstance on the UI thread
+        final WebIconDatabase instance = WebIconDatabase.getInstance();
+        BackgroundHandler.execute(new Runnable() {
 
-    private class RetainIconsOnStartupTask extends AsyncTask<Void, Void, Void> {
-        private WebIconDatabase mDb;
-
-        public RetainIconsOnStartupTask(WebIconDatabase db) {
-            mDb = db;
-        }
-
-        @Override
-        protected Void doInBackground(Void... unused) {
-            mDb.open(mActivity.getDir("icons", 0).getPath());
-            Cursor c = null;
-            try {
-                c = Browser.getAllBookmarks(mActivity.getContentResolver());
-                if (c.moveToFirst()) {
-                    int urlIndex = c.getColumnIndex(Browser.BookmarkColumns.URL);
-                    do {
-                        String url = c.getString(urlIndex);
-                        mDb.retainIconForPageUrl(url);
-                    } while (c.moveToNext());
-                }
-            } catch (IllegalStateException e) {
-                Log.e(LOGTAG, "retainIconsOnStartup", e);
-            } finally {
-                if (c != null) c.close();
+            @Override
+            public void run() {
+                instance.open(mActivity.getDir("icons", 0).getPath());
             }
-
-            return null;
-        }
+        });
     }
 
     private void startHandler() {
@@ -518,7 +489,7 @@
                         break;
 
                     case RELEASE_WAKELOCK:
-                        if (mWakeLock.isHeld()) {
+                        if (mWakeLock != null && mWakeLock.isHeld()) {
                             mWakeLock.release();
                             // if we reach here, Browser should be still in the
                             // background loading after WAKELOCK_TIMEOUT (5-min).
@@ -622,6 +593,11 @@
         if (tab != null) {
             tab.pause();
             if (!pauseWebViewTimers(tab)) {
+                if (mWakeLock == null) {
+                    PowerManager pm = (PowerManager) mActivity
+                            .getSystemService(Context.POWER_SERVICE);
+                    mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Browser");
+                }
                 mWakeLock.acquire();
                 mHandler.sendMessageDelayed(mHandler
                         .obtainMessage(RELEASE_WAKELOCK), WAKELOCK_TIMEOUT);
@@ -644,7 +620,7 @@
         // focused view XXX has no id".
 
         // Save all the tabs
-        mTabControl.saveState(outState, saveImages);
+        mTabControl.saveState(outState, false);
         if (!outState.isEmpty()) {
             // Save time so that we know how old incognito tabs (if any) are.
             outState.putSerializable("lastActiveDate", Calendar.getInstance());
@@ -662,10 +638,7 @@
             current.resume();
             resumeWebViewTimers(current);
         }
-        if (mWakeLock.isHeld()) {
-            mHandler.removeMessages(RELEASE_WAKELOCK);
-            mWakeLock.release();
-        }
+        releaseWakeLock();
 
         mUi.onResume();
         mNetworkHandler.onResume();
@@ -673,6 +646,13 @@
         WebView.enablePlatformNotifications();
     }
 
+    private void releaseWakeLock() {
+        if (mWakeLock != null && mWakeLock.isHeld()) {
+            mHandler.removeMessages(RELEASE_WAKELOCK);
+            mWakeLock.release();
+        }
+    }
+
     /**
      * resume all WebView timers using the WebView instance of the given tab
      * @param tab guaranteed non-null
@@ -832,10 +812,7 @@
         // pause the WebView timer and release the wake lock if it is finished
         // while BrowserActivity is in pause state.
         if (mActivityPaused && pauseWebViewTimers(tab)) {
-            if (mWakeLock.isHeld()) {
-                mHandler.removeMessages(RELEASE_WAKELOCK);
-                mWakeLock.release();
-            }
+            releaseWakeLock();
         }
 
         // Performance probe
@@ -890,7 +867,7 @@
         }
         // Update the title in the history database if not in private browsing mode
         if (!tab.isPrivateBrowsingEnabled()) {
-            mDataController.updateHistoryTitle(pageUrl, title);
+            DataController.getInstance(mActivity).updateHistoryTitle(pageUrl, title);
         }
     }
 
@@ -937,8 +914,7 @@
                 || url.regionMatches(true, 0, "about:", 0, 6)) {
             return;
         }
-        mDataController.updateVisitedHistory(url);
-        WebIconDatabase.getInstance().retainIconForPageUrl(url);
+        DataController.getInstance(mActivity).updateVisitedHistory(url);
         if (!mActivityPaused) {
             // Since we clear the state in onPause, don't backup the current
             // state if we are already paused
@@ -2298,7 +2274,7 @@
     @Override
     public void closeCurrentTab() {
         if (mTabControl.getTabCount() == 1) {
-            CrashRecoveryHandler.clearState(mActivity);
+            mCrashRecoveryHandler.clearState();
             mActivity.finish();
             return;
         }
diff --git a/src/com/android/browser/CrashRecoveryHandler.java b/src/com/android/browser/CrashRecoveryHandler.java
index 8d7f243..02636c0 100644
--- a/src/com/android/browser/CrashRecoveryHandler.java
+++ b/src/com/android/browser/CrashRecoveryHandler.java
@@ -25,9 +25,8 @@
 import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.os.Handler;
-import android.os.HandlerThread;
+import android.os.Message;
 import android.os.Parcel;
-import android.os.Process;
 import android.util.Log;
 
 import java.io.ByteArrayOutputStream;
@@ -35,6 +34,7 @@
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
+import java.io.IOException;
 
 public class CrashRecoveryHandler {
 
@@ -51,11 +51,20 @@
      */
     private static final long PROMPT_INTERVAL = 30 * 60 * 1000; // 30 minutes
 
+    private static final int MSG_WRITE_STATE = 1;
+    private static final int MSG_CLEAR_STATE = 2;
+    private static final int MSG_PRELOAD_STATE = 3;
+
     private static CrashRecoveryHandler sInstance;
 
     private Controller mController;
+    private Context mContext;
     private Handler mForegroundHandler;
     private Handler mBackgroundHandler;
+    private boolean mIsPreloading = false;
+    private boolean mDidPreload = false;
+    private boolean mShouldPrompt = false;
+    private Bundle mRecoveryState = null;
 
     public static CrashRecoveryHandler initialize(Controller controller) {
         if (sInstance == null) {
@@ -72,11 +81,46 @@
 
     private CrashRecoveryHandler(Controller controller) {
         mController = controller;
+        mContext = mController.getActivity().getApplicationContext();
         mForegroundHandler = new Handler();
-        HandlerThread thread = new HandlerThread(LOGTAG,
-                Process.THREAD_PRIORITY_BACKGROUND);
-        thread.start();
-        mBackgroundHandler = new Handler(thread.getLooper());
+        mBackgroundHandler = new Handler(BackgroundHandler.getLooper()) {
+
+            @Override
+            public void handleMessage(Message msg) {
+                switch (msg.what) {
+                case MSG_WRITE_STATE:
+                    Parcel p = Parcel.obtain();
+                    try {
+                        Bundle state = (Bundle) msg.obj;
+                        state.writeToParcel(p, 0);
+                        File stateFile = new File(mContext.getCacheDir(), STATE_FILE);
+                        FileOutputStream fout = new FileOutputStream(stateFile);
+                        fout.write(p.marshall());
+                        fout.close();
+                    } catch (Throwable e) {
+                        Log.i(LOGTAG, "Failed to save persistent state", e);
+                    } finally {
+                        p.recycle();
+                    }
+                    break;
+                case MSG_CLEAR_STATE:
+                    File state = new File(mContext.getCacheDir(), STATE_FILE);
+                    if (state.exists()) {
+                        state.delete();
+                    }
+                    break;
+                case MSG_PRELOAD_STATE:
+                    mRecoveryState = loadCrashState();
+                    mShouldPrompt = shouldPrompt();
+                    synchronized (CrashRecoveryHandler.this) {
+                        mIsPreloading = false;
+                        mDidPreload = true;
+                        CrashRecoveryHandler.this.notifyAll();
+                    }
+                    break;
+                }
+            }
+        };
     }
 
     public void backupState() {
@@ -90,9 +134,8 @@
             try {
                 final Bundle state = new Bundle();
                 mController.onSaveInstanceState(state, false);
-                Context context = mController.getActivity()
-                        .getApplicationContext();
-                mBackgroundHandler.post(new WriteState(context, state));
+                Message.obtain(mBackgroundHandler, MSG_WRITE_STATE, state)
+                        .sendToTarget();
                 // Remove any queued up saves
                 mForegroundHandler.removeCallbacks(mCreateState);
             } catch (Throwable t) {
@@ -103,42 +146,8 @@
 
     };
 
-    static class WriteState implements Runnable {
-        private Context mContext;
-        private Bundle mState;
-
-        WriteState(Context context, Bundle state) {
-            mContext = context;
-            mState = state;
-        }
-
-        @Override
-        public void run() {
-            if (mState.isEmpty()) {
-                clearState(mContext);
-                return;
-            }
-            Parcel p = Parcel.obtain();
-            try {
-                mState.writeToParcel(p, 0);
-                File state = new File(mContext.getCacheDir(), STATE_FILE);
-                FileOutputStream fout = new FileOutputStream(state);
-                fout.write(p.marshall());
-                fout.close();
-            } catch (Throwable e) {
-                Log.i(LOGTAG, "Failed to save persistent state", e);
-            } finally {
-                p.recycle();
-            }
-        }
-
-    }
-
-    public static void clearState(Context context) {
-        File state = new File(context.getCacheDir(), STATE_FILE);
-        if (state.exists()) {
-            state.delete();
-        }
+    public void clearState() {
+        mBackgroundHandler.sendEmptyMessage(MSG_CLEAR_STATE);
     }
 
     public void promptToRecover(final Bundle state, final Intent intent) {
@@ -162,7 +171,7 @@
                 .setOnCancelListener(new OnCancelListener() {
                     @Override
                     public void onCancel(DialogInterface dialog) {
-                        clearState(mController.getActivity());
+                        clearState();
                         mController.doStart(null, intent);
                     }
                 })
@@ -170,11 +179,9 @@
     }
 
     private boolean shouldPrompt() {
-        Context context = mController.getActivity();
-        SharedPreferences prefs = context.getSharedPreferences(
+        SharedPreferences prefs = mContext.getSharedPreferences(
                 RECOVERY_PREFERENCES, Context.MODE_PRIVATE);
-        long lastRecovered = prefs.getLong(KEY_LAST_RECOVERED,
-                System.currentTimeMillis());
+        long lastRecovered = prefs.getLong(KEY_LAST_RECOVERED, 0);
         long timeSinceLastRecover = System.currentTimeMillis() - lastRecovered;
         if (timeSinceLastRecover > PROMPT_INTERVAL) {
             return false;
@@ -183,21 +190,20 @@
     }
 
     private void updateLastRecovered() {
-        Context context = mController.getActivity();
-        SharedPreferences prefs = context.getSharedPreferences(
+        SharedPreferences prefs = mContext.getSharedPreferences(
                 RECOVERY_PREFERENCES, Context.MODE_PRIVATE);
         prefs.edit()
             .putLong(KEY_LAST_RECOVERED, System.currentTimeMillis())
-            .commit();
+            .apply();
     }
 
-    public void startRecovery(Intent intent) {
+    private Bundle loadCrashState() {
         Bundle state = null;
         Parcel parcel = Parcel.obtain();
+        FileInputStream fin = null;
         try {
-            Context context = mController.getActivity();
-            File stateFile = new File(context.getCacheDir(), STATE_FILE);
-            FileInputStream fin = new FileInputStream(stateFile);
+            File stateFile = new File(mContext.getCacheDir(), STATE_FILE);
+            fin = new FileInputStream(stateFile);
             ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
             byte[] buffer = new byte[BUFFER_SIZE];
             int read;
@@ -208,21 +214,53 @@
             parcel.unmarshall(data, 0, data.length);
             parcel.setDataPosition(0);
             state = parcel.readBundle();
-            if (shouldPrompt()) {
-                promptToRecover(state, intent);
-                return;
-            } else {
-                updateLastRecovered();
-            }
         } catch (FileNotFoundException e) {
             // No state to recover
             state = null;
-        } catch (Exception e) {
+        } catch (Throwable e) {
             Log.w(LOGTAG, "Failed to recover state!", e);
             state = null;
         } finally {
             parcel.recycle();
+            if (fin != null) {
+                try {
+                    fin.close();
+                } catch (IOException e) { }
+            }
         }
-        mController.doStart(state, intent);
+        return state;
     }
+
+    public void startRecovery(Intent intent) {
+        synchronized (CrashRecoveryHandler.this) {
+            while (mIsPreloading) {
+                try {
+                    CrashRecoveryHandler.this.wait();
+                } catch (InterruptedException e) {}
+            }
+        }
+        if (!mDidPreload) {
+            mRecoveryState = loadCrashState();
+            mShouldPrompt = shouldPrompt();
+        }
+        if (mShouldPrompt) {
+            promptToRecover(mRecoveryState, intent);
+            return;
+        } else {
+            updateLastRecovered();
+        }
+        mController.doStart(mRecoveryState, intent);
+        mRecoveryState = null;
+    }
+
+    public void preloadCrashState() {
+        synchronized (CrashRecoveryHandler.this) {
+            if (mIsPreloading) {
+                return;
+            }
+            mIsPreloading = true;
+        }
+        mBackgroundHandler.sendEmptyMessage(MSG_PRELOAD_STATE);
+    }
+
 }
diff --git a/src/com/android/browser/GoogleAccountLogin.java b/src/com/android/browser/GoogleAccountLogin.java
index 3b4f2aa..93996cd 100644
--- a/src/com/android/browser/GoogleAccountLogin.java
+++ b/src/com/android/browser/GoogleAccountLogin.java
@@ -281,16 +281,7 @@
             Log.d(LOGTAG, "Finished login attempt for " + mAccount.name);
             mActivity.runOnUiThread(mRunnable);
 
-            // Post a delayed message to dismiss the dialog in order to avoid a
-            // flash of the progress dialog.
-                mHandler.postDelayed(new Runnable() {
-                    @Override
-                    public void run() {
-                        if (mProgressDialog.isShowing()) {
-                            mProgressDialog.dismiss();
-                        }
-                    }
-                }, 2000);
+            mProgressDialog.dismiss();
             mRunnable = null;
             mActivity.runOnUiThread(new Runnable() {
                 @Override
diff --git a/src/com/android/browser/InstantSearchEngine.java b/src/com/android/browser/InstantSearchEngine.java
index c913494..4dd83fa 100644
--- a/src/com/android/browser/InstantSearchEngine.java
+++ b/src/com/android/browser/InstantSearchEngine.java
@@ -199,7 +199,7 @@
             return false;
         }
 
-        final String currentUrl = current.getUrl();
+        final String currentUrl = mController.getCurrentTab().getUrl();
 
         if (currentUrl != null) {
             Uri uri = Uri.parse(currentUrl);
diff --git a/src/com/android/browser/NfcHandler.java b/src/com/android/browser/NfcHandler.java
index bc19950..a8e11d3 100644
--- a/src/com/android/browser/NfcHandler.java
+++ b/src/com/android/browser/NfcHandler.java
@@ -21,6 +21,10 @@
 import android.nfc.NdefRecord;
 import android.nfc.NfcAdapter;
 import android.os.AsyncTask;
+import android.os.Handler;
+import android.os.Message;
+
+import java.util.concurrent.CountDownLatch;
 
 /** This class implements sharing the URL of the currently
   * shown browser page over NFC. Sharing is only active
@@ -31,42 +35,26 @@
     private NfcAdapter mNfcAdapter;
     private Activity mActivity;
     private Controller mController;
+    private Handler mHandler;
+    private Tab mCurrentTab;
+    private boolean mIsPrivate;
+    private CountDownLatch mPrivateBrowsingSignal;
 
-    /** We need an async task to check whether the tab is private
-      * on the UI thread.
-      */
-    private class CreateMessageTask extends AsyncTask<Void, Void, NdefMessage> {
-        private boolean mIsPrivate = false;
-        private Tab mCurrentTab;
-
-        @Override
-        protected void onPreExecute() {
-            mCurrentTab = mController.getCurrentTab();
-            if ((mCurrentTab != null) && (mCurrentTab.getWebView() != null)) {
-                mIsPrivate = mCurrentTab.getWebView().isPrivateBrowsingEnabled();
-            }
-        }
-
-        @Override
-        protected NdefMessage doInBackground(Void... params) {
-            if ((mCurrentTab == null) || mIsPrivate) {
-                return null;
-            }
-            String currentUrl = mCurrentTab.getUrl();
-            if (currentUrl != null) {
-                NdefRecord record = NdefRecord.createUri(currentUrl);
-                NdefMessage msg = new NdefMessage(new NdefRecord[] { record });
-                return msg;
-            } else {
-                return null;
-            }
-        }
-    }
+    private static final int GET_PRIVATE_BROWSING_STATE_MSG = 100;
 
     public NfcHandler(Activity browser, Controller controller) {
         mActivity = browser;
         mController = controller;
         mNfcAdapter = NfcAdapter.getDefaultAdapter(mActivity);
+        mHandler = new Handler() {
+            @Override
+            public void handleMessage(Message msg) {
+                if (msg.what == GET_PRIVATE_BROWSING_STATE_MSG) {
+                    mIsPrivate = mCurrentTab.getWebView().isPrivateBrowsingEnabled();
+                    mPrivateBrowsingSignal.countDown();
+                }
+            }
+        };
     }
 
     void onPause() {
@@ -83,11 +71,29 @@
 
     @Override
     public NdefMessage createMessage() {
-        CreateMessageTask task = new CreateMessageTask();
-        task.execute();
-        try {
-            return task.get();
-        } catch (Exception e) {
+        mCurrentTab = mController.getCurrentTab();
+        if ((mCurrentTab != null) && (mCurrentTab.getWebView() != null)) {
+            // We can only read the WebView state on the UI thread, so post
+            // a message and wait.
+            mPrivateBrowsingSignal = new CountDownLatch(1);
+            mHandler.sendMessage(mHandler.obtainMessage(GET_PRIVATE_BROWSING_STATE_MSG));
+            try {
+                mPrivateBrowsingSignal.await();
+            } catch (InterruptedException e) {
+                return null;
+            }
+        }
+
+        if ((mCurrentTab == null) || mIsPrivate) {
+            return null;
+        }
+
+        String currentUrl = mCurrentTab.getUrl();
+        if (currentUrl != null) {
+            NdefRecord record = NdefRecord.createUri(currentUrl);
+            NdefMessage msg = new NdefMessage(new NdefRecord[] { record });
+            return msg;
+        } else {
             return null;
         }
     }
diff --git a/src/com/android/browser/Preloader.java b/src/com/android/browser/Preloader.java
index bc84523..cc71f34 100644
--- a/src/com/android/browser/Preloader.java
+++ b/src/com/android/browser/Preloader.java
@@ -21,7 +21,6 @@
 import android.util.Log;
 import android.webkit.WebView;
 
-import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -39,7 +38,7 @@
     private final Context mContext;
     private final Handler mHandler;
     private final BrowserWebViewFactory mFactory;
-    private final HashMap<String, PreloaderSession> mSessions;
+    private volatile PreloaderSession mSession;
 
     public static void initialize(Context context) {
         sInstance = new Preloader(context);
@@ -52,36 +51,52 @@
     private Preloader(Context context) {
         mContext = context;
         mHandler = new Handler(Looper.getMainLooper());
-        mSessions = new HashMap<String, PreloaderSession>();
+        mSession = null;
         mFactory = new BrowserWebViewFactory(context);
 
     }
 
     private PreloaderSession getSession(String id) {
-        PreloaderSession s = mSessions.get(id);
-        if (s == null) {
+        if (mSession == null) {
             if (LOGD_ENABLED) Log.d(LOGTAG, "Create new preload session " + id);
-            s = new PreloaderSession(id);
-            mSessions.put(id, s);
-            WebViewTimersControl.getInstance().onPrerenderStart(s.getWebView());
+            mSession = new PreloaderSession(id);
+            WebViewTimersControl.getInstance().onPrerenderStart(
+                    mSession.getWebView());
+            return mSession;
+        } else if (mSession.mId.equals(id)) {
+            if (LOGD_ENABLED) Log.d(LOGTAG, "Returning existing preload session " + id);
+            return mSession;
         }
-        return s;
+
+        if (LOGD_ENABLED) Log.d(LOGTAG, "Existing session in progress : " + mSession.mId +
+                " returning null.");
+        return null;
     }
 
     private PreloaderSession takeSession(String id) {
-        PreloaderSession s = mSessions.remove(id);
+        PreloaderSession s = null;
+        if (mSession != null && mSession.mId.equals(id)) {
+            s = mSession;
+            mSession = null;
+        }
+
         if (s != null) {
             s.cancelTimeout();
         }
-        if (mSessions.size() == 0) {
-            WebViewTimersControl.getInstance().onPrerenderDone(s == null ? null : s.getWebView());
-        }
+
+        WebViewTimersControl.getInstance().onPrerenderDone(s == null ? null : s.getWebView());
         return s;
     }
 
     public void handlePreloadRequest(String id, String url, Map<String, String> headers,
             String searchBoxQuery) {
         PreloaderSession s = getSession(id);
+        if (s == null) {
+            if (LOGD_ENABLED) Log.d(LOGTAG, "Discarding preload request, existing"
+                    + " session in progress");
+            return;
+        }
+
         s.touch(); // reset timer
         PreloadedTabControl tab = s.getTabControl();
         if (searchBoxQuery != null) {
diff --git a/src/com/android/browser/SystemAllowGeolocationOrigins.java b/src/com/android/browser/SystemAllowGeolocationOrigins.java
index b53611f..a01541f 100644
--- a/src/com/android/browser/SystemAllowGeolocationOrigins.java
+++ b/src/com/android/browser/SystemAllowGeolocationOrigins.java
@@ -73,49 +73,48 @@
     }
 
     void maybeApplySettingAsync() {
-        new AsyncTask<Void,Void,Void>() {
-            @Override
-            protected Void doInBackground(Void... params) {
-                maybeApplySetting();
-                return null;
-            }
-        }.execute();
+        BackgroundHandler.execute(mMaybeApplySetting);
     }
 
     /**
      * Checks to see if the system setting has changed and if so,
      * updates the Geolocation permissions accordingly.
      */
-    private void maybeApplySetting() {
-        // Get the new value
-        String newSetting = getSystemSetting();
+    private Runnable mMaybeApplySetting = new Runnable() {
 
-        // Get the last read value
-        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mContext);
-        String lastReadSetting =
-                preferences.getString(LAST_READ_ALLOW_GEOLOCATION_ORIGINS, "");
+        @Override
+        public void run() {
+         // Get the new value
+            String newSetting = getSystemSetting();
 
-        // If the new value is the same as the last one we read, we're done.
-        if (TextUtils.equals(lastReadSetting, newSetting)) {
-            return;
+            // Get the last read value
+            SharedPreferences preferences = BrowserSettings.getInstance()
+                    .getPreferences();
+            String lastReadSetting =
+                    preferences.getString(LAST_READ_ALLOW_GEOLOCATION_ORIGINS, "");
+
+            // If the new value is the same as the last one we read, we're done.
+            if (TextUtils.equals(lastReadSetting, newSetting)) {
+                return;
+            }
+
+            // Save the new value as the last read value
+            preferences.edit()
+                    .putString(LAST_READ_ALLOW_GEOLOCATION_ORIGINS, newSetting)
+                    .apply();
+
+            Set<String> oldOrigins = parseAllowGeolocationOrigins(lastReadSetting);
+            Set<String> newOrigins = parseAllowGeolocationOrigins(newSetting);
+            Set<String> addedOrigins = setMinus(newOrigins, oldOrigins);
+            Set<String> removedOrigins = setMinus(oldOrigins, newOrigins);
+
+            // Remove the origins in the last read value
+            removeOrigins(removedOrigins);
+
+            // Add the origins in the new value
+            addOrigins(addedOrigins);
         }
-
-        // Save the new value as the last read value
-        preferences.edit()
-                .putString(LAST_READ_ALLOW_GEOLOCATION_ORIGINS, newSetting)
-                .apply();
-
-        Set<String> oldOrigins = parseAllowGeolocationOrigins(lastReadSetting);
-        Set<String> newOrigins = parseAllowGeolocationOrigins(newSetting);
-        Set<String> addedOrigins = setMinus(newOrigins, oldOrigins);
-        Set<String> removedOrigins = setMinus(oldOrigins, newOrigins);
-
-        // Remove the origins in the last read value
-        removeOrigins(removedOrigins);
-
-        // Add the origins in the new value
-        addOrigins(addedOrigins);
-    }
+    };
 
     /**
      * Parses the value of the default geolocation permissions setting.
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java
index 6473c88..7055ef3 100644
--- a/src/com/android/browser/TabControl.java
+++ b/src/com/android/browser/TabControl.java
@@ -155,7 +155,7 @@
     }
 
     boolean canCreateNewTab() {
-        return mMaxTabs != mTabs.size();
+        return mMaxTabs > mTabs.size();
     }
 
     /**
@@ -186,11 +186,10 @@
      *         number of open tabs.
      */
     Tab createNewTab(boolean privateBrowsing) {
-        int size = mTabs.size();
-        // Return false if we have maxed out on tabs
-        if (mMaxTabs == size) {
+        if (!canCreateNewTab()) {
             return null;
         }
+
         final WebView w = createNewWebView(privateBrowsing);
 
         // Create a new tab and add it to the tab list