summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/android/provider/chrome_browser_provider.cc2
-rw-r--r--chrome/browser/autocomplete/autocomplete_browsertest.cc2
-rw-r--r--chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc2
-rw-r--r--chrome/browser/autocomplete/history_provider.cc2
-rw-r--r--chrome/browser/autocomplete/history_quick_provider.cc2
-rw-r--r--chrome/browser/autocomplete/history_quick_provider_unittest.cc4
-rw-r--r--chrome/browser/autocomplete/history_url_provider.cc4
-rw-r--r--chrome/browser/autocomplete/history_url_provider_unittest.cc2
-rw-r--r--chrome/browser/autocomplete/in_memory_url_index.cc2
-rw-r--r--chrome/browser/autocomplete/in_memory_url_index_unittest.cc4
-rw-r--r--chrome/browser/autocomplete/search_provider_unittest.cc2
-rw-r--r--chrome/browser/autocomplete/shortcuts_backend.cc2
-rw-r--r--chrome/browser/autocomplete/shortcuts_provider.cc2
-rw-r--r--chrome/browser/autocomplete/shortcuts_provider_unittest.cc2
-rw-r--r--chrome/browser/autocomplete/url_index_private_data.cc2
-rw-r--r--chrome/browser/autocomplete/url_index_private_data.h2
-rw-r--r--chrome/browser/bookmarks/bookmark_html_writer_unittest.cc2
-rw-r--r--chrome/browser/bookmarks/chrome_bookmark_client.cc2
-rw-r--r--chrome/browser/browsing_data/browsing_data_remover.cc2
-rw-r--r--chrome/browser/browsing_data/browsing_data_remover_unittest.cc2
-rw-r--r--chrome/browser/custom_home_pages_table_model.cc2
-rw-r--r--chrome/browser/download/download_browsertest.cc2
-rw-r--r--chrome/browser/download/download_history.cc2
-rw-r--r--chrome/browser/download/download_history.h2
-rw-r--r--chrome/browser/download/download_history_unittest.cc2
-rw-r--r--chrome/browser/download/download_service.cc2
-rw-r--r--chrome/browser/download/download_target_determiner.cc2
-rw-r--r--chrome/browser/download/download_target_determiner_unittest.cc2
-rw-r--r--chrome/browser/extensions/api/history/history_api.cc2
-rw-r--r--chrome/browser/favicon/favicon_service.cc4
-rw-r--r--chrome/browser/favicon/favicon_service_factory.cc2
-rw-r--r--chrome/browser/favicon/favicon_tab_helper.cc2
-rw-r--r--chrome/browser/history/android/android_history_provider_service.cc4
-rw-r--r--chrome/browser/history/android/android_provider_backend.cc2
-rw-r--r--chrome/browser/history/android/android_provider_backend_unittest.cc2
-rw-r--r--chrome/browser/history/android/sqlite_cursor_unittest.cc2
-rw-r--r--chrome/browser/history/chrome_history_client.cc2
-rw-r--r--chrome/browser/history/history_backend_unittest.cc8
-rw-r--r--chrome/browser/history/history_browsertest.cc2
-rw-r--r--chrome/browser/history/history_querying_unittest.cc2
-rw-r--r--chrome/browser/history/history_service_factory.cc4
-rw-r--r--chrome/browser/history/history_tab_helper.cc2
-rw-r--r--chrome/browser/history/history_unittest.cc6
-rw-r--r--chrome/browser/history/redirect_browsertest.cc2
-rw-r--r--chrome/browser/history/top_sites_impl.cc2
-rw-r--r--chrome/browser/history/top_sites_impl.h2
-rw-r--r--chrome/browser/history/typed_url_syncable_service_unittest.cc4
-rw-r--r--chrome/browser/importer/profile_writer.cc2
-rw-r--r--chrome/browser/importer/profile_writer_unittest.cc2
-rw-r--r--chrome/browser/interstitials/security_interstitial_metrics_helper.cc2
-rw-r--r--chrome/browser/jumplist_win.cc2
-rw-r--r--chrome/browser/jumplist_win.h2
-rw-r--r--chrome/browser/predictors/autocomplete_action_predictor.cc2
-rw-r--r--chrome/browser/predictors/autocomplete_action_predictor_unittest.cc2
-rw-r--r--chrome/browser/predictors/resource_prefetch_predictor.cc2
-rw-r--r--chrome/browser/predictors/resource_prefetch_predictor_unittest.cc2
-rw-r--r--chrome/browser/prerender/prerender_local_predictor.cc2
-rw-r--r--chrome/browser/prerender/prerender_manager.h2
-rw-r--r--chrome/browser/profiles/profile_manager_unittest.cc2
-rw-r--r--chrome/browser/profiles/profile_window_browsertest.cc2
-rw-r--r--chrome/browser/safe_browsing/browser_feature_extractor.cc2
-rw-r--r--chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/download_protection_service.cc2
-rw-r--r--chrome/browser/safe_browsing/download_protection_service_unittest.cc2
-rw-r--r--chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc2
-rw-r--r--chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector.cc2
-rw-r--r--chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/malware_details_history.h2
-rw-r--r--chrome/browser/safe_browsing/malware_details_unittest.cc4
-rw-r--r--chrome/browser/search_engines/chrome_template_url_service_client.cc2
-rw-r--r--chrome/browser/sessions/session_restore.h2
-rw-r--r--chrome/browser/supervised_user/supervised_user_navigation_observer.cc2
-rw-r--r--chrome/browser/sync/glue/bookmark_change_processor.cc2
-rw-r--r--chrome/browser/sync/glue/bookmark_data_type_controller.cc2
-rw-r--r--chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc2
-rw-r--r--chrome/browser/sync/glue/favicon_cache.cc2
-rw-r--r--chrome/browser/sync/glue/history_model_worker.h2
-rw-r--r--chrome/browser/sync/glue/typed_url_change_processor.cc2
-rw-r--r--chrome/browser/sync/glue/typed_url_data_type_controller.cc2
-rw-r--r--chrome/browser/sync/glue/typed_url_model_associator.cc2
-rw-r--r--chrome/browser/sync/profile_sync_components_factory_impl.cc2
-rw-r--r--chrome/browser/sync/profile_sync_service_typed_url_unittest.cc4
-rw-r--r--chrome/browser/sync/sessions/notification_service_sessions_router.cc2
-rw-r--r--chrome/browser/sync/test/integration/bookmarks_helper.cc2
-rw-r--r--chrome/browser/sync/test/integration/typed_urls_helper.cc4
-rw-r--r--chrome/browser/ui/cocoa/history_menu_bridge.h2
-rw-r--r--chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm2
-rw-r--r--chrome/browser/ui/find_bar/find_bar_host_browsertest.cc2
-rw-r--r--chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc2
-rw-r--r--chrome/browser/ui/omnibox/omnibox_view_browsertest.cc2
-rw-r--r--chrome/browser/ui/search/instant_extended_interactive_uitest.cc2
-rw-r--r--chrome/browser/ui/sync/one_click_signin_helper.cc2
-rw-r--r--chrome/browser/ui/sync/profile_signin_confirmation_helper.cc4
-rw-r--r--chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc2
-rw-r--r--chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc2
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc2
-rw-r--r--chrome/browser/ui/website_settings/website_settings.h2
-rw-r--r--chrome/browser/ui/webui/bidi_checker_web_ui_test.cc2
-rw-r--r--chrome/browser/ui/webui/history_ui.cc2
-rw-r--r--chrome/browser/ui/webui/ntp/suggestions_source_top_sites.cc2
-rw-r--r--chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc2
-rw-r--r--chrome/chrome_browser.gypi12
-rw-r--r--chrome/test/base/testing_profile.cc6
-rw-r--r--chrome/test/base/ui_test_utils.h2
-rw-r--r--chrome/test/data/webui/history_ui_browsertest.cc2
-rw-r--r--components/components.gyp2
-rw-r--r--components/history.gypi14
-rw-r--r--components/history/DEPS1
-rw-r--r--components/history/content/DEPS3
-rw-r--r--components/history/content/browser/BUILD.gn3
-rw-r--r--components/history/content/browser/DEPS4
-rw-r--r--components/history/content/browser/content_visit_delegate.cc (renamed from chrome/browser/history/content_visit_delegate.cc)6
-rw-r--r--components/history/content/browser/content_visit_delegate.h (renamed from chrome/browser/history/content_visit_delegate.h)6
-rw-r--r--components/history/core/browser/BUILD.gn11
-rw-r--r--components/history/core/browser/delete_directive_handler.cc (renamed from chrome/browser/history/delete_directive_handler.cc)94
-rw-r--r--components/history/core/browser/delete_directive_handler.h (renamed from chrome/browser/history/delete_directive_handler.h)18
-rw-r--r--components/history/core/browser/history_backend.cc (renamed from chrome/browser/history/history_backend.cc)297
-rw-r--r--components/history/core/browser/history_backend.h (renamed from chrome/browser/history/history_backend.h)42
-rw-r--r--components/history/core/browser/history_service.cc (renamed from chrome/browser/history/history_service.cc)250
-rw-r--r--components/history/core/browser/history_service.h (renamed from chrome/browser/history/history_service.h)38
-rw-r--r--components/history/core/browser/in_memory_history_backend.cc (renamed from chrome/browser/history/in_memory_history_backend.cc)4
-rw-r--r--components/history/core/browser/in_memory_history_backend.h (renamed from chrome/browser/history/in_memory_history_backend.h)10
-rw-r--r--components/history/core/browser/typed_url_syncable_service.cc (renamed from chrome/browser/history/typed_url_syncable_service.cc)50
-rw-r--r--components/history/core/browser/typed_url_syncable_service.h (renamed from chrome/browser/history/typed_url_syncable_service.h)29
-rw-r--r--components/search_engines/template_url_service_unittest.cc2
126 files changed, 521 insertions, 627 deletions
diff --git a/chrome/browser/android/provider/chrome_browser_provider.cc b/chrome/browser/android/provider/chrome_browser_provider.cc
index 05667a7..84072a9 100644
--- a/chrome/browser/android/provider/chrome_browser_provider.cc
+++ b/chrome/browser/android/provider/chrome_browser_provider.cc
@@ -26,7 +26,6 @@
#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/history/android/sqlite_cursor.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/top_sites_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -35,6 +34,7 @@
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/history/core/browser/android/android_history_types.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/top_sites.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.h"
diff --git a/chrome/browser/autocomplete/autocomplete_browsertest.cc b/chrome/browser/autocomplete/autocomplete_browsertest.cc
index 996b9d9..c0d8e38 100644
--- a/chrome/browser/autocomplete/autocomplete_browsertest.cc
+++ b/chrome/browser/autocomplete/autocomplete_browsertest.cc
@@ -10,7 +10,6 @@
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/unpacked_installer.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
@@ -27,6 +26,7 @@
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/test_switches.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "components/history/core/browser/history_service.h"
#include "components/metrics/proto/omnibox_event.pb.h"
#include "components/omnibox/autocomplete_input.h"
#include "components/omnibox/autocomplete_match.h"
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
index 0310b3c7..61dd84c 100644
--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
+++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
@@ -9,12 +9,12 @@
#include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
#include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h"
#include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/common/pref_names.h"
+#include "components/history/core/browser/history_service.h"
ChromeAutocompleteProviderClient::ChromeAutocompleteProviderClient(
Profile* profile)
diff --git a/chrome/browser/autocomplete/history_provider.cc b/chrome/browser/autocomplete/history_provider.cc
index b0e168d9..3efdae5 100644
--- a/chrome/browser/autocomplete/history_provider.cc
+++ b/chrome/browser/autocomplete/history_provider.cc
@@ -10,11 +10,11 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
#include "components/bookmarks/browser/bookmark_model.h"
+#include "components/history/core/browser/history_service.h"
#include "components/omnibox/autocomplete_input.h"
#include "components/omnibox/autocomplete_match.h"
#include "url/url_util.h"
diff --git a/chrome/browser/autocomplete/history_quick_provider.cc b/chrome/browser/autocomplete/history_quick_provider.cc
index 64c63ab..3878629 100644
--- a/chrome/browser/autocomplete/history_quick_provider.cc
+++ b/chrome/browser/autocomplete/history_quick_provider.cc
@@ -23,7 +23,6 @@
#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
#include "chrome/browser/autocomplete/scored_history_match_builder_impl.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
@@ -32,6 +31,7 @@
#include "chrome/common/url_constants.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/history/core/browser/history_database.h"
+#include "components/history/core/browser/history_service.h"
#include "components/metrics/proto/omnibox_input_type.pb.h"
#include "components/omnibox/autocomplete_match_type.h"
#include "components/omnibox/autocomplete_result.h"
diff --git a/chrome/browser/autocomplete/history_quick_provider_unittest.cc b/chrome/browser/autocomplete/history_quick_provider_unittest.cc
index be28b19..027a202 100644
--- a/chrome/browser/autocomplete/history_quick_provider_unittest.cc
+++ b/chrome/browser/autocomplete/history_quick_provider_unittest.cc
@@ -22,15 +22,15 @@
#include "chrome/browser/autocomplete/in_memory_url_index_factory.h"
#include "chrome/browser/autocomplete/url_index_private_data.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/search_engines/chrome_template_url_service_client.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_database.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_service_observer.h"
#include "components/history/core/browser/url_database.h"
#include "components/metrics/proto/omnibox_event.pb.h"
diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc
index 1bf3261..9ff0a15 100644
--- a/chrome/browser/autocomplete/history_url_provider.cc
+++ b/chrome/browser/autocomplete/history_url_provider.cc
@@ -18,8 +18,6 @@
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
#include "chrome/browser/autocomplete/scored_history_match_builder_impl.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
@@ -28,7 +26,9 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "components/bookmarks/browser/bookmark_utils.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_database.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "components/metrics/proto/omnibox_input_type.pb.h"
#include "components/omnibox/autocomplete_match.h"
diff --git a/chrome/browser/autocomplete/history_url_provider_unittest.cc b/chrome/browser/autocomplete/history_url_provider_unittest.cc
index 062159c..e876785 100644
--- a/chrome/browser/autocomplete/history_url_provider_unittest.cc
+++ b/chrome/browser/autocomplete/history_url_provider_unittest.cc
@@ -13,13 +13,13 @@
#include "base/time/time.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
#include "chrome/browser/autocomplete/history_quick_provider.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/search_engines/chrome_template_url_service_client.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/url_database.h"
#include "components/metrics/proto/omnibox_event.pb.h"
#include "components/metrics/proto/omnibox_input_type.pb.h"
diff --git a/chrome/browser/autocomplete/in_memory_url_index.cc b/chrome/browser/autocomplete/in_memory_url_index.cc
index 32a7be1..82bdde5 100644
--- a/chrome/browser/autocomplete/in_memory_url_index.cc
+++ b/chrome/browser/autocomplete/in_memory_url_index.cc
@@ -8,8 +8,8 @@
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "chrome/browser/autocomplete/url_index_private_data.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/common/url_constants.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/url_database.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/autocomplete/in_memory_url_index_unittest.cc b/chrome/browser/autocomplete/in_memory_url_index_unittest.cc
index a7d12e0..40be560 100644
--- a/chrome/browser/autocomplete/in_memory_url_index_unittest.cc
+++ b/chrome/browser/autocomplete/in_memory_url_index_unittest.cc
@@ -19,14 +19,14 @@
#include "chrome/browser/autocomplete/scored_history_match_builder_impl.h"
#include "chrome/browser/autocomplete/url_index_private_data.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/history_index_restore_observer.h"
#include "chrome/test/base/testing_profile.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_database.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "sql/transaction.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc
index 5694245..594efa5 100644
--- a/chrome/browser/autocomplete/search_provider_unittest.cc
+++ b/chrome/browser/autocomplete/search_provider_unittest.cc
@@ -21,7 +21,6 @@
#include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
#include "chrome/browser/autocomplete/history_url_provider.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
@@ -32,6 +31,7 @@
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "components/google/core/browser/google_switches.h"
+#include "components/history/core/browser/history_service.h"
#include "components/metrics/proto/omnibox_event.pb.h"
#include "components/omnibox/autocomplete_input.h"
#include "components/omnibox/autocomplete_match.h"
diff --git a/chrome/browser/autocomplete/shortcuts_backend.cc b/chrome/browser/autocomplete/shortcuts_backend.cc
index 24c899b..7f4e83c 100644
--- a/chrome/browser/autocomplete/shortcuts_backend.cc
+++ b/chrome/browser/autocomplete/shortcuts_backend.cc
@@ -15,13 +15,13 @@
#include "base/strings/string_util.h"
#include "chrome/browser/autocomplete/shortcuts_database.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/omnibox/omnibox_log.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
#include "chrome/common/chrome_constants.h"
+#include "components/history/core/browser/history_service.h"
#include "components/omnibox/autocomplete_input.h"
#include "components/omnibox/autocomplete_match.h"
#include "components/omnibox/autocomplete_match_type.h"
diff --git a/chrome/browser/autocomplete/shortcuts_provider.cc b/chrome/browser/autocomplete/shortcuts_provider.cc
index 1ab57e4..9625e0d 100644
--- a/chrome/browser/autocomplete/shortcuts_provider.cc
+++ b/chrome/browser/autocomplete/shortcuts_provider.cc
@@ -20,12 +20,12 @@
#include "base/time/time.h"
#include "chrome/browser/autocomplete/history_provider.h"
#include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "components/history/core/browser/history_service.h"
#include "components/metrics/proto/omnibox_input_type.pb.h"
#include "components/omnibox/autocomplete_input.h"
#include "components/omnibox/autocomplete_match.h"
diff --git a/chrome/browser/autocomplete/shortcuts_provider_unittest.cc b/chrome/browser/autocomplete/shortcuts_provider_unittest.cc
index 8acb8b4..d4f4bff 100644
--- a/chrome/browser/autocomplete/shortcuts_provider_unittest.cc
+++ b/chrome/browser/autocomplete/shortcuts_provider_unittest.cc
@@ -21,8 +21,8 @@
#include "chrome/browser/autocomplete/in_memory_url_index.h"
#include "chrome/browser/autocomplete/shortcuts_backend.h"
#include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/url_database.h"
#include "components/metrics/proto/omnibox_event.pb.h"
#include "components/omnibox/autocomplete_input.h"
diff --git a/chrome/browser/autocomplete/url_index_private_data.cc b/chrome/browser/autocomplete/url_index_private_data.cc
index 7565ee1..35a0075 100644
--- a/chrome/browser/autocomplete/url_index_private_data.cc
+++ b/chrome/browser/autocomplete/url_index_private_data.cc
@@ -20,10 +20,10 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "chrome/browser/autocomplete/in_memory_url_index.h"
-#include "chrome/browser/history/history_service.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/history/core/browser/history_database.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "net/base/net_util.h"
#if defined(USE_SYSTEM_PROTOBUF)
diff --git a/chrome/browser/autocomplete/url_index_private_data.h b/chrome/browser/autocomplete/url_index_private_data.h
index c0feda1..11c8bb1 100644
--- a/chrome/browser/autocomplete/url_index_private_data.h
+++ b/chrome/browser/autocomplete/url_index_private_data.h
@@ -14,7 +14,7 @@
#include "chrome/browser/autocomplete/in_memory_url_index_cache.pb.h"
#include "chrome/browser/autocomplete/in_memory_url_index_types.h"
#include "chrome/browser/autocomplete/scored_history_match.h"
-#include "chrome/browser/history/history_service.h"
+#include "components/history/core/browser/history_service.h"
class HistoryQuickProviderTest;
diff --git a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
index 11eb1ed..4dcc1937 100644
--- a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/common/importer/importer_data_types.h"
@@ -23,6 +22,7 @@
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
#include "components/favicon_base/favicon_usage_data.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "grit/components_strings.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/bookmarks/chrome_bookmark_client.cc b/chrome/browser/bookmarks/chrome_bookmark_client.cc
index 7b82935..1e9d1ea 100644
--- a/chrome/browser/bookmarks/chrome_bookmark_client.cc
+++ b/chrome/browser/bookmarks/chrome_bookmark_client.cc
@@ -10,13 +10,13 @@
#include "base/values.h"
#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/bookmarks/browser/bookmark_utils.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/url_database.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
diff --git a/chrome/browser/browsing_data/browsing_data_remover.cc b/chrome/browser/browsing_data/browsing_data_remover.cc
index 7498536..3760fff 100644
--- a/chrome/browser/browsing_data/browsing_data_remover.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover.cc
@@ -20,7 +20,6 @@
#include "chrome/browser/domain_reliability/service_factory.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/download/download_service_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/web_history_service_factory.h"
#include "chrome/browser/io_thread.h"
@@ -46,6 +45,7 @@
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/domain_reliability/service.h"
+#include "components/history/core/browser/history_service.h"
#include "components/nacl/browser/nacl_browser.h"
#include "components/nacl/browser/pnacl_host.h"
#include "components/password_manager/core/browser/password_store.h"
diff --git a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
index 61f325a..bc3f936 100644
--- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc
@@ -21,7 +21,6 @@
#include "chrome/browser/browsing_data/browsing_data_helper.h"
#include "chrome/browser/browsing_data/browsing_data_remover_test_util.h"
#include "chrome/browser/domain_reliability/service_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/common/pref_names.h"
@@ -35,6 +34,7 @@
#include "components/domain_reliability/clear_mode.h"
#include "components/domain_reliability/monitor.h"
#include "components/domain_reliability/service.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/cookie_store_factory.h"
#include "content/public/browser/dom_storage_context.h"
#include "content/public/browser/local_storage_usage_info.h"
diff --git a/chrome/browser/custom_home_pages_table_model.cc b/chrome/browser/custom_home_pages_table_model.cc
index 240c619..8d70d92 100644
--- a/chrome/browser/custom_home_pages_table_model.cc
+++ b/chrome/browser/custom_home_pages_table_model.cc
@@ -9,7 +9,6 @@
#include "base/i18n/rtl.h"
#include "base/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -19,6 +18,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/web_contents.h"
#include "net/base/net_util.h"
#include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index ca8338a..22de15a 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -40,7 +40,6 @@
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/extension_install_prompt_show_params.h"
#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/net/url_request_mock_util.h"
@@ -70,6 +69,7 @@
#include "components/history/content/browser/download_constants_utils.h"
#include "components/history/core/browser/download_constants.h"
#include "components/history/core/browser/download_row.h"
+#include "components/history/core/browser/history_service.h"
#include "components/infobars/core/confirm_infobar_delegate.h"
#include "components/infobars/core/infobar.h"
#include "content/public/browser/download_interrupt_reasons.h"
diff --git a/chrome/browser/download/download_history.cc b/chrome/browser/download/download_history.cc
index 3ee464c..32c8263 100644
--- a/chrome/browser/download/download_history.cc
+++ b/chrome/browser/download/download_history.cc
@@ -30,10 +30,10 @@
#include "base/metrics/histogram.h"
#include "chrome/browser/download/download_crx_util.h"
-#include "chrome/browser/history/history_service.h"
#include "components/history/content/browser/download_constants_utils.h"
#include "components/history/core/browser/download_database.h"
#include "components/history/core/browser/download_row.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_item.h"
#include "content/public/browser/download_manager.h"
diff --git a/chrome/browser/download/download_history.h b/chrome/browser/download/download_history.h
index be037b1..56e8d0d 100644
--- a/chrome/browser/download/download_history.h
+++ b/chrome/browser/download/download_history.h
@@ -13,7 +13,7 @@
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "chrome/browser/download/all_download_item_notifier.h"
-#include "chrome/browser/history/history_service.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/download_item.h"
#include "content/public/browser/download_manager.h"
diff --git a/chrome/browser/download/download_history_unittest.cc b/chrome/browser/download/download_history_unittest.cc
index 5c43c67..8891320 100644
--- a/chrome/browser/download/download_history_unittest.cc
+++ b/chrome/browser/download/download_history_unittest.cc
@@ -8,10 +8,10 @@
#include "base/rand_util.h"
#include "base/stl_util.h"
#include "chrome/browser/download/download_history.h"
-#include "chrome/browser/history/history_service.h"
#include "components/history/content/browser/download_constants_utils.h"
#include "components/history/core/browser/download_constants.h"
#include "components/history/core/browser/download_row.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/test/mock_download_item.h"
#include "content/public/test/mock_download_manager.h"
#include "content/public/test/test_browser_thread.h"
diff --git a/chrome/browser/download/download_service.cc b/chrome/browser/download/download_service.cc
index 5970de7..6e4f7c9 100644
--- a/chrome/browser/download/download_service.cc
+++ b/chrome/browser/download/download_service.cc
@@ -11,11 +11,11 @@
#include "chrome/browser/download/download_service_factory.h"
#include "chrome/browser/download/download_status_updater.h"
#include "chrome/browser/download/download_ui_controller.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/net/chrome_net_log.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/download_manager.h"
#if defined(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc
index 8678dcff..afdd7f9 100644
--- a/chrome/browser/download/download_target_determiner.cc
+++ b/chrome/browser/download/download_target_determiner.cc
@@ -12,11 +12,11 @@
#include "chrome/browser/download/download_crx_util.h"
#include "chrome/browser/download/download_extensions.h"
#include "chrome/browser/download/download_prefs.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_interrupt_reasons.h"
diff --git a/chrome/browser/download/download_target_determiner_unittest.cc b/chrome/browser/download/download_target_determiner_unittest.cc
index 093136e..988e290 100644
--- a/chrome/browser/download/download_target_determiner_unittest.cc
+++ b/chrome/browser/download/download_target_determiner_unittest.cc
@@ -17,12 +17,12 @@
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/download/download_target_determiner.h"
#include "chrome/browser/download/download_target_info.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_pref_service_syncable.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "content/public/browser/download_interrupt_reasons.h"
#include "content/public/browser/render_process_host.h"
diff --git a/chrome/browser/extensions/api/history/history_api.cc b/chrome/browser/extensions/api/history/history_api.cc
index ec1c748..658ad2c 100644
--- a/chrome/browser/extensions/api/history/history_api.cc
+++ b/chrome/browser/extensions/api/history/history_api.cc
@@ -19,12 +19,12 @@
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/extensions/activity_log/activity_log.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/api/history.h"
#include "chrome/common/pref_names.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_system_provider.h"
diff --git a/chrome/browser/favicon/favicon_service.cc b/chrome/browser/favicon/favicon_service.cc
index 2bbdadb..9fd9eb7 100644
--- a/chrome/browser/favicon/favicon_service.cc
+++ b/chrome/browser/favicon/favicon_service.cc
@@ -8,13 +8,13 @@
#include "base/hash.h"
#include "base/message_loop/message_loop_proxy.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
#include "chrome/common/url_constants.h"
#include "components/favicon_base/favicon_util.h"
#include "components/favicon_base/select_favicon_frames.h"
+#include "components/history/core/browser/history_backend.h"
+#include "components/history/core/browser/history_service.h"
#include "extensions/common/constants.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
diff --git a/chrome/browser/favicon/favicon_service_factory.cc b/chrome/browser/favicon/favicon_service_factory.cc
index 628c7f0..24cd9d6 100644
--- a/chrome/browser/favicon/favicon_service_factory.cc
+++ b/chrome/browser/favicon/favicon_service_factory.cc
@@ -8,9 +8,9 @@
#include "base/prefs/pref_service.h"
#include "chrome/browser/favicon/chrome_favicon_client_factory.h"
#include "chrome/browser/favicon/favicon_service.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
+#include "components/history/core/browser/history_service.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
// static
diff --git a/chrome/browser/favicon/favicon_tab_helper.cc b/chrome/browser/favicon/favicon_tab_helper.cc
index 053cdfc..c3b1a14 100644
--- a/chrome/browser/favicon/favicon_tab_helper.cc
+++ b/chrome/browser/favicon/favicon_tab_helper.cc
@@ -11,13 +11,13 @@
#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/favicon/favicon_tab_helper_observer.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/search.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/url_constants.h"
#include "components/favicon_base/favicon_types.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/invalidate_type.h"
#include "content/public/browser/navigation_controller.h"
diff --git a/chrome/browser/history/android/android_history_provider_service.cc b/chrome/browser/history/android/android_history_provider_service.cc
index c0fc46c..482b4ff 100644
--- a/chrome/browser/history/android/android_history_provider_service.cc
+++ b/chrome/browser/history/android/android_history_provider_service.cc
@@ -7,12 +7,12 @@
#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/history/android/android_provider_backend.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "components/history/core/browser/android/android_history_types.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
namespace {
diff --git a/chrome/browser/history/android/android_provider_backend.cc b/chrome/browser/history/android/android_provider_backend.cc
index dd6e143..4ab8ff41 100644
--- a/chrome/browser/history/android/android_provider_backend.cc
+++ b/chrome/browser/history/android/android_provider_backend.cc
@@ -6,12 +6,12 @@
#include "base/i18n/case_conversion.h"
#include "chrome/browser/history/android/bookmark_model_sql_handler.h"
-#include "chrome/browser/history/history_backend.h"
#include "components/history/core/browser/android/android_time.h"
#include "components/history/core/browser/android/android_urls_sql_handler.h"
#include "components/history/core/browser/android/favicon_sql_handler.h"
#include "components/history/core/browser/android/urls_sql_handler.h"
#include "components/history/core/browser/android/visit_sql_handler.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_backend_notifier.h"
#include "components/history/core/browser/history_client.h"
#include "components/history/core/browser/history_database.h"
diff --git a/chrome/browser/history/android/android_provider_backend_unittest.cc b/chrome/browser/history/android/android_provider_backend_unittest.cc
index 4703f77..09c4894 100644
--- a/chrome/browser/history/android/android_provider_backend_unittest.cc
+++ b/chrome/browser/history/android/android_provider_backend_unittest.cc
@@ -15,7 +15,6 @@
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/history/chrome_history_client.h"
#include "chrome/browser/history/chrome_history_client_factory.h"
-#include "chrome/browser/history/history_backend.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/test/base/testing_browser_process.h"
@@ -24,6 +23,7 @@
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
#include "components/history/core/browser/android/android_time.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_constants.h"
#include "components/history/core/browser/history_database_params.h"
#include "components/history/core/browser/keyword_search_term.h"
diff --git a/chrome/browser/history/android/sqlite_cursor_unittest.cc b/chrome/browser/history/android/sqlite_cursor_unittest.cc
index c7aa0c2..aa8205a 100644
--- a/chrome/browser/history/android/sqlite_cursor_unittest.cc
+++ b/chrome/browser/history/android/sqlite_cursor_unittest.cc
@@ -14,7 +14,6 @@
#include "base/time/time.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/history/android/android_history_provider_service.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/test/base/testing_browser_process.h"
@@ -23,6 +22,7 @@
#include "components/bookmarks/test/bookmark_test_helpers.h"
#include "components/history/core/browser/android/android_history_types.h"
#include "components/history/core/browser/android/android_time.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/test_utils.h"
diff --git a/chrome/browser/history/chrome_history_client.cc b/chrome/browser/history/chrome_history_client.cc
index eb112dd..16665f2 100644
--- a/chrome/browser/history/chrome_history_client.cc
+++ b/chrome/browser/history/chrome_history_client.cc
@@ -15,7 +15,7 @@
#if defined(OS_ANDROID)
#include "base/files/file_path.h"
#include "chrome/browser/history/android/android_provider_backend.h"
-#include "chrome/browser/history/history_backend.h"
+#include "components/history/core/browser/history_backend.h"
#endif
#if defined(OS_ANDROID)
diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc
index 8bc2ecd..9442ae0 100644
--- a/chrome/browser/history/history_backend_unittest.cc
+++ b/chrome/browser/history/history_backend_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/history/history_backend.h"
+#include "components/history/core/browser/history_backend.h"
#include <algorithm>
#include <set>
@@ -22,19 +22,19 @@
#include "base/strings/string16.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/history/content_visit_delegate.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
-#include "chrome/browser/history/in_memory_history_backend.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
#include "components/favicon_base/favicon_usage_data.h"
+#include "components/history/content/browser/content_visit_delegate.h"
#include "components/history/core/browser/history_constants.h"
#include "components/history/core/browser/history_database_params.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_service_observer.h"
#include "components/history/core/browser/in_memory_database.h"
+#include "components/history/core/browser/in_memory_history_backend.h"
#include "components/history/core/browser/keyword_search_term.h"
#include "components/history/core/browser/visit_filter.h"
#include "components/history/core/test/history_client_fake_bookmarks.h"
diff --git a/chrome/browser/history/history_browsertest.cc b/chrome/browser/history/history_browsertest.cc
index fdefed2..125506a 100644
--- a/chrome/browser/history/history_browsertest.cc
+++ b/chrome/browser/history/history_browsertest.cc
@@ -10,7 +10,6 @@
#include "base/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -22,6 +21,7 @@
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_browser_thread.h"
diff --git a/chrome/browser/history/history_querying_unittest.cc b/chrome/browser/history/history_querying_unittest.cc
index b9d55b9..0897589 100644
--- a/chrome/browser/history/history_querying_unittest.cc
+++ b/chrome/browser/history/history_querying_unittest.cc
@@ -11,8 +11,8 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/cancelable_task_tracker.h"
-#include "chrome/browser/history/history_service.h"
#include "components/history/core/browser/history_database_params.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/test/test_history_database.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/history/history_service_factory.cc b/chrome/browser/history/history_service_factory.cc
index 6295ea9..f153780 100644
--- a/chrome/browser/history/history_service_factory.cc
+++ b/chrome/browser/history/history_service_factory.cc
@@ -10,14 +10,14 @@
#include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
#include "chrome/browser/history/chrome_history_client.h"
#include "chrome/browser/history/chrome_history_client_factory.h"
-#include "chrome/browser/history/content_visit_delegate.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "components/bookmarks/browser/bookmark_model.h"
+#include "components/history/content/browser/content_visit_delegate.h"
#include "components/history/content/browser/history_database_helper.h"
#include "components/history/core/browser/history_database_params.h"
+#include "components/history/core/browser/history_service.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/keyed_service/core/service_access_type.h"
diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc
index 295f7cc..e80c724 100644
--- a/chrome/browser/history/history_tab_helper.cc
+++ b/chrome/browser/history/history_tab_helper.cc
@@ -6,7 +6,6 @@
#include <utility>
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/prerender/prerender_contents.h"
#include "chrome/browser/prerender/prerender_manager.h"
@@ -14,6 +13,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/render_messages.h"
#include "components/history/content/browser/history_context_helper.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc
index d110d7b..e45fd4a 100644
--- a/chrome/browser/history/history_unittest.cc
+++ b/chrome/browser/history/history_unittest.cc
@@ -42,20 +42,20 @@
#include "base/task/cancelable_task_tracker.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
-#include "chrome/browser/history/in_memory_history_backend.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "components/history/content/browser/download_constants_utils.h"
#include "components/history/content/browser/history_database_helper.h"
#include "components/history/core/browser/download_constants.h"
#include "components/history/core/browser/download_row.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_constants.h"
#include "components/history/core/browser/history_database.h"
#include "components/history/core/browser/history_database_params.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/in_memory_database.h"
+#include "components/history/core/browser/in_memory_history_backend.h"
#include "components/history/core/browser/page_usage_data.h"
#include "components/history/core/common/thumbnail_score.h"
#include "components/history/core/test/history_unittest_base.h"
diff --git a/chrome/browser/history/redirect_browsertest.cc b/chrome/browser/history/redirect_browsertest.cc
index 713cac7..1acd971 100644
--- a/chrome/browser/history/redirect_browsertest.cc
+++ b/chrome/browser/history/redirect_browsertest.cc
@@ -18,7 +18,6 @@
#include "base/task/cancelable_task_tracker.h"
#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -26,6 +25,7 @@
#include "chrome/browser/ui/view_ids.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_navigation_observer.h"
diff --git a/chrome/browser/history/top_sites_impl.cc b/chrome/browser/history/top_sites_impl.cc
index 94f365b..2cad9e3 100644
--- a/chrome/browser/history/top_sites_impl.cc
+++ b/chrome/browser/history/top_sites_impl.cc
@@ -22,11 +22,11 @@
#include "base/task_runner.h"
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/history/history_backend.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/history_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_db_task.h"
#include "components/history/core/browser/page_usage_data.h"
#include "components/history/core/browser/top_sites_cache.h"
diff --git a/chrome/browser/history/top_sites_impl.h b/chrome/browser/history/top_sites_impl.h
index 8314ce1..91518ec 100644
--- a/chrome/browser/history/top_sites_impl.h
+++ b/chrome/browser/history/top_sites_impl.h
@@ -20,7 +20,7 @@
#include "base/task/cancelable_task_tracker.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
-#include "chrome/browser/history/history_service.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_service_observer.h"
#include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/page_usage_data.h"
diff --git a/chrome/browser/history/typed_url_syncable_service_unittest.cc b/chrome/browser/history/typed_url_syncable_service_unittest.cc
index 8be8a81..2b5cc77 100644
--- a/chrome/browser/history/typed_url_syncable_service_unittest.cc
+++ b/chrome/browser/history/typed_url_syncable_service_unittest.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/history/typed_url_syncable_service.h"
+#include "components/history/core/browser/typed_url_syncable_service.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/history/history_backend.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_types.h"
#include "content/public/browser/notification_types.h"
#include "sync/api/fake_sync_change_processor.h"
diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc
index bbc6fc5..8d514d4 100644
--- a/chrome/browser/importer/profile_writer.cc
+++ b/chrome/browser/importer/profile_writer.cc
@@ -17,7 +17,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -27,6 +26,7 @@
#include "chrome/common/pref_names.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/bookmarks/browser/bookmark_model.h"
+#include "components/history/core/browser/history_service.h"
#include "components/password_manager/core/browser/password_store.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.h"
diff --git a/chrome/browser/importer/profile_writer_unittest.cc b/chrome/browser/importer/profile_writer_unittest.cc
index e0eed84..74da6a7 100644
--- a/chrome/browser/importer/profile_writer_unittest.cc
+++ b/chrome/browser/importer/profile_writer_unittest.cc
@@ -9,7 +9,6 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/importer/importer_unittest_utils.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
@@ -18,6 +17,7 @@
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/interstitials/security_interstitial_metrics_helper.cc b/chrome/browser/interstitials/security_interstitial_metrics_helper.cc
index 7b2b444..1fd8a27 100644
--- a/chrome/browser/interstitials/security_interstitial_metrics_helper.cc
+++ b/chrome/browser/interstitials/security_interstitial_metrics_helper.cc
@@ -8,10 +8,10 @@
#include "base/metrics/histogram.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/webdata/web_data_service_factory.h"
+#include "components/history/core/browser/history_service.h"
#include "components/rappor/rappor_service.h"
#include "components/rappor/rappor_utils.h"
#include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/jumplist_win.cc b/chrome/browser/jumplist_win.cc
index e8aa2fb..010b3b14 100644
--- a/chrome/browser/jumplist_win.cc
+++ b/chrome/browser/jumplist_win.cc
@@ -16,7 +16,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/top_sites_factory.h"
#include "chrome/browser/metrics/jumplist_metrics_win.h"
#include "chrome/browser/profiles/profile.h"
@@ -29,6 +28,7 @@
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "components/favicon_base/favicon_types.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/page_usage_data.h"
#include "components/history/core/browser/top_sites.h"
#include "components/sessions/session_types.h"
diff --git a/chrome/browser/jumplist_win.h b/chrome/browser/jumplist_win.h
index 3d2d49a..cd46088 100644
--- a/chrome/browser/jumplist_win.h
+++ b/chrome/browser/jumplist_win.h
@@ -14,11 +14,11 @@
#include "base/memory/weak_ptr.h"
#include "base/synchronization/lock.h"
#include "base/task/cancelable_task_tracker.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/jumplist_updater_win.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/sessions/tab_restore_service.h"
#include "chrome/browser/sessions/tab_restore_service_observer.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/top_sites_observer.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/predictors/autocomplete_action_predictor.cc b/chrome/browser/predictors/autocomplete_action_predictor.cc
index 2afdd8c..bdac40f 100644
--- a/chrome/browser/predictors/autocomplete_action_predictor.cc
+++ b/chrome/browser/predictors/autocomplete_action_predictor.cc
@@ -16,7 +16,6 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/omnibox/omnibox_log.h"
#include "chrome/browser/predictors/autocomplete_action_predictor_factory.h"
@@ -28,6 +27,7 @@
#include "chrome/browser/prerender/prerender_manager_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/omnibox/omnibox_popup_model.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/in_memory_database.h"
#include "components/omnibox/autocomplete_match.h"
#include "components/omnibox/autocomplete_result.h"
diff --git a/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc b/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc
index 3a27a30..9aa9ed9 100644
--- a/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc
+++ b/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc
@@ -12,11 +12,11 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/prerender/prerender_field_trial.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/in_memory_database.h"
#include "components/history/core/browser/url_database.h"
#include "components/omnibox/autocomplete_match.h"
diff --git a/chrome/browser/predictors/resource_prefetch_predictor.cc b/chrome/browser/predictors/resource_prefetch_predictor.cc
index 68db96e..a40dfa4 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor.cc
@@ -15,7 +15,6 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/predictors/predictor_database.h"
#include "chrome/browser/predictors/predictor_database_factory.h"
@@ -25,6 +24,7 @@
#include "chrome/common/url_constants.h"
#include "components/history/core/browser/history_database.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/resource_request_info.h"
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc
index 4087050..a4e8165 100644
--- a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc
+++ b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc
@@ -8,11 +8,11 @@
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/time/time.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/predictors/resource_prefetch_predictor.h"
#include "chrome/browser/predictors/resource_prefetch_predictor_tables.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/prerender/prerender_local_predictor.cc b/chrome/browser/prerender/prerender_local_predictor.cc
index ea93025..18d92d7 100644
--- a/chrome/browser/prerender/prerender_local_predictor.cc
+++ b/chrome/browser/prerender/prerender_local_predictor.cc
@@ -19,7 +19,6 @@
#include "base/stl_util.h"
#include "base/timer/timer.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/prerender/prerender_field_trial.h"
#include "chrome/browser/prerender/prerender_handle.h"
@@ -33,6 +32,7 @@
#include "chrome/common/prefetch_messages.h"
#include "components/history/core/browser/history_database.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
diff --git a/chrome/browser/prerender/prerender_manager.h b/chrome/browser/prerender/prerender_manager.h
index 8e97dd2..5dd1c08 100644
--- a/chrome/browser/prerender/prerender_manager.h
+++ b/chrome/browser/prerender/prerender_manager.h
@@ -17,7 +17,6 @@
#include "base/threading/non_thread_safe.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/media/media_capture_devices_dispatcher.h"
#include "chrome/browser/predictors/logged_in_predictor_table.h"
#include "chrome/browser/prerender/prerender_config.h"
@@ -25,6 +24,7 @@
#include "chrome/browser/prerender/prerender_final_status.h"
#include "chrome/browser/prerender/prerender_histograms.h"
#include "chrome/browser/prerender/prerender_origin.h"
+#include "components/history/core/browser/history_service.h"
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
diff --git a/chrome/browser/profiles/profile_manager_unittest.cc b/chrome/browser/profiles/profile_manager_unittest.cc
index 48463fa..6233bc0 100644
--- a/chrome/browser/profiles/profile_manager_unittest.cc
+++ b/chrome/browser/profiles/profile_manager_unittest.cc
@@ -15,7 +15,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/io_thread.h"
#include "chrome/browser/prefs/browser_prefs.h"
@@ -35,6 +34,7 @@
#include "chrome/test/base/test_browser_window.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/history/core/browser/history_service.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "content/public/browser/notification_service.h"
#include "content/public/common/content_switches.h"
diff --git a/chrome/browser/profiles/profile_window_browsertest.cc b/chrome/browser/profiles/profile_window_browsertest.cc
index e040b2b..76a38b1 100644
--- a/chrome/browser/profiles/profile_window_browsertest.cc
+++ b/chrome/browser/profiles/profile_window_browsertest.cc
@@ -9,7 +9,6 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
@@ -21,6 +20,7 @@
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "components/search_engines/template_url_service.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "content/public/browser/notification_service.h"
diff --git a/chrome/browser/safe_browsing/browser_feature_extractor.cc b/chrome/browser/safe_browsing/browser_feature_extractor.cc
index d57ade8..9b62c02 100644
--- a/chrome/browser/safe_browsing/browser_feature_extractor.cc
+++ b/chrome/browser/safe_browsing/browser_feature_extractor.cc
@@ -13,13 +13,13 @@
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/browser_features.h"
#include "chrome/browser/safe_browsing/client_side_detection_host.h"
#include "chrome/browser/safe_browsing/database_manager.h"
#include "chrome/common/safe_browsing/csd.pb.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
diff --git a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
index 18c7cfe..210c541 100644
--- a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
+++ b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
@@ -12,8 +12,6 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/browser_features.h"
@@ -24,6 +22,8 @@
#include "chrome/common/safe_browsing/csd.pb.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/history/core/browser/history_backend.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/referrer.h"
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
index e614893..79ebdcf 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -21,7 +21,6 @@
#include "base/threading/sequenced_worker_pool.h"
#include "base/time/time.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/binary_feature_extractor.h"
@@ -35,6 +34,7 @@
#include "chrome/common/safe_browsing/zip_analyzer.h"
#include "chrome/common/url_constants.h"
#include "components/google/core/browser/google_util.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_item.h"
#include "content/public/browser/page_navigator.h"
diff --git a/chrome/browser/safe_browsing/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
index 237af0a..351cf45 100644
--- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc
@@ -20,7 +20,6 @@
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/threading/sequenced_worker_pool.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/safe_browsing/binary_feature_extractor.h"
#include "chrome/browser/safe_browsing/database_manager.h"
@@ -28,6 +27,7 @@
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/common/safe_browsing/csd.pb.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/test/mock_download_item.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_utils.h"
diff --git a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc
index 7d18098..5c20327 100644
--- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc
@@ -13,13 +13,13 @@
#include "base/prefs/pref_service.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/safe_browsing/csd.pb.h"
#include "chrome/common/safe_browsing/download_protection_util.h"
#include "components/history/core/browser/download_constants.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
diff --git a/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc
index d007508..80084e3 100644
--- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc
@@ -15,8 +15,6 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/history/chrome_history_client.h"
#include "chrome/browser/history/chrome_history_client_factory.h"
-#include "chrome/browser/history/content_visit_delegate.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/web_history_service_factory.h"
#include "chrome/browser/prefs/browser_prefs.h"
@@ -28,12 +26,14 @@
#include "chrome/test/base/testing_pref_service_syncable.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
+#include "components/history/content/browser/content_visit_delegate.h"
#include "components/history/content/browser/download_constants_utils.h"
#include "components/history/content/browser/history_database_helper.h"
#include "components/history/core/browser/download_constants.h"
#include "components/history/core/browser/download_row.h"
#include "components/history/core/browser/history_constants.h"
#include "components/history/core/browser/history_database_params.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector.cc b/chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector.cc
index f022416..8fe1e15 100644
--- a/chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector.cc
@@ -12,10 +12,10 @@
#include "base/metrics/histogram.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/database_manager.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/resource_request_info.h"
diff --git a/chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector_unittest.cc
index 67b779e..0d45920 100644
--- a/chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/off_domain_inclusion_detector_unittest.cc
@@ -13,8 +13,6 @@
#include "base/time/time.h"
#include "chrome/browser/history/chrome_history_client.h"
#include "chrome/browser/history/chrome_history_client_factory.h"
-#include "chrome/browser/history/content_visit_delegate.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/web_history_service_factory.h"
#include "chrome/browser/prefs/browser_prefs.h"
@@ -28,9 +26,11 @@
#include "chrome/test/base/testing_pref_service_syncable.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
+#include "components/history/content/browser/content_visit_delegate.h"
#include "components/history/content/browser/history_database_helper.h"
#include "components/history/core/browser/history_constants.h"
#include "components/history/core/browser/history_database_params.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "components/keyed_service/core/service_access_type.h"
#include "content/public/browser/resource_request_info.h"
diff --git a/chrome/browser/safe_browsing/malware_details_history.h b/chrome/browser/safe_browsing/malware_details_history.h
index 012a748..c343890 100644
--- a/chrome/browser/safe_browsing/malware_details_history.h
+++ b/chrome/browser/safe_browsing/malware_details_history.h
@@ -16,7 +16,7 @@
#include "base/memory/ref_counted.h"
#include "base/sequenced_task_runner_helpers.h"
#include "base/task/cancelable_task_tracker.h"
-#include "chrome/browser/history/history_service.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
diff --git a/chrome/browser/safe_browsing/malware_details_unittest.cc b/chrome/browser/safe_browsing/malware_details_unittest.cc
index 57b8c4f..02289fc 100644
--- a/chrome/browser/safe_browsing/malware_details_unittest.cc
+++ b/chrome/browser/safe_browsing/malware_details_unittest.cc
@@ -8,8 +8,6 @@
#include "base/pickle.h"
#include "base/run_loop.h"
#include "base/time/time.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/malware_details.h"
@@ -21,6 +19,8 @@
#include "chrome/common/safe_browsing/safebrowsing_messages.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/history/core/browser/history_backend.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "net/base/io_buffer.h"
diff --git a/chrome/browser/search_engines/chrome_template_url_service_client.cc b/chrome/browser/search_engines/chrome_template_url_service_client.cc
index 1a4cf80..d0be9c9 100644
--- a/chrome/browser/search_engines/chrome_template_url_service_client.cc
+++ b/chrome/browser/search_engines/chrome_template_url_service_client.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/search_engines/chrome_template_url_service_client.h"
-#include "chrome/browser/history/history_service.h"
+#include "components/history/core/browser/history_service.h"
#include "components/search_engines/template_url_service.h"
#include "extensions/common/constants.h"
diff --git a/chrome/browser/sessions/session_restore.h b/chrome/browser/sessions/session_restore.h
index 8e7193a..cc1d757 100644
--- a/chrome/browser/sessions/session_restore.h
+++ b/chrome/browser/sessions/session_restore.h
@@ -9,8 +9,8 @@
#include "base/basictypes.h"
#include "base/callback_list.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/ui/host_desktop.h"
+#include "components/history/core/browser/history_service.h"
#include "components/sessions/session_types.h"
#include "ui/base/window_open_disposition.h"
diff --git a/chrome/browser/supervised_user/supervised_user_navigation_observer.cc b/chrome/browser/supervised_user/supervised_user_navigation_observer.cc
index 249c65c..9fbf548 100644
--- a/chrome/browser/supervised_user/supervised_user_navigation_observer.cc
+++ b/chrome/browser/supervised_user/supervised_user_navigation_observer.cc
@@ -8,7 +8,6 @@
#include "base/callback.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -19,6 +18,7 @@
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/grit/generated_resources.h"
#include "components/history/content/browser/history_context_helper.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "components/infobars/core/confirm_infobar_delegate.h"
#include "components/infobars/core/infobar.h"
diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc
index ce9ae91..03174d1 100644
--- a/chrome/browser/sync/glue/bookmark_change_processor.cc
+++ b/chrome/browser/sync/glue/bookmark_change_processor.cc
@@ -16,7 +16,6 @@
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_service.h"
@@ -26,6 +25,7 @@
#include "components/bookmarks/browser/bookmark_client.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_utils.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/browser_thread.h"
#include "sync/internal_api/public/change_record.h"
#include "sync/internal_api/public/read_node.h"
diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.cc b/chrome/browser/sync/glue/bookmark_data_type_controller.cc
index 0625334..93e0342 100644
--- a/chrome/browser/sync/glue/bookmark_data_type_controller.cc
+++ b/chrome/browser/sync/glue/bookmark_data_type_controller.cc
@@ -7,13 +7,13 @@
#include "base/metrics/histogram.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h"
#include "chrome/browser/sync/profile_sync_components_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "components/bookmarks/browser/bookmark_model.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/browser_thread.h"
using bookmarks::BookmarkModel;
diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
index f0d6578..e815bb3 100644
--- a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/bookmarks/chrome_bookmark_client.h"
#include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_components_factory_mock.h"
@@ -23,6 +22,7 @@
#include "chrome/test/base/profile_mock.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
+#include "components/history/core/browser/history_service.h"
#include "components/keyed_service/core/refcounted_keyed_service.h"
#include "components/sync_driver/change_processor_mock.h"
#include "components/sync_driver/data_type_controller_mock.h"
diff --git a/chrome/browser/sync/glue/favicon_cache.cc b/chrome/browser/sync/glue/favicon_cache.cc
index 1a331e7..506263b 100644
--- a/chrome/browser/sync/glue/favicon_cache.cc
+++ b/chrome/browser/sync/glue/favicon_cache.cc
@@ -8,8 +8,8 @@
#include "base/metrics/histogram.h"
#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "sync/api/time.h"
#include "sync/protocol/favicon_image_specifics.pb.h"
diff --git a/chrome/browser/sync/glue/history_model_worker.h b/chrome/browser/sync/glue/history_model_worker.h
index d081228..43bb809 100644
--- a/chrome/browser/sync/glue/history_model_worker.h
+++ b/chrome/browser/sync/glue/history_model_worker.h
@@ -13,8 +13,8 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/task/cancelable_task_tracker.h"
-#include "chrome/browser/history/history_service.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
class HistoryService;
diff --git a/chrome/browser/sync/glue/typed_url_change_processor.cc b/chrome/browser/sync/glue/typed_url_change_processor.cc
index 16dfdbf..92b0d06 100644
--- a/chrome/browser/sync/glue/typed_url_change_processor.cc
+++ b/chrome/browser/sync/glue/typed_url_change_processor.cc
@@ -8,10 +8,10 @@
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/history/history_backend.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/glue/typed_url_model_associator.h"
#include "chrome/browser/sync/profile_sync_service.h"
+#include "components/history/core/browser/history_backend.h"
#include "content/public/browser/browser_thread.h"
#include "sync/internal_api/public/change_record.h"
#include "sync/internal_api/public/read_node.h"
diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.cc b/chrome/browser/sync/glue/typed_url_data_type_controller.cc
index cfdc8e7..c5df90f 100644
--- a/chrome/browser/sync/glue/typed_url_data_type_controller.cc
+++ b/chrome/browser/sync/glue/typed_url_data_type_controller.cc
@@ -9,7 +9,6 @@
#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h"
@@ -18,6 +17,7 @@
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/common/pref_names.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
diff --git a/chrome/browser/sync/glue/typed_url_model_associator.cc b/chrome/browser/sync/glue/typed_url_model_associator.cc
index 376c5ec..373fc7c 100644
--- a/chrome/browser/sync/glue/typed_url_model_associator.cc
+++ b/chrome/browser/sync/glue/typed_url_model_associator.cc
@@ -11,8 +11,8 @@
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/history/history_backend.h"
#include "chrome/browser/sync/profile_sync_service.h"
+#include "components/history/core/browser/history_backend.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/net_util.h"
#include "sync/api/sync_error.h"
diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc
index 6f078f1..f676974 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc
@@ -7,7 +7,6 @@
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/bookmarks/enhanced_bookmarks_features.h"
#include "chrome/browser/dom_distiller/dom_distiller_service_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/pref_service_flags_storage.h"
@@ -51,6 +50,7 @@
#include "components/autofill/core/common/autofill_pref_names.h"
#include "components/autofill/core/common/autofill_switches.h"
#include "components/dom_distiller/core/dom_distiller_service.h"
+#include "components/history/core/browser/history_service.h"
#include "components/password_manager/core/browser/password_store.h"
#include "components/search_engines/template_url_service.h"
#include "components/signin/core/browser/signin_manager.h"
diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc
index c6fb8a8..e40fec0 100644
--- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc
@@ -17,8 +17,6 @@
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/invalidation/fake_invalidation_service.h"
#include "chrome/browser/invalidation/profile_invalidation_provider_factory.h"
@@ -41,8 +39,10 @@
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_backend_notifier.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "components/invalidation/invalidation_service.h"
#include "components/invalidation/profile_invalidation_provider.h"
diff --git a/chrome/browser/sync/sessions/notification_service_sessions_router.cc b/chrome/browser/sync/sessions/notification_service_sessions_router.cc
index d660c91..7a65498 100644
--- a/chrome/browser/sync/sessions/notification_service_sessions_router.cc
+++ b/chrome/browser/sync/sessions/notification_service_sessions_router.cc
@@ -6,12 +6,12 @@
#include "base/logging.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/glue/sync_start_util.h"
#include "chrome/browser/sync/glue/synced_tab_delegate.h"
#include "chrome/browser/ui/browser.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_details.h"
diff --git a/chrome/browser/sync/test/integration/bookmarks_helper.cc b/chrome/browser/sync/test/integration/bookmarks_helper.cc
index 035d3c2..5155cf7 100644
--- a/chrome/browser/sync/test/integration/bookmarks_helper.cc
+++ b/chrome/browser/sync/test/integration/bookmarks_helper.cc
@@ -23,7 +23,6 @@
#include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/glue/bookmark_change_processor.h"
@@ -38,6 +37,7 @@
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/favicon_base/favicon_util.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "content/public/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/sync/test/integration/typed_urls_helper.cc b/chrome/browser/sync/test/integration/typed_urls_helper.cc
index 1ad6970..07302cb 100644
--- a/chrome/browser/sync/test/integration/typed_urls_helper.cc
+++ b/chrome/browser/sync/test/integration/typed_urls_helper.cc
@@ -9,14 +9,14 @@
#include "base/synchronization/waitable_event.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/time/time.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/test/integration/multi_client_status_change_checker.h"
#include "chrome/browser/sync/test/integration/sync_datatype_helper.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
using sync_datatype_helper::test;
diff --git a/chrome/browser/ui/cocoa/history_menu_bridge.h b/chrome/browser/ui/cocoa/history_menu_bridge.h
index fee5e95..7f516c3 100644
--- a/chrome/browser/ui/cocoa/history_menu_bridge.h
+++ b/chrome/browser/ui/cocoa/history_menu_bridge.h
@@ -14,10 +14,10 @@
#include "base/scoped_observer.h"
#include "base/task/cancelable_task_tracker.h"
#import "chrome/browser/favicon/favicon_service.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/sessions/tab_restore_service.h"
#include "chrome/browser/sessions/tab_restore_service_observer.h"
#import "chrome/browser/ui/cocoa/main_menu_item.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_service_observer.h"
#include "components/sessions/session_id.h"
diff --git a/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm b/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm
index 109fb60..c85c0b4 100644
--- a/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm
+++ b/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm
@@ -7,7 +7,6 @@
#include "base/memory/scoped_vector.h"
#include "chrome/app/chrome_command_ids.h" // IDC_HISTORY_MENU
#import "chrome/browser/app_controller_mac.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/tab_restore_service.h"
#include "chrome/browser/sessions/tab_restore_service_factory.h"
@@ -16,6 +15,7 @@
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
#include "chrome/browser/ui/host_desktop.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#import "ui/base/cocoa/cocoa_base_utils.h"
#include "ui/base/window_open_disposition.h"
diff --git a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc
index 7007f87..fa637dea 100644
--- a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc
+++ b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc
@@ -9,7 +9,6 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -29,6 +28,7 @@
#include "chrome/test/base/find_in_page_observer.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
diff --git a/chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc b/chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc
index b6d5b12..6e66584 100644
--- a/chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc
+++ b/chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.cc
@@ -7,11 +7,11 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/autocomplete/shortcuts_backend.h"
#include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/grit/generated_resources.h"
+#include "components/history/core/browser/history_service.h"
#include "components/infobars/core/infobar.h"
#include "content/public/browser/web_contents.h"
#include "grit/theme_resources.h"
diff --git a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
index d78ea3c..c20d98e 100644
--- a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
+++ b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/autocomplete/history_quick_provider.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
@@ -35,6 +34,7 @@
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_service_observer.h"
#include "components/omnibox/autocomplete_input.h"
#include "components/omnibox/autocomplete_match.h"
diff --git a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
index 3d620cb..8a563eb 100644
--- a/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
+++ b/chrome/browser/ui/search/instant_extended_interactive_uitest.cc
@@ -21,7 +21,6 @@
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/instant_service.h"
@@ -49,6 +48,7 @@
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/top_sites.h"
#include "components/history/core/common/thumbnail_score.h"
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc
index e72ae55..f1d62b3 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -27,7 +27,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/defaults.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
#include "chrome/browser/profiles/profile.h"
@@ -62,6 +61,7 @@
#include "chrome/grit/generated_resources.h"
#include "components/autofill/core/common/password_form.h"
#include "components/google/core/browser/google_util.h"
+#include "components/history/core/browser/history_service.h"
#include "components/password_manager/core/browser/password_manager.h"
#include "components/signin/core/browser/signin_client.h"
#include "components/signin/core/browser/signin_error_controller.h"
diff --git a/chrome/browser/ui/sync/profile_signin_confirmation_helper.cc b/chrome/browser/ui/sync/profile_signin_confirmation_helper.cc
index 4337e17..5edbd01 100644
--- a/chrome/browser/ui/sync/profile_signin_confirmation_helper.cc
+++ b/chrome/browser/ui/sync/profile_signin_confirmation_helper.cc
@@ -10,12 +10,12 @@
#include "base/strings/string16.h"
#include "base/task/cancelable_task_tracker.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "components/bookmarks/browser/bookmark_model.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "content/public/browser/browser_thread.h"
#include "ui/gfx/color_utils.h"
diff --git a/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc b/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc
index e425e87..85d93b3 100644
--- a/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc
+++ b/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc
@@ -20,13 +20,13 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/test/base/testing_pref_service_syncable.h"
#include "chrome/test/base/testing_profile.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/test/bookmark_test_helpers.h"
+#include "components/history/core/browser/history_service.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_utils.h"
diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc b/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc
index e5d8746..66c4092 100644
--- a/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc
+++ b/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc
@@ -9,7 +9,6 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
@@ -19,6 +18,7 @@
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/test_browser_window.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc
index 1f729c0..0ef71fe 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc
@@ -12,7 +12,6 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/bookmarks/bookmark_utils.h"
#include "chrome/grit/generated_resources.h"
@@ -20,6 +19,7 @@
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/constrained_window/constrained_window_views.h"
+#include "components/history/core/browser/history_service.h"
#include "components/url_fixer/url_fixer.h"
#include "components/user_prefs/user_prefs.h"
#include "ui/accessibility/ax_view_state.h"
diff --git a/chrome/browser/ui/website_settings/website_settings.h b/chrome/browser/ui/website_settings/website_settings.h
index 596e1dd..cdeca69 100644
--- a/chrome/browser/ui/website_settings/website_settings.h
+++ b/chrome/browser/ui/website_settings/website_settings.h
@@ -10,9 +10,9 @@
#include "base/task/cancelable_task_tracker.h"
#include "base/time/time.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
-#include "chrome/browser/history/history_service.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_types.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/common/signed_certificate_timestamp_id_and_status.h"
#include "ui/gfx/native_widget_types.h"
#include "url/gurl.h"
diff --git a/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc b/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc
index b2e0f99..2387d29 100644
--- a/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc
+++ b/chrome/browser/ui/webui/bidi_checker_web_ui_test.cc
@@ -15,7 +15,6 @@
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/autofill/personal_data_manager_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/profiles/profile.h"
@@ -25,6 +24,7 @@
#include "components/autofill/core/browser/autofill_profile.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/personal_data_manager.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/browser_thread.h"
#include "ui/base/resource/resource_bundle.h"
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc
index 8585e3f..4de30e1 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -23,7 +23,6 @@
#include "chrome/browser/banners/app_banner_settings_helper.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/web_history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -40,6 +39,7 @@
#include "chrome/grit/generated_resources.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_utils.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/web_history_service.h"
#include "components/search/search.h"
diff --git a/chrome/browser/ui/webui/ntp/suggestions_source_top_sites.cc b/chrome/browser/ui/webui/ntp/suggestions_source_top_sites.cc
index e18bc05..21e7d87 100644
--- a/chrome/browser/ui/webui/ntp/suggestions_source_top_sites.cc
+++ b/chrome/browser/ui/webui/ntp/suggestions_source_top_sites.cc
@@ -10,12 +10,12 @@
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
#include "chrome/browser/ui/webui/ntp/suggestions_combiner.h"
#include "chrome/common/chrome_switches.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/top_sites.h"
#include "components/history/core/browser/visit_filter.h"
diff --git a/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc b/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc
index 644d4b2..5c92b32 100644
--- a/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc
+++ b/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc
@@ -17,11 +17,11 @@
#include "chrome/browser/autocomplete/autocomplete_controller.h"
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "components/bookmarks/browser/bookmark_model.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/url_database.h"
#include "components/metrics/proto/omnibox_event.pb.h"
#include "components/omnibox/autocomplete_match.h"
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 48b468f..7407563 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1567,28 +1567,16 @@
'browser/history/chrome_history_client.h',
'browser/history/chrome_history_client_factory.cc',
'browser/history/chrome_history_client_factory.h',
- 'browser/history/content_visit_delegate.cc',
- 'browser/history/content_visit_delegate.h',
- 'browser/history/delete_directive_handler.cc',
- 'browser/history/delete_directive_handler.h',
- 'browser/history/history_backend.cc',
- 'browser/history/history_backend.h',
- 'browser/history/history_service.cc',
- 'browser/history/history_service.h',
'browser/history/history_service_factory.cc',
'browser/history/history_service_factory.h',
'browser/history/history_tab_helper.cc',
'browser/history/history_tab_helper.h',
'browser/history/history_utils.cc',
'browser/history/history_utils.h',
- 'browser/history/in_memory_history_backend.cc',
- 'browser/history/in_memory_history_backend.h',
'browser/history/top_sites_factory.cc',
'browser/history/top_sites_factory.h',
'browser/history/top_sites_impl.cc',
'browser/history/top_sites_impl.h',
- 'browser/history/typed_url_syncable_service.cc',
- 'browser/history/typed_url_syncable_service.h',
'browser/history/web_history_service_factory.cc',
'browser/history/web_history_service_factory.h',
],
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index 8d7ba7b..05ddc46 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -25,9 +25,6 @@
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/history/chrome_history_client.h"
#include "chrome/browser/history/chrome_history_client_factory.h"
-#include "chrome/browser/history/content_visit_delegate.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/top_sites_factory.h"
#include "chrome/browser/history/top_sites_impl.h"
@@ -58,10 +55,13 @@
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/common/bookmark_constants.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
+#include "components/history/content/browser/content_visit_delegate.h"
#include "components/history/content/browser/history_database_helper.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_constants.h"
#include "components/history/core/browser/history_database_params.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/top_sites.h"
#include "components/history/core/browser/top_sites_observer.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
diff --git a/chrome/test/base/ui_test_utils.h b/chrome/test/base/ui_test_utils.h
index 6cd40dc..4ba1029 100644
--- a/chrome/test/base/ui_test_utils.h
+++ b/chrome/test/base/ui_test_utils.h
@@ -14,7 +14,7 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
-#include "chrome/browser/history/history_service.h"
+#include "components/history/core/browser/history_service.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
diff --git a/chrome/test/data/webui/history_ui_browsertest.cc b/chrome/test/data/webui/history_ui_browsertest.cc
index 121e696..3d080e2 100644
--- a/chrome/test/data/webui/history_ui_browsertest.cc
+++ b/chrome/test/data/webui/history_ui_browsertest.cc
@@ -6,12 +6,12 @@
#include "base/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "components/history/core/browser/history_service.h"
HistoryUIBrowserTest::HistoryUIBrowserTest()
: history_(NULL),
diff --git a/components/components.gyp b/components/components.gyp
index 6fc7aec..849b45f 100644
--- a/components/components.gyp
+++ b/components/components.gyp
@@ -31,7 +31,6 @@
'favicon_base.gypi',
'google.gypi',
'handoff.gypi',
- 'history.gypi',
'infobars.gypi',
'json_schema.gypi',
'keyed_service.gypi',
@@ -135,6 +134,7 @@
# introduced.
'includes': [
'gcm_driver.gypi',
+ 'history.gypi',
'omnibox.gypi',
'renderer_context_menu.gypi',
'search_engines.gypi',
diff --git a/components/history.gypi b/components/history.gypi
index 75be781..7bf0dd0 100644
--- a/components/history.gypi
+++ b/components/history.gypi
@@ -17,6 +17,7 @@
'../net/net.gyp:net',
'../skia/skia.gyp:skia',
'../sql/sql.gyp:sql',
+ '../sync/sync.gyp:sync',
'../third_party/sqlite/sqlite.gyp:sqlite',
'../ui/base/ui_base.gyp:ui_base',
'../ui/gfx/gfx.gyp:gfx',
@@ -28,6 +29,8 @@
],
'sources': [
# Note: sources list duplicated in GN build.
+ 'history/core/browser/delete_directive_handler.cc',
+ 'history/core/browser/delete_directive_handler.h',
'history/core/browser/download_constants.h',
'history/core/browser/download_database.cc',
'history/core/browser/download_database.h',
@@ -37,6 +40,8 @@
'history/core/browser/download_types.h',
'history/core/browser/expire_history_backend.cc',
'history/core/browser/expire_history_backend.h',
+ 'history/core/browser/history_backend.cc',
+ 'history/core/browser/history_backend.h',
'history/core/browser/history_backend_notifier.h',
'history/core/browser/history_backend_observer.h',
'history/core/browser/history_client.cc',
@@ -51,11 +56,15 @@
'history/core/browser/history_db_task.h',
'history/core/browser/history_match.cc',
'history/core/browser/history_match.h',
+ 'history/core/browser/history_service.cc',
+ 'history/core/browser/history_service.h',
'history/core/browser/history_service_observer.h',
'history/core/browser/history_types.cc',
'history/core/browser/history_types.h',
'history/core/browser/in_memory_database.cc',
'history/core/browser/in_memory_database.h',
+ 'history/core/browser/in_memory_history_backend.cc',
+ 'history/core/browser/in_memory_history_backend.h',
'history/core/browser/keyword_id.h',
'history/core/browser/keyword_search_term.cc',
'history/core/browser/keyword_search_term.h',
@@ -72,6 +81,8 @@
'history/core/browser/top_sites_database.cc',
'history/core/browser/top_sites_database.h',
'history/core/browser/top_sites_observer.h',
+ 'history/core/browser/typed_url_syncable_service.cc',
+ 'history/core/browser/typed_url_syncable_service.h',
'history/core/browser/url_database.cc',
'history/core/browser/url_database.h',
'history/core/browser/url_row.cc',
@@ -172,8 +183,11 @@
'../base/base.gyp:base',
'../content/content.gyp:content_browser',
'history_core_browser',
+ 'visitedlink_browser',
],
'sources': [
+ 'history/content/browser/content_visit_delegate.cc',
+ 'history/content/browser/content_visit_delegate.h',
'history/content/browser/download_constants_utils.cc',
'history/content/browser/download_constants_utils.h',
'history/content/browser/history_context_helper.cc',
diff --git a/components/history/DEPS b/components/history/DEPS
index e6b1835..58b0b17 100644
--- a/components/history/DEPS
+++ b/components/history/DEPS
@@ -6,6 +6,7 @@ include_rules = [
"+google_apis/gaia",
"+net",
"+sql",
+ "+sync",
"+third_party/skia",
"+third_party/sqlite",
"+ui/base",
diff --git a/components/history/content/DEPS b/components/history/content/DEPS
deleted file mode 100644
index 60dbcf4..0000000
--- a/components/history/content/DEPS
+++ /dev/null
@@ -1,3 +0,0 @@
-include_rules = [
- "+content",
-]
diff --git a/components/history/content/browser/BUILD.gn b/components/history/content/browser/BUILD.gn
index cd4c98c..22f91b5 100644
--- a/components/history/content/browser/BUILD.gn
+++ b/components/history/content/browser/BUILD.gn
@@ -4,6 +4,8 @@
static_library("browser") {
sources = [
+ "content_visit_delegate.cc",
+ "content_visit_delegate.h",
"download_constants_utils.cc",
"download_constants_utils.h",
"history_context_helper.cc",
@@ -15,6 +17,7 @@ static_library("browser") {
deps = [
"//base",
"//components/history/core/browser",
+ "//components/visitedlink/browser",
"//content/public/browser",
]
}
diff --git a/components/history/content/browser/DEPS b/components/history/content/browser/DEPS
new file mode 100644
index 0000000..4ef4ece
--- /dev/null
+++ b/components/history/content/browser/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+ "+components/visitedlink/browser",
+ "+content/public/browser",
+]
diff --git a/chrome/browser/history/content_visit_delegate.cc b/components/history/content/browser/content_visit_delegate.cc
index 6bd3935..9b6a393 100644
--- a/chrome/browser/history/content_visit_delegate.cc
+++ b/components/history/content/browser/content_visit_delegate.cc
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/history/content_visit_delegate.h"
+#include "components/history/content/browser/content_visit_delegate.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_database.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "components/visitedlink/browser/visitedlink_master.h"
#include "url/gurl.h"
diff --git a/chrome/browser/history/content_visit_delegate.h b/components/history/content/browser/content_visit_delegate.h
index df98c72..611fe27 100644
--- a/chrome/browser/history/content_visit_delegate.h
+++ b/components/history/content/browser/content_visit_delegate.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_HISTORY_CONTENT_VISIT_DELEGATE_H_
-#define CHROME_BROWSER_HISTORY_CONTENT_VISIT_DELEGATE_H_
+#ifndef COMPONENTS_HISTORY_CONTENT_BROWSER_CONTENT_VISIT_DELEGATE_H_
+#define COMPONENTS_HISTORY_CONTENT_BROWSER_CONTENT_VISIT_DELEGATE_H_
#include <vector>
@@ -48,4 +48,4 @@ class ContentVisitDelegate : public history::VisitDelegate,
DISALLOW_COPY_AND_ASSIGN(ContentVisitDelegate);
};
-#endif // CHROME_BROWSER_HISTORY_CONTENT_VISIT_DELEGATE_H_
+#endif // COMPONENTS_HISTORY_CONTENT_BROWSER_CONTENT_VISIT_DELEGATE_H_
diff --git a/components/history/core/browser/BUILD.gn b/components/history/core/browser/BUILD.gn
index 3a4571d..b2ed448 100644
--- a/components/history/core/browser/BUILD.gn
+++ b/components/history/core/browser/BUILD.gn
@@ -4,6 +4,8 @@
static_library("browser") {
sources = [
+ "delete_directive_handler.cc",
+ "delete_directive_handler.h",
"download_constants.h",
"download_database.cc",
"download_database.h",
@@ -13,6 +15,8 @@ static_library("browser") {
"download_types.h",
"expire_history_backend.cc",
"expire_history_backend.h",
+ "history_backend.cc",
+ "history_backend.h",
"history_backend_notifier.h",
"history_backend_observer.h",
"history_client.cc",
@@ -27,11 +31,15 @@ static_library("browser") {
"history_db_task.h",
"history_match.cc",
"history_match.h",
+ "history_service.cc",
+ "history_service.h",
"history_service_observer.h",
"history_types.cc",
"history_types.h",
"in_memory_database.cc",
"in_memory_database.h",
+ "in_memory_history_backend.cc",
+ "in_memory_history_backend.h",
"keyword_id.h",
"keyword_search_term.cc",
"keyword_search_term.h",
@@ -48,6 +56,8 @@ static_library("browser") {
"top_sites_database.cc",
"top_sites_database.h",
"top_sites_observer.h",
+ "typed_url_syncable_service.cc",
+ "typed_url_syncable_service.h",
"url_database.cc",
"url_database.h",
"url_row.cc",
@@ -78,6 +88,7 @@ static_library("browser") {
"//net",
"//skia",
"//sql",
+ "//sync",
"//third_party/sqlite",
"//ui/base",
"//ui/gfx",
diff --git a/chrome/browser/history/delete_directive_handler.cc b/components/history/core/browser/delete_directive_handler.cc
index 8cad2c3..5404ce8 100644
--- a/chrome/browser/history/delete_directive_handler.cc
+++ b/components/history/core/browser/delete_directive_handler.cc
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/history/delete_directive_handler.h"
+#include "components/history/core/browser/delete_directive_handler.h"
#include "base/json/json_writer.h"
#include "base/rand_util.h"
#include "base/time/time.h"
#include "base/values.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/history_service.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_service.h"
#include "sync/api/sync_change.h"
#include "sync/protocol/history_delete_directive_specifics.pb.h"
#include "sync/protocol/proto_value_conversions.h"
@@ -64,7 +64,7 @@ int64 TimeToUnixUsec(base::Time time) {
// Converts global IDs in |global_id_directive| to times.
void GetTimesFromGlobalIds(
const sync_pb::GlobalIdDirective& global_id_directive,
- std::set<base::Time> *times) {
+ std::set<base::Time>* times) {
for (int i = 0; i < global_id_directive.global_id_size(); ++i) {
times->insert(
base::Time::FromInternalValue(global_id_directive.global_id(i)));
@@ -119,9 +119,9 @@ class DeleteDirectiveHandler::DeleteDirectiveTask : public HistoryDBTask {
base::WeakPtr<DeleteDirectiveHandler> delete_directive_handler,
const syncer::SyncDataList& delete_directive,
DeleteDirectiveHandler::PostProcessingAction post_processing_action)
- : delete_directive_handler_(delete_directive_handler),
- delete_directives_(delete_directive),
- post_processing_action_(post_processing_action) {}
+ : delete_directive_handler_(delete_directive_handler),
+ delete_directives_(delete_directive),
+ post_processing_action_(post_processing_action) {}
// Implements HistoryDBTask.
bool RunOnDBThread(history::HistoryBackend* backend,
@@ -181,27 +181,29 @@ void DeleteDirectiveHandler::DeleteDirectiveTask::DoneRunOnMainThread() {
}
}
-void
-DeleteDirectiveHandler::DeleteDirectiveTask::ProcessGlobalIdDeleteDirectives(
- history::HistoryBackend* history_backend,
- const syncer::SyncDataList& global_id_directives) {
+void DeleteDirectiveHandler::DeleteDirectiveTask::
+ ProcessGlobalIdDeleteDirectives(
+ history::HistoryBackend* history_backend,
+ const syncer::SyncDataList& global_id_directives) {
if (global_id_directives.empty())
return;
// Group times represented by global IDs by time ranges of delete directives.
// It's more efficient for backend to process all directives with same time
// range at once.
- typedef std::map<std::pair<base::Time, base::Time>, std::set<base::Time> >
+ typedef std::map<std::pair<base::Time, base::Time>, std::set<base::Time>>
GlobalIdTimesGroup;
GlobalIdTimesGroup id_times_group;
for (size_t i = 0; i < global_id_directives.size(); ++i) {
DVLOG(1) << "Processing delete directive: "
- << DeleteDirectiveToString(
- global_id_directives[i].GetSpecifics()
- .history_delete_directive());
+ << DeleteDirectiveToString(global_id_directives[i]
+ .GetSpecifics()
+ .history_delete_directive());
const sync_pb::GlobalIdDirective& id_directive =
- global_id_directives[i].GetSpecifics().history_delete_directive()
+ global_id_directives[i]
+ .GetSpecifics()
+ .history_delete_directive()
.global_id_directive();
if (id_directive.global_id_size() == 0 ||
!id_directive.has_start_time_usec() ||
@@ -209,11 +211,10 @@ DeleteDirectiveHandler::DeleteDirectiveTask::ProcessGlobalIdDeleteDirectives(
DLOG(ERROR) << "Invalid global id directive.";
continue;
}
- GetTimesFromGlobalIds(
- id_directive,
- &id_times_group[
- std::make_pair(UnixUsecToTime(id_directive.start_time_usec()),
- UnixUsecToTime(id_directive.end_time_usec()))]);
+ GetTimesFromGlobalIds(id_directive,
+ &id_times_group[std::make_pair(
+ UnixUsecToTime(id_directive.start_time_usec()),
+ UnixUsecToTime(id_directive.end_time_usec()))]);
}
if (id_times_group.empty())
@@ -221,20 +222,19 @@ DeleteDirectiveHandler::DeleteDirectiveTask::ProcessGlobalIdDeleteDirectives(
// Call backend to expire history of directives in each group.
for (GlobalIdTimesGroup::const_iterator group_it = id_times_group.begin();
- group_it != id_times_group.end(); ++group_it) {
+ group_it != id_times_group.end(); ++group_it) {
// Add 1us to cover history entries visited at the end time because time
// range in directive is inclusive.
history_backend->ExpireHistoryForTimes(
- group_it->second,
- group_it->first.first,
+ group_it->second, group_it->first.first,
group_it->first.second + base::TimeDelta::FromMicroseconds(1));
}
}
-void
-DeleteDirectiveHandler::DeleteDirectiveTask::ProcessTimeRangeDeleteDirectives(
- history::HistoryBackend* history_backend,
- const syncer::SyncDataList& time_range_directives) {
+void DeleteDirectiveHandler::DeleteDirectiveTask::
+ ProcessTimeRangeDeleteDirectives(
+ history::HistoryBackend* history_backend,
+ const syncer::SyncDataList& time_range_directives) {
if (time_range_directives.empty())
return;
@@ -283,8 +283,8 @@ DeleteDirectiveHandler::DeleteDirectiveTask::ProcessTimeRangeDeleteDirectives(
}
}
-DeleteDirectiveHandler::DeleteDirectiveHandler()
- : weak_ptr_factory_(this) {}
+DeleteDirectiveHandler::DeleteDirectiveHandler() : weak_ptr_factory_(this) {
+}
DeleteDirectiveHandler::~DeleteDirectiveHandler() {
weak_ptr_factory_.InvalidateWeakPtrs();
@@ -301,8 +301,7 @@ void DeleteDirectiveHandler::Start(
history_service->ScheduleDBTask(
scoped_ptr<history::HistoryDBTask>(
new DeleteDirectiveTask(weak_ptr_factory_.GetWeakPtr(),
- initial_sync_data,
- DROP_AFTER_PROCESSING)),
+ initial_sync_data, DROP_AFTER_PROCESSING)),
&internal_tracker_);
}
}
@@ -352,11 +351,9 @@ syncer::SyncError DeleteDirectiveHandler::ProcessLocalDeleteDirective(
const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive) {
DCHECK(thread_checker_.CalledOnValidThread());
if (!sync_processor_) {
- return syncer::SyncError(
- FROM_HERE,
- syncer::SyncError::DATATYPE_ERROR,
- "Cannot send local delete directive to sync",
- syncer::HISTORY_DELETE_DIRECTIVES);
+ return syncer::SyncError(FROM_HERE, syncer::SyncError::DATATYPE_ERROR,
+ "Cannot send local delete directive to sync",
+ syncer::HISTORY_DELETE_DIRECTIVES);
}
#if !defined(NDEBUG)
CheckDeleteDirectiveValid(delete_directive);
@@ -369,10 +366,9 @@ syncer::SyncError DeleteDirectiveHandler::ProcessLocalDeleteDirective(
entity_specifics.mutable_history_delete_directive()->CopyFrom(
delete_directive);
syncer::SyncData sync_data =
- syncer::SyncData::CreateLocalData(
- sync_tag, sync_tag, entity_specifics);
- syncer::SyncChange change(
- FROM_HERE, syncer::SyncChange::ACTION_ADD, sync_data);
+ syncer::SyncData::CreateLocalData(sync_tag, sync_tag, entity_specifics);
+ syncer::SyncChange change(FROM_HERE, syncer::SyncChange::ACTION_ADD,
+ sync_data);
syncer::SyncChangeList changes(1, change);
return sync_processor_->ProcessSyncChanges(FROM_HERE, changes);
}
@@ -382,11 +378,9 @@ syncer::SyncError DeleteDirectiveHandler::ProcessSyncChanges(
const syncer::SyncChangeList& change_list) {
DCHECK(thread_checker_.CalledOnValidThread());
if (!sync_processor_) {
- return syncer::SyncError(
- FROM_HERE,
- syncer::SyncError::DATATYPE_ERROR,
- "Sync is disabled.",
- syncer::HISTORY_DELETE_DIRECTIVES);
+ return syncer::SyncError(FROM_HERE, syncer::SyncError::DATATYPE_ERROR,
+ "Sync is disabled.",
+ syncer::HISTORY_DELETE_DIRECTIVES);
}
syncer::SyncDataList delete_directives;
@@ -412,8 +406,7 @@ syncer::SyncError DeleteDirectiveHandler::ProcessSyncChanges(
history_service->ScheduleDBTask(
scoped_ptr<history::HistoryDBTask>(
new DeleteDirectiveTask(weak_ptr_factory_.GetWeakPtr(),
- delete_directives,
- KEEP_AFTER_PROCESSING)),
+ delete_directives, KEEP_AFTER_PROCESSING)),
&internal_tracker_);
}
return syncer::SyncError();
@@ -430,9 +423,8 @@ void DeleteDirectiveHandler::FinishProcessing(
post_processing_action == DROP_AFTER_PROCESSING) {
syncer::SyncChangeList change_list;
for (size_t i = 0; i < delete_directives.size(); ++i) {
- change_list.push_back(
- syncer::SyncChange(FROM_HERE, syncer::SyncChange::ACTION_DELETE,
- delete_directives[i]));
+ change_list.push_back(syncer::SyncChange(
+ FROM_HERE, syncer::SyncChange::ACTION_DELETE, delete_directives[i]));
}
sync_processor_->ProcessSyncChanges(FROM_HERE, change_list);
}
diff --git a/chrome/browser/history/delete_directive_handler.h b/components/history/core/browser/delete_directive_handler.h
index 31ed47e..24a5cc8 100644
--- a/chrome/browser/history/delete_directive_handler.h
+++ b/components/history/core/browser/delete_directive_handler.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_HISTORY_DELETE_DIRECTIVE_HANDLER_H_
-#define CHROME_BROWSER_HISTORY_DELETE_DIRECTIVE_HANDLER_H_
+#ifndef COMPONENTS_HISTORY_CORE_BROWSER_DELETE_DIRECTIVE_HANDLER_H_
+#define COMPONENTS_HISTORY_CORE_BROWSER_DELETE_DIRECTIVE_HANDLER_H_
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -37,10 +37,9 @@ class DeleteDirectiveHandler {
// Create delete directives for the deletion of visits identified by
// |global_ids| (which may be empty), in the time range specified by
// |begin_time| and |end_time|.
- bool CreateDeleteDirectives(
- const std::set<int64>& global_ids,
- base::Time begin_time,
- base::Time end_time);
+ bool CreateDeleteDirectives(const std::set<int64>& global_ids,
+ base::Time begin_time,
+ base::Time end_time);
// Sends the given |delete_directive| to SyncChangeProcessor (if it exists).
// Returns any error resulting from sending the delete directive to sync.
@@ -61,10 +60,7 @@ class DeleteDirectiveHandler {
friend class DeleteDirectiveTask;
// Action to take on processed delete directives.
- enum PostProcessingAction {
- KEEP_AFTER_PROCESSING,
- DROP_AFTER_PROCESSING
- };
+ enum PostProcessingAction { KEEP_AFTER_PROCESSING, DROP_AFTER_PROCESSING };
// Callback when history backend finishes deleting visits according to
// |delete_directives|.
@@ -81,4 +77,4 @@ class DeleteDirectiveHandler {
} // namespace history
-#endif // CHROME_BROWSER_HISTORY_DELETE_DIRECTIVE_HANDLER_H_
+#endif // COMPONENTS_HISTORY_CORE_BROWSER_DELETE_DIRECTIVE_HANDLER_H_
diff --git a/chrome/browser/history/history_backend.cc b/components/history/core/browser/history_backend.cc
index f8b5e67..14b74d1 100644
--- a/chrome/browser/history/history_backend.cc
+++ b/components/history/core/browser/history_backend.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/history/history_backend.h"
+#include "components/history/core/browser/history_backend.h"
#include <algorithm>
#include <functional>
@@ -23,8 +23,6 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
-#include "chrome/browser/history/in_memory_history_backend.h"
-#include "chrome/browser/history/typed_url_syncable_service.h"
#include "components/favicon_base/select_favicon_frames.h"
#include "components/history/core/browser/download_constants.h"
#include "components/history/core/browser/download_row.h"
@@ -34,8 +32,10 @@
#include "components/history/core/browser/history_database.h"
#include "components/history/core/browser/history_database_params.h"
#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/in_memory_history_backend.h"
#include "components/history/core/browser/keyword_search_term.h"
#include "components/history/core/browser/page_usage_data.h"
+#include "components/history/core/browser/typed_url_syncable_service.h"
#include "components/history/core/browser/visit_filter.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "sql/error_delegate_util.h"
@@ -123,8 +123,7 @@ MostVisitedURL MakeMostVisitedURL(const PageUsageData& page_data,
class CommitLaterTask : public base::RefCounted<CommitLaterTask> {
public:
explicit CommitLaterTask(HistoryBackend* history_backend)
- : history_backend_(history_backend) {
- }
+ : history_backend_(history_backend) {}
// The backend will call this function if it is being destroyed so that we
// release our reference.
@@ -143,7 +142,6 @@ class CommitLaterTask : public base::RefCounted<CommitLaterTask> {
scoped_refptr<HistoryBackend> history_backend_;
};
-
QueuedHistoryDBTask::QueuedHistoryDBTask(
scoped_ptr<HistoryDBTask> task,
scoped_refptr<base::SingleThreadTaskRunner> origin_loop,
@@ -156,10 +154,9 @@ QueuedHistoryDBTask::QueuedHistoryDBTask(
QueuedHistoryDBTask::~QueuedHistoryDBTask() {
// Ensure that |task_| is destroyed on its origin thread.
- origin_loop_->PostTask(
- FROM_HERE,
- base::Bind(&base::DeletePointer<HistoryDBTask>,
- base::Unretained(task_.release())));
+ origin_loop_->PostTask(FROM_HERE,
+ base::Bind(&base::DeletePointer<HistoryDBTask>,
+ base::Unretained(task_.release())));
}
bool QueuedHistoryDBTask::is_canceled() {
@@ -172,11 +169,10 @@ bool QueuedHistoryDBTask::Run(HistoryBackend* backend, HistoryDatabase* db) {
void QueuedHistoryDBTask::DoneRun() {
origin_loop_->PostTask(
- FROM_HERE,
- base::Bind(&RunUnlessCanceled,
- base::Bind(&HistoryDBTask::DoneRunOnMainThread,
- base::Unretained(task_.get())),
- is_canceled_));
+ FROM_HERE, base::Bind(&RunUnlessCanceled,
+ base::Bind(&HistoryDBTask::DoneRunOnMainThread,
+ base::Unretained(task_.get())),
+ is_canceled_));
}
// HistoryBackendHelper --------------------------------------------------------
@@ -304,12 +300,11 @@ SegmentID HistoryBackend::GetLastSegmentID(VisitID from_visit) {
return 0;
}
-SegmentID HistoryBackend::UpdateSegments(
- const GURL& url,
- VisitID from_visit,
- VisitID visit_id,
- ui::PageTransition transition_type,
- const Time ts) {
+SegmentID HistoryBackend::UpdateSegments(const GURL& url,
+ VisitID from_visit,
+ VisitID visit_id,
+ ui::PageTransition transition_type,
+ const Time ts) {
if (!db_)
return 0;
@@ -318,8 +313,7 @@ SegmentID HistoryBackend::UpdateSegments(
return 0;
SegmentID segment_id = 0;
- ui::PageTransition t =
- ui::PageTransitionStripQualifier(transition_type);
+ ui::PageTransition t = ui::PageTransitionStripQualifier(transition_type);
// Are we at the beginning of a new segment?
// Note that navigating to an existing entry (with back/forward) reuses the
@@ -397,8 +391,9 @@ void HistoryBackend::UpdateVisitDuration(VisitID visit_id, const Time end_ts) {
VisitRow visit_row;
if (db_->GetRowForVisit(visit_id, &visit_row)) {
// We should never have a negative duration time even when time is skewed.
- visit_row.visit_duration = end_ts > visit_row.visit_time ?
- end_ts - visit_row.visit_time : TimeDelta::FromMicroseconds(0);
+ visit_row.visit_duration = end_ts > visit_row.visit_time
+ ? end_ts - visit_row.visit_time
+ : TimeDelta::FromMicroseconds(0);
db_->UpdateVisitRow(visit_row);
}
}
@@ -408,15 +403,15 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
return;
// Will be filled with the URL ID and the visit ID of the last addition.
- std::pair<URLID, VisitID> last_ids(0, tracker_.GetLastVisit(
- request.context_id, request.nav_entry_id, request.referrer));
+ std::pair<URLID, VisitID> last_ids(
+ 0, tracker_.GetLastVisit(request.context_id, request.nav_entry_id,
+ request.referrer));
VisitID from_visit_id = last_ids.second;
// If a redirect chain is given, we expect the last item in that chain to be
// the final URL.
- DCHECK(request.redirects.empty() ||
- request.redirects.back() == request.url);
+ DCHECK(request.redirects.empty() || request.redirects.back() == request.url);
// If the user is adding older history, we need to make sure our times
// are correct.
@@ -425,7 +420,7 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
ui::PageTransition request_transition = request.transition;
ui::PageTransition stripped_transition =
- ui::PageTransitionStripQualifier(request_transition);
+ ui::PageTransitionStripQualifier(request_transition);
bool is_keyword_generated =
(stripped_transition == ui::PAGE_TRANSITION_KEYWORD_GENERATED);
@@ -436,8 +431,7 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
if (ui::PageTransitionIsMainFrame(request_transition) &&
(stripped_transition != ui::PAGE_TRANSITION_TYPED) &&
!is_keyword_generated) {
- const GURL& origin_url(has_redirects ?
- request.redirects[0] : request.url);
+ const GURL& origin_url(has_redirects ? request.redirects[0] : request.url);
if (origin_url.SchemeIs(url::kHttpScheme) ||
origin_url.SchemeIs(url::kHttpsScheme) ||
origin_url.SchemeIs(url::kFtpScheme)) {
@@ -449,10 +443,9 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
if (registry_length == 0 && !db_->IsTypedHost(host)) {
stripped_transition = ui::PAGE_TRANSITION_TYPED;
- request_transition =
- ui::PageTransitionFromInt(
- stripped_transition |
- ui::PageTransitionGetQualifier(request_transition));
+ request_transition = ui::PageTransitionFromInt(
+ stripped_transition |
+ ui::PageTransitionGetQualifier(request_transition));
}
}
}
@@ -460,13 +453,12 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
if (!has_redirects) {
// The single entry is both a chain start and end.
ui::PageTransition t = ui::PageTransitionFromInt(
- request_transition |
- ui::PAGE_TRANSITION_CHAIN_START |
+ request_transition | ui::PAGE_TRANSITION_CHAIN_START |
ui::PAGE_TRANSITION_CHAIN_END);
// No redirect case (one element means just the page itself).
- last_ids = AddPageVisit(request.url, request.time,
- last_ids.second, t, request.visit_source);
+ last_ids = AddPageVisit(request.url, request.time, last_ids.second, t,
+ request.visit_source);
// Update the segment for this visit. KEYWORD_GENERATED visits should not
// result in changing most visited, so we don't update segments (most
@@ -481,8 +473,7 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
} else {
// Redirect case. Add the redirect chain.
- ui::PageTransition redirect_info =
- ui::PAGE_TRANSITION_CHAIN_START;
+ ui::PageTransition redirect_info = ui::PAGE_TRANSITION_CHAIN_START;
RedirectList redirects = request.redirects;
if (redirects[0].SchemeIs(url::kAboutScheme)) {
@@ -533,20 +524,18 @@ void HistoryBackend::AddPage(const HistoryAddPageArgs& request) {
// If this is the last transition, add a CHAIN_END marker
if (redirect_index == (redirects.size() - 1)) {
- t = ui::PageTransitionFromInt(
- t | ui::PAGE_TRANSITION_CHAIN_END);
+ t = ui::PageTransitionFromInt(t | ui::PAGE_TRANSITION_CHAIN_END);
}
// Record all redirect visits with the same timestamp. We don't display
// them anyway, and if we ever decide to, we can reconstruct their order
// from the redirect chain.
- last_ids = AddPageVisit(redirects[redirect_index],
- request.time, last_ids.second,
- t, request.visit_source);
+ last_ids = AddPageVisit(redirects[redirect_index], request.time,
+ last_ids.second, t, request.visit_source);
if (t & ui::PAGE_TRANSITION_CHAIN_START) {
// Update the segment for this visit.
- UpdateSegments(redirects[redirect_index],
- from_visit_id, last_ids.second, t, request.time);
+ UpdateSegments(redirects[redirect_index], from_visit_id,
+ last_ids.second, t, request.time);
// Update the visit_details for this visit.
UpdateVisitDuration(from_visit_id, request.time);
@@ -605,9 +594,8 @@ void HistoryBackend::InitImpl(
history_database_params.download_interrupt_reason_crash));
// Unretained to avoid a ref loop with db_.
- db_->set_error_callback(
- base::Bind(&HistoryBackend::DatabaseErrorCallback,
- base::Unretained(this)));
+ db_->set_error_callback(base::Bind(&HistoryBackend::DatabaseErrorCallback,
+ base::Unretained(this)));
sql::InitStatus status = db_->Init(history_name);
switch (status) {
@@ -693,7 +681,8 @@ void HistoryBackend::InitImpl(
void HistoryBackend::OnMemoryPressure(
base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) {
- bool trim_aggressively = memory_pressure_level ==
+ bool trim_aggressively =
+ memory_pressure_level ==
base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL;
if (db_)
db_->TrimMemory(trim_aggressively);
@@ -732,7 +721,7 @@ std::pair<URLID, VisitID> HistoryBackend::AddPageVisit(
ui::PageTransition transition_type =
ui::PageTransitionStripQualifier(transition);
if ((transition_type == ui::PAGE_TRANSITION_TYPED &&
- !ui::PageTransitionIsRedirect(transition)) ||
+ !ui::PageTransitionIsRedirect(transition)) ||
transition_type == ui::PAGE_TRANSITION_KEYWORD_GENERATED)
typed_increment = 1;
@@ -822,11 +811,12 @@ void HistoryBackend::AddPagesWithDetails(const URLRows& urls,
// Sync code manages the visits itself.
if (visit_source != SOURCE_SYNCED) {
// Make up a visit to correspond to the last visit to the page.
- VisitRow visit_info(url_id, i->last_visit(), 0,
- ui::PageTransitionFromInt(
- ui::PAGE_TRANSITION_LINK |
- ui::PAGE_TRANSITION_CHAIN_START |
- ui::PAGE_TRANSITION_CHAIN_END), 0);
+ VisitRow visit_info(
+ url_id, i->last_visit(), 0,
+ ui::PageTransitionFromInt(ui::PAGE_TRANSITION_LINK |
+ ui::PAGE_TRANSITION_CHAIN_START |
+ ui::PAGE_TRANSITION_CHAIN_END),
+ 0);
if (!db_->AddVisit(&visit_info, visit_source)) {
NOTREACHED() << "Adding visit failed.";
return;
@@ -967,8 +957,8 @@ bool HistoryBackend::AddVisits(const GURL& url,
if (db_) {
for (std::vector<VisitInfo>::const_iterator visit = visits.begin();
visit != visits.end(); ++visit) {
- if (!AddPageVisit(
- url, visit->first, 0, visit->second, visit_source).first) {
+ if (!AddPageVisit(url, visit->first, 0, visit->second, visit_source)
+ .first) {
return false;
}
}
@@ -1126,8 +1116,8 @@ void HistoryBackend::RemoveDownloads(const std::set<uint32>& ids) {
base::TimeTicks started_removing = base::TimeTicks::Now();
// HistoryBackend uses a long-running Transaction that is committed
// periodically, so this loop doesn't actually hit the disk too hard.
- for (std::set<uint32>::const_iterator it = ids.begin();
- it != ids.end(); ++it) {
+ for (std::set<uint32>::const_iterator it = ids.begin(); it != ids.end();
+ ++it) {
db_->RemoveDownload(*it);
}
ScheduleCommit();
@@ -1139,7 +1129,7 @@ void HistoryBackend::RemoveDownloads(const std::set<uint32>& ids) {
return;
size_t num_downloads_deleted = downloads_count_before - downloads_count_after;
UMA_HISTOGRAM_COUNTS("Download.DatabaseRemoveDownloadsCount",
- num_downloads_deleted);
+ num_downloads_deleted);
base::TimeDelta micros = (1000 * (finished_removing - started_removing));
UMA_HISTOGRAM_TIMES("Download.DatabaseRemoveDownloadsTime", micros);
if (num_downloads_deleted > 0) {
@@ -1150,7 +1140,7 @@ void HistoryBackend::RemoveDownloads(const std::set<uint32>& ids) {
if (ids.size() < num_downloads_deleted)
return;
UMA_HISTOGRAM_COUNTS("Download.DatabaseRemoveDownloadsCountNotRemoved",
- ids.size() - num_downloads_deleted);
+ ids.size() - num_downloads_deleted);
}
void HistoryBackend::QueryHistory(const base::string16& text_query,
@@ -1186,15 +1176,13 @@ void HistoryBackend::QueryHistoryBasic(const QueryOptions& options,
// Add a result row for this visit, get the URL info from the DB.
if (!db_->GetURLRow(visit.url_id, &url_result)) {
- DVLOG(0) << "Failed to get id " << visit.url_id
- << " from history.urls.";
+ DVLOG(0) << "Failed to get id " << visit.url_id << " from history.urls.";
continue; // DB out of sync and URL doesn't exist, try to recover.
}
if (!url_result.url().is_valid()) {
- DVLOG(0) << "Got invalid URL from history.urls with id "
- << visit.url_id << ": "
- << url_result.url().possibly_invalid_spec();
+ DVLOG(0) << "Got invalid URL from history.urls with id " << visit.url_id
+ << ": " << url_result.url().possibly_invalid_spec();
continue; // Don't report invalid URLs in case of corruption.
}
@@ -1222,7 +1210,7 @@ void HistoryBackend::QueryHistoryText(const base::string16& text_query,
db_->GetTextMatches(text_query, &text_matches);
std::vector<URLResult> matching_visits;
- VisitVector visits; // Declare outside loop to prevent re-construction.
+ VisitVector visits; // Declare outside loop to prevent re-construction.
for (size_t i = 0; i < text_matches.size(); i++) {
const URLRow& text_match = text_matches[i];
// Get all visits for given URL match.
@@ -1237,8 +1225,9 @@ void HistoryBackend::QueryHistoryText(const base::string16& text_query,
std::sort(matching_visits.begin(), matching_visits.end(),
URLResult::CompareVisitTime);
- size_t max_results = options.max_count == 0 ?
- std::numeric_limits<size_t>::max() : static_cast<int>(options.max_count);
+ size_t max_results = options.max_count == 0
+ ? std::numeric_limits<size_t>::max()
+ : static_cast<int>(options.max_count);
for (std::vector<URLResult>::iterator it = matching_visits.begin();
it != matching_visits.end() && result->size() < max_results; ++it) {
result->AppendURLBySwapping(&(*it));
@@ -1282,8 +1271,8 @@ void HistoryBackend::GetVisibleVisitCountToHost(
VisibleVisitCountToHostResult* result) {
result->count = 0;
result->success = db_.get() &&
- db_->GetVisibleVisitCountToHost(
- url, &result->count, &result->first_visit);
+ db_->GetVisibleVisitCountToHost(url, &result->count,
+ &result->first_visit);
}
void HistoryBackend::QueryMostVisitedURLs(int result_count,
@@ -1294,8 +1283,7 @@ void HistoryBackend::QueryMostVisitedURLs(int result_count,
ScopedVector<PageUsageData> data;
db_->QuerySegmentUsage(
- base::Time::Now() - base::TimeDelta::FromDays(days_back),
- result_count,
+ base::Time::Now() - base::TimeDelta::FromDays(days_back), result_count,
&data.get());
for (size_t i = 0; i < data.size(); ++i) {
@@ -1375,17 +1363,19 @@ void HistoryBackend::QueryFilteredURLs(int result_count,
result->push_back(url);
}
- int delta_time = std::max(1, std::min(999,
- static_cast<int>((base::Time::Now() - request_start).InMilliseconds())));
+ int delta_time = std::max(
+ 1, std::min(999, static_cast<int>((base::Time::Now() - request_start)
+ .InMilliseconds())));
STATIC_HISTOGRAM_POINTER_BLOCK(
- "NewTabPage.SuggestedSitesLoadTime",
- Add(delta_time),
- base::LinearHistogram::FactoryGet("NewTabPage.SuggestedSitesLoadTime",
- 1, 1000, 100, base::Histogram::kUmaTargetedHistogramFlag));
+ "NewTabPage.SuggestedSitesLoadTime", Add(delta_time),
+ base::LinearHistogram::FactoryGet(
+ "NewTabPage.SuggestedSitesLoadTime", 1, 1000, 100,
+ base::Histogram::kUmaTargetedHistogramFlag));
}
void HistoryBackend::GetRedirectsFromSpecificVisit(
- VisitID cur_visit, history::RedirectList* redirects) {
+ VisitID cur_visit,
+ history::RedirectList* redirects) {
// Follow any redirects from the given visit and add them to the list.
// It *should* be impossible to get a circular chain here, but we check
// just in case to avoid infinite loops.
@@ -1432,10 +1422,9 @@ void HistoryBackend::ScheduleAutocomplete(const base::Callback<
void HistoryBackend::DeleteFTSIndexDatabases() {
// Find files on disk matching the text databases file pattern so we can
// quickly test for and delete them.
- base::FilePath::StringType filepattern =
- FILE_PATH_LITERAL("History Index *");
- base::FileEnumerator enumerator(
- history_dir_, false, base::FileEnumerator::FILES, filepattern);
+ base::FilePath::StringType filepattern = FILE_PATH_LITERAL("History Index *");
+ base::FileEnumerator enumerator(history_dir_, false,
+ base::FileEnumerator::FILES, filepattern);
int num_databases_deleted = 0;
base::FilePath current_file;
while (!(current_file = enumerator.Next()).empty()) {
@@ -1489,7 +1478,8 @@ void HistoryBackend::GetLargestFaviconForURL(
thumbnail_db_->GetFaviconBitmapIDSizes(i->icon_id, &bitmap_id_sizes);
FaviconBitmap& largest = largest_favicon_bitmaps[i->icon_type];
for (std::vector<FaviconBitmapIDSize>::const_iterator j =
- bitmap_id_sizes.begin(); j != bitmap_id_sizes.end(); ++j) {
+ bitmap_id_sizes.begin();
+ j != bitmap_id_sizes.end(); ++j) {
if (largest.bitmap_id == 0 ||
(largest.pixel_size.width() < j->pixel_size.width() &&
largest.pixel_size.height() < j->pixel_size.height())) {
@@ -1509,8 +1499,7 @@ void HistoryBackend::GetLargestFaviconForURL(
t != icon_types.end(); ++t) {
for (std::map<favicon_base::IconType, FaviconBitmap>::const_iterator f =
largest_favicon_bitmaps.begin();
- f != largest_favicon_bitmaps.end();
- ++f) {
+ f != largest_favicon_bitmaps.end(); ++f) {
if (f->first & *t &&
(largest_icon.bitmap_id == 0 ||
(largest_icon.pixel_size.height() < f->second.pixel_size.height() &&
@@ -1534,15 +1523,14 @@ void HistoryBackend::GetLargestFaviconForURL(
favicon_base::FaviconRawBitmapResult bitmap_result;
bitmap_result.icon_url = icon_url;
bitmap_result.icon_type = icon_type;
- if (!thumbnail_db_->GetFaviconBitmap(largest_icon.bitmap_id,
- &last_updated,
+ if (!thumbnail_db_->GetFaviconBitmap(largest_icon.bitmap_id, &last_updated,
&bitmap_result.bitmap_data,
&bitmap_result.pixel_size)) {
return;
}
- bitmap_result.expired = (Time::Now() - last_updated) >
- TimeDelta::FromDays(kFaviconRefetchDays);
+ bitmap_result.expired =
+ (Time::Now() - last_updated) > TimeDelta::FromDays(kFaviconRefetchDays);
if (bitmap_result.is_valid())
*favicon_bitmap_result = bitmap_result;
@@ -1569,8 +1557,7 @@ void HistoryBackend::GetFaviconForID(
desired_sizes.push_back(desired_size);
// Get results from DB.
- GetFaviconBitmapResultsForBestMatch(favicon_ids,
- desired_sizes,
+ GetFaviconBitmapResultsForBestMatch(favicon_ids, desired_sizes,
bitmap_results);
}
@@ -1616,7 +1603,7 @@ void HistoryBackend::MergeFavicon(
bitmap_identical = true;
} else {
thumbnail_db_->SetFaviconBitmap(bitmap_id_sizes[i].bitmap_id,
- bitmap_data, base::Time::Now());
+ bitmap_data, base::Time::Now());
replaced_bitmap = true;
}
break;
@@ -1693,15 +1680,16 @@ void HistoryBackend::MergeFavicon(
// a favicon bitmap mapped to |icon_url|. The one there is more correct
// and having multiple equally sized favicon bitmaps for |page_url| is
// ambiguous in terms of GetFaviconsForURL().
- std::vector<gfx::Size>::iterator it = std::find(favicon_sizes.begin(),
- favicon_sizes.end(), bitmaps_to_copy[j].pixel_size);
+ std::vector<gfx::Size>::iterator it =
+ std::find(favicon_sizes.begin(), favicon_sizes.end(),
+ bitmaps_to_copy[j].pixel_size);
if (it != favicon_sizes.end())
continue;
// Add the favicon bitmap as expired as it is not consistent with the
// merged in data.
- thumbnail_db_->AddFaviconBitmap(favicon_id,
- bitmaps_to_copy[j].bitmap_data, base::Time(),
+ thumbnail_db_->AddFaviconBitmap(
+ favicon_id, bitmaps_to_copy[j].bitmap_data, base::Time(),
bitmaps_to_copy[j].pixel_size);
favicon_sizes.push_back(bitmaps_to_copy[j].pixel_size);
@@ -1750,7 +1738,7 @@ void HistoryBackend::SetFavicons(const GURL& page_url,
std::vector<favicon_base::FaviconID> icon_ids(1u, icon_id);
data_modified |=
- SetFaviconMappingsForPageAndRedirects(page_url, icon_type, icon_ids);
+ SetFaviconMappingsForPageAndRedirects(page_url, icon_type, icon_ids);
if (data_modified) {
// Send notification to the UI as an icon mapping, favicon, or favicon
@@ -1764,8 +1752,7 @@ void HistoryBackend::SetFaviconsOutOfDateForPage(const GURL& page_url) {
std::vector<IconMapping> icon_mappings;
if (!thumbnail_db_ ||
- !thumbnail_db_->GetIconMappingsForPageURL(page_url,
- &icon_mappings))
+ !thumbnail_db_->GetIconMappingsForPageURL(page_url, &icon_mappings))
return;
for (std::vector<IconMapping>::iterator m = icon_mappings.begin();
@@ -1806,10 +1793,8 @@ void HistoryBackend::SetImportedFavicons(
// This favicon doesn't exist yet, so we create it using the given data.
// TODO(pkotwicz): Pass in real pixel size.
favicon_id = thumbnail_db_->AddFavicon(
- favicon_usage[i].favicon_url,
- favicon_base::FAVICON,
- new base::RefCountedBytes(favicon_usage[i].png_data),
- now,
+ favicon_usage[i].favicon_url, favicon_base::FAVICON,
+ new base::RefCountedBytes(favicon_usage[i].png_data), now,
gfx::Size());
}
@@ -1881,8 +1866,8 @@ void HistoryBackend::UpdateFaviconMappingsAndFetchImpl(
const GURL& icon_url = icon_urls[i];
favicon_base::IconType icon_type_out;
const favicon_base::FaviconID favicon_id =
- thumbnail_db_->GetFaviconIDForFaviconURL(
- icon_url, icon_types, &icon_type_out);
+ thumbnail_db_->GetFaviconIDForFaviconURL(icon_url, icon_types,
+ &icon_type_out);
if (favicon_id) {
// Return and update icon mappings only for the largest icon type. As
@@ -1898,9 +1883,8 @@ void HistoryBackend::UpdateFaviconMappingsAndFetchImpl(
}
if (page_url && !favicon_ids.empty()) {
- bool mappings_updated =
- SetFaviconMappingsForPageAndRedirects(*page_url, selected_icon_type,
- favicon_ids);
+ bool mappings_updated = SetFaviconMappingsForPageAndRedirects(
+ *page_url, selected_icon_type, favicon_ids);
if (mappings_updated) {
SendFaviconChangedNotificationForPageAndRedirects(*page_url);
ScheduleCommit();
@@ -1908,7 +1892,7 @@ void HistoryBackend::UpdateFaviconMappingsAndFetchImpl(
}
GetFaviconBitmapResultsForBestMatch(favicon_ids, desired_sizes,
- bitmap_results);
+ bitmap_results);
}
bool HistoryBackend::SetFaviconBitmaps(favicon_base::FaviconID icon_id,
@@ -1920,10 +1904,9 @@ bool HistoryBackend::SetFaviconBitmaps(favicon_base::FaviconID icon_id,
PNGEncodedBitmap;
std::vector<PNGEncodedBitmap> to_add;
for (size_t i = 0; i < bitmaps.size(); ++i) {
- scoped_refptr<base::RefCountedBytes> bitmap_data(
- new base::RefCountedBytes);
- if (!gfx::PNGCodec::EncodeBGRASkBitmap(
- bitmaps[i], false, &bitmap_data->data())) {
+ scoped_refptr<base::RefCountedBytes> bitmap_data(new base::RefCountedBytes);
+ if (!gfx::PNGCodec::EncodeBGRASkBitmap(bitmaps[i], false,
+ &bitmap_data->data())) {
continue;
}
to_add.push_back(std::make_pair(
@@ -1935,8 +1918,7 @@ bool HistoryBackend::SetFaviconBitmaps(favicon_base::FaviconID icon_id,
const gfx::Size& pixel_size = bitmap_id_sizes[i].pixel_size;
std::vector<PNGEncodedBitmap>::iterator match_it = to_add.end();
for (std::vector<PNGEncodedBitmap>::iterator it = to_add.begin();
- it != to_add.end();
- ++it) {
+ it != to_add.end(); ++it) {
if (it->second == pixel_size) {
match_it = it;
break;
@@ -1951,11 +1933,11 @@ bool HistoryBackend::SetFaviconBitmaps(favicon_base::FaviconID icon_id,
} else {
if (!favicon_bitmaps_changed &&
IsFaviconBitmapDataEqual(bitmap_id, match_it->first)) {
- thumbnail_db_->SetFaviconBitmapLastUpdateTime(
- bitmap_id, base::Time::Now());
+ thumbnail_db_->SetFaviconBitmapLastUpdateTime(bitmap_id,
+ base::Time::Now());
} else {
thumbnail_db_->SetFaviconBitmap(bitmap_id, match_it->first,
- base::Time::Now());
+ base::Time::Now());
favicon_bitmaps_changed = true;
}
to_add.erase(match_it);
@@ -1963,8 +1945,8 @@ bool HistoryBackend::SetFaviconBitmaps(favicon_base::FaviconID icon_id,
}
for (size_t i = 0; i < to_add.size(); ++i) {
- thumbnail_db_->AddFaviconBitmap(icon_id, to_add[i].first,
- base::Time::Now(), to_add[i].second);
+ thumbnail_db_->AddFaviconBitmap(icon_id, to_add[i].first, base::Time::Now(),
+ to_add[i].second);
favicon_bitmaps_changed = true;
}
@@ -2006,8 +1988,8 @@ bool HistoryBackend::GetFaviconsFromDB(
favicon_ids.push_back(icon_mappings[i].icon_id);
// Populate |favicon_bitmap_results| and |icon_url_sizes|.
- bool success = GetFaviconBitmapResultsForBestMatch(favicon_ids,
- desired_sizes, favicon_bitmap_results);
+ bool success = GetFaviconBitmapResultsForBestMatch(favicon_ids, desired_sizes,
+ favicon_bitmap_results);
UMA_HISTOGRAM_TIMES("History.GetFavIconFromDB", // historical name
TimeTicks::Now() - beginning_time);
return success && !favicon_bitmap_results->empty();
@@ -2041,18 +2023,14 @@ bool HistoryBackend::GetFaviconBitmapResultsForBestMatch(
std::vector<size_t> candidate_bitmap_indices;
float score = 0;
- SelectFaviconFrameIndices(sizes,
- desired_sizes,
- &candidate_bitmap_indices,
+ SelectFaviconFrameIndices(sizes, desired_sizes, &candidate_bitmap_indices,
&score);
if (score > highest_score) {
highest_score = score;
- best_favicon_id = candidate_favicon_ids[i],
- best_bitmap_ids.clear();
+ best_favicon_id = candidate_favicon_ids[i], best_bitmap_ids.clear();
for (size_t j = 0; j < candidate_bitmap_indices.size(); ++j) {
size_t candidate_index = candidate_bitmap_indices[j];
- best_bitmap_ids.push_back(
- bitmap_id_sizes[candidate_index].bitmap_id);
+ best_bitmap_ids.push_back(bitmap_id_sizes[candidate_index].bitmap_id);
}
}
}
@@ -2071,15 +2049,14 @@ bool HistoryBackend::GetFaviconBitmapResultsForBestMatch(
favicon_base::FaviconRawBitmapResult bitmap_result;
bitmap_result.icon_url = icon_url;
bitmap_result.icon_type = icon_type;
- if (!thumbnail_db_->GetFaviconBitmap(best_bitmap_ids[i],
- &last_updated,
+ if (!thumbnail_db_->GetFaviconBitmap(best_bitmap_ids[i], &last_updated,
&bitmap_result.bitmap_data,
&bitmap_result.pixel_size)) {
return false;
}
- bitmap_result.expired = (Time::Now() - last_updated) >
- TimeDelta::FromDays(kFaviconRefetchDays);
+ bitmap_result.expired =
+ (Time::Now() - last_updated) > TimeDelta::FromDays(kFaviconRefetchDays);
if (bitmap_result.is_valid())
favicon_bitmap_results->push_back(bitmap_result);
}
@@ -2209,8 +2186,8 @@ void HistoryBackend::Commit() {
if (thumbnail_db_) {
thumbnail_db_->CommitTransaction();
- DCHECK(thumbnail_db_->transaction_nesting() == 0) <<
- "Somebody left a transaction open";
+ DCHECK(thumbnail_db_->transaction_nesting() == 0)
+ << "Somebody left a transaction open";
thumbnail_db_->BeginTransaction();
}
}
@@ -2292,10 +2269,9 @@ void HistoryBackend::DeleteURL(const GURL& url) {
Commit();
}
-void HistoryBackend::ExpireHistoryBetween(
- const std::set<GURL>& restrict_urls,
- Time begin_time,
- Time end_time) {
+void HistoryBackend::ExpireHistoryBetween(const std::set<GURL>& restrict_urls,
+ Time begin_time,
+ Time end_time) {
if (!db_)
return;
@@ -2317,18 +2293,18 @@ void HistoryBackend::ExpireHistoryBetween(
db_->GetStartDate(&first_recorded_time_);
}
-void HistoryBackend::ExpireHistoryForTimes(
- const std::set<base::Time>& times,
- base::Time begin_time, base::Time end_time) {
+void HistoryBackend::ExpireHistoryForTimes(const std::set<base::Time>& times,
+ base::Time begin_time,
+ base::Time end_time) {
if (times.empty() || !db_)
return;
DCHECK(*times.begin() >= begin_time)
- << "Min time is before begin time: "
- << times.begin()->ToJsTime() << " v.s. " << begin_time.ToJsTime();
+ << "Min time is before begin time: " << times.begin()->ToJsTime()
+ << " v.s. " << begin_time.ToJsTime();
DCHECK(*times.rbegin() < end_time)
- << "Max time is after end time: "
- << times.rbegin()->ToJsTime() << " v.s. " << end_time.ToJsTime();
+ << "Max time is after end time: " << times.rbegin()->ToJsTime()
+ << " v.s. " << end_time.ToJsTime();
history::QueryOptions options;
options.begin_time = begin_time;
@@ -2378,7 +2354,8 @@ void HistoryBackend::ExpireHistory(
bool update_first_recorded_time = false;
for (std::vector<history::ExpireHistoryArgs>::const_iterator it =
- expire_list.begin(); it != expire_list.end(); ++it) {
+ expire_list.begin();
+ it != expire_list.end(); ++it) {
expirer_.ExpireHistoryBetween(it->urls, it->begin_time, it->end_time);
if (it->begin_time < first_recorded_time_)
@@ -2417,8 +2394,7 @@ void HistoryBackend::DatabaseErrorCallback(int error, sql::Statement* stmt) {
// TODO(shess): Consider changing KillHistoryDatabase() to use
// RazeAndClose(). Then it can be cleared immediately.
base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&HistoryBackend::KillHistoryDatabase, this));
+ FROM_HERE, base::Bind(&HistoryBackend::KillHistoryDatabase, this));
}
}
@@ -2482,8 +2458,7 @@ void HistoryBackend::NotifyURLVisited(ui::PageTransition transition,
typed_url_syncable_service_->OnUrlVisited(transition, &url_info);
FOR_EACH_OBSERVER(
- HistoryBackendObserver,
- observers_,
+ HistoryBackendObserver, observers_,
OnURLVisited(this, transition, url_info, redirects, visit_time));
// TODO(sdefresne): turn HistoryBackend::Delegate from HistoryService into
@@ -2498,8 +2473,8 @@ void HistoryBackend::NotifyURLsModified(const URLRows& rows) {
if (typed_url_syncable_service_.get())
typed_url_syncable_service_->OnUrlsModified(&changed_urls);
- FOR_EACH_OBSERVER(
- HistoryBackendObserver, observers_, OnURLsModified(this, changed_urls));
+ FOR_EACH_OBSERVER(HistoryBackendObserver, observers_,
+ OnURLsModified(this, changed_urls));
// TODO(sdefresne): turn HistoryBackend::Delegate from HistoryService into
// an HistoryBackendObserver and register it so that we can remove this
@@ -2601,8 +2576,8 @@ bool HistoryBackend::ClearAllThumbnailHistory(const URLRows& kept_urls) {
// Urls to retain mappings for.
std::vector<GURL> urls_to_keep;
- for (URLRows::const_iterator i = kept_urls.begin();
- i != kept_urls.end(); ++i) {
+ for (URLRows::const_iterator i = kept_urls.begin(); i != kept_urls.end();
+ ++i) {
urls_to_keep.push_back(i->url());
}
diff --git a/chrome/browser/history/history_backend.h b/components/history/core/browser/history_backend.h
index c75f9be..ecef76f 100644
--- a/chrome/browser/history/history_backend.h
+++ b/components/history/core/browser/history_backend.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_
-#define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_
+#ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_
+#define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_
#include <set>
#include <string>
@@ -371,10 +371,9 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
virtual void DeleteURL(const GURL& url);
// Calls ExpireHistoryBackend::ExpireHistoryBetween and commits the change.
- void ExpireHistoryBetween(
- const std::set<GURL>& restrict_urls,
- base::Time begin_time,
- base::Time end_time);
+ void ExpireHistoryBetween(const std::set<GURL>& restrict_urls,
+ base::Time begin_time,
+ base::Time end_time);
// Finds the URLs visited at |times| and expires all their visits within
// [|begin_time|, |end_time|). All times in |times| should be in
@@ -382,7 +381,8 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
// server side, i.e. web history deletes, where only visit times (possibly
// incomplete) are transmitted to protect user's privacy.
void ExpireHistoryForTimes(const std::set<base::Time>& times,
- base::Time begin_time, base::Time end_time);
+ base::Time begin_time,
+ base::Time end_time);
// Calls ExpireHistoryBetween() once for each element in the vector.
// The fields of |ExpireHistoryArgs| map directly to the arguments of
@@ -441,9 +441,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
// code to avoid syncing visits that would immediately be expired).
virtual bool IsExpiredVisitTime(const base::Time& time);
- base::Time GetFirstRecordedTimeForTest() {
- return first_recorded_time_;
- }
+ base::Time GetFirstRecordedTimeForTest() { return first_recorded_time_; }
protected:
~HistoryBackend() override;
@@ -548,13 +546,13 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
// Returns a redirect chain in |redirects| for the VisitID
// |cur_visit|. |cur_visit| is assumed to be valid. Assumes that
// this HistoryBackend object has been Init()ed successfully.
- void GetRedirectsFromSpecificVisit(
- VisitID cur_visit, history::RedirectList* redirects);
+ void GetRedirectsFromSpecificVisit(VisitID cur_visit,
+ history::RedirectList* redirects);
// Similar to the above function except returns a redirect list ending
// at |cur_visit|.
- void GetRedirectsToSpecificVisit(
- VisitID cur_visit, history::RedirectList* redirects);
+ void GetRedirectsToSpecificVisit(VisitID cur_visit,
+ history::RedirectList* redirects);
// Update the visit_duration information in visits table.
void UpdateVisitDuration(VisitID visit_id, const base::Time end_ts);
@@ -648,12 +646,11 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
// TOUCH_ICON, and FAVICON. See the comment for
// GetFaviconResultsForBestMatch() for more details on how
// |favicon_bitmap_results| is constructed.
- bool GetFaviconsFromDB(
- const GURL& page_url,
- int icon_types,
- const std::vector<int>& desired_sizes,
- std::vector<favicon_base::FaviconRawBitmapResult>*
- favicon_bitmap_results);
+ bool GetFaviconsFromDB(const GURL& page_url,
+ int icon_types,
+ const std::vector<int>& desired_sizes,
+ std::vector<favicon_base::FaviconRawBitmapResult>*
+ favicon_bitmap_results);
// Returns the favicon bitmaps whose edge sizes most closely match
// |desired_sizes| in |favicon_bitmap_results|. If |desired_sizes| has a '0'
@@ -693,8 +690,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
// Send notification that the favicon has changed for |page_url| and all its
// redirects.
- void SendFaviconChangedNotificationForPageAndRedirects(
- const GURL& page_url);
+ void SendFaviconChangedNotificationForPageAndRedirects(const GURL& page_url);
// Generic stuff -------------------------------------------------------------
@@ -828,4 +824,4 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>,
} // namespace history
-#endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_
+#endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_H_
diff --git a/chrome/browser/history/history_service.cc b/components/history/core/browser/history_service.cc
index d40f418..41cfbc6 100644
--- a/chrome/browser/history/history_service.cc
+++ b/components/history/core/browser/history_service.cc
@@ -16,7 +16,7 @@
// -> SQLite connection to Thumbnails
// (and favicons)
-#include "chrome/browser/history/history_service.h"
+#include "components/history/core/browser/history_service.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
@@ -28,15 +28,15 @@
#include "base/thread_task_runner_handle.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
-#include "chrome/browser/history/history_backend.h"
-#include "chrome/browser/history/in_memory_history_backend.h"
#include "components/history/core/browser/download_row.h"
+#include "components/history/core/browser/history_backend.h"
#include "components/history/core/browser/history_client.h"
#include "components/history/core/browser/history_database_params.h"
#include "components/history/core/browser/history_db_task.h"
#include "components/history/core/browser/history_service_observer.h"
#include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/in_memory_database.h"
+#include "components/history/core/browser/in_memory_history_backend.h"
#include "components/history/core/browser/keyword_search_term.h"
#include "components/history/core/browser/visit_database.h"
#include "components/history/core/browser/visit_delegate.h"
@@ -102,18 +102,16 @@ class HistoryService::BackendDelegate : public HistoryBackend::Delegate {
void NotifyProfileError(sql::InitStatus init_status) override {
// Send to the history service on the main thread.
service_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&HistoryService::NotifyProfileError, history_service_,
- init_status));
+ FROM_HERE, base::Bind(&HistoryService::NotifyProfileError,
+ history_service_, init_status));
}
void SetInMemoryBackend(
scoped_ptr<history::InMemoryHistoryBackend> backend) override {
// Send the backend to the history service on the main thread.
service_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&HistoryService::SetInMemoryBackend, history_service_,
- base::Passed(&backend)));
+ FROM_HERE, base::Bind(&HistoryService::SetInMemoryBackend,
+ history_service_, base::Passed(&backend)));
}
void NotifyAddVisit(const history::BriefVisitInfo& info) override {
@@ -125,22 +123,18 @@ class HistoryService::BackendDelegate : public HistoryBackend::Delegate {
void NotifyFaviconChanged(const std::set<GURL>& urls) override {
// Send the notification to the history service on the main thread.
service_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(
- &HistoryService::NotifyFaviconChanged, history_service_, urls));
+ FROM_HERE, base::Bind(&HistoryService::NotifyFaviconChanged,
+ history_service_, urls));
}
void NotifyURLVisited(ui::PageTransition transition,
const history::URLRow& row,
const history::RedirectList& redirects,
base::Time visit_time) override {
- service_task_runner_->PostTask(FROM_HERE,
- base::Bind(&HistoryService::NotifyURLVisited,
- history_service_,
- transition,
- row,
- redirects,
- visit_time));
+ service_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&HistoryService::NotifyURLVisited, history_service_,
+ transition, row, redirects, visit_time));
}
void NotifyURLsModified(const history::URLRows& changed_urls) override {
@@ -175,8 +169,7 @@ class HistoryService::BackendDelegate : public HistoryBackend::Delegate {
void DBLoaded() override {
service_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&HistoryService::OnDBLoaded, history_service_));
+ FROM_HERE, base::Bind(&HistoryService::OnDBLoaded, history_service_));
}
private:
@@ -336,12 +329,9 @@ base::CancelableTaskTracker::TaskId HistoryService::ScheduleDBTask(
// the current message loop so that we can forward the call to the method
// HistoryDBTask::DoneRunOnMainThread() in the correct thread.
thread_->message_loop_proxy()->PostTask(
- FROM_HERE,
- base::Bind(&HistoryBackend::ProcessDBTask,
- history_backend_.get(),
- base::Passed(&task),
- base::ThreadTaskRunnerHandle::Get(),
- is_canceled));
+ FROM_HERE, base::Bind(&HistoryBackend::ProcessDBTask,
+ history_backend_.get(), base::Passed(&task),
+ base::ThreadTaskRunnerHandle::Get(), is_canceled));
return task_id;
}
@@ -369,21 +359,18 @@ void HistoryService::AddPage(const GURL& url,
history::VisitSource visit_source,
bool did_replace_entry) {
DCHECK(thread_checker_.CalledOnValidThread());
- AddPage(
- history::HistoryAddPageArgs(url, time, context_id, nav_entry_id, referrer,
- redirects, transition, visit_source,
- did_replace_entry));
+ AddPage(history::HistoryAddPageArgs(url, time, context_id, nav_entry_id,
+ referrer, redirects, transition,
+ visit_source, did_replace_entry));
}
void HistoryService::AddPage(const GURL& url,
base::Time time,
history::VisitSource visit_source) {
DCHECK(thread_checker_.CalledOnValidThread());
- AddPage(
- history::HistoryAddPageArgs(url, time, nullptr, 0, GURL(),
- history::RedirectList(),
- ui::PAGE_TRANSITION_LINK,
- visit_source, false));
+ AddPage(history::HistoryAddPageArgs(
+ url, time, nullptr, 0, GURL(), history::RedirectList(),
+ ui::PAGE_TRANSITION_LINK, visit_source, false));
}
void HistoryService::AddPage(const history::HistoryAddPageArgs& add_page_args) {
@@ -510,14 +497,9 @@ base::CancelableTaskTracker::TaskId HistoryService::GetFavicons(
std::vector<favicon_base::FaviconRawBitmapResult>* results =
new std::vector<favicon_base::FaviconRawBitmapResult>();
return tracker->PostTaskAndReply(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
- base::Bind(&HistoryBackend::GetFavicons,
- history_backend_.get(),
- icon_urls,
- icon_types,
- desired_sizes,
- results),
+ thread_->message_loop_proxy().get(), FROM_HERE,
+ base::Bind(&HistoryBackend::GetFavicons, history_backend_.get(),
+ icon_urls, icon_types, desired_sizes, results),
base::Bind(&RunWithFaviconResults, callback, base::Owned(results)));
}
@@ -532,14 +514,9 @@ base::CancelableTaskTracker::TaskId HistoryService::GetFaviconsForURL(
std::vector<favicon_base::FaviconRawBitmapResult>* results =
new std::vector<favicon_base::FaviconRawBitmapResult>();
return tracker->PostTaskAndReply(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
- base::Bind(&HistoryBackend::GetFaviconsForURL,
- history_backend_.get(),
- page_url,
- icon_types,
- desired_sizes,
- results),
+ thread_->message_loop_proxy().get(), FROM_HERE,
+ base::Bind(&HistoryBackend::GetFaviconsForURL, history_backend_.get(),
+ page_url, icon_types, desired_sizes, results),
base::Bind(&RunWithFaviconResults, callback, base::Owned(results)));
}
@@ -554,14 +531,10 @@ base::CancelableTaskTracker::TaskId HistoryService::GetLargestFaviconForURL(
favicon_base::FaviconRawBitmapResult* result =
new favicon_base::FaviconRawBitmapResult();
return tracker->PostTaskAndReply(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
+ thread_->message_loop_proxy().get(), FROM_HERE,
base::Bind(&HistoryBackend::GetLargestFaviconForURL,
- history_backend_.get(),
- page_url,
- icon_types,
- minimum_size_in_pixels,
- result),
+ history_backend_.get(), page_url, icon_types,
+ minimum_size_in_pixels, result),
base::Bind(&RunWithFaviconResult, callback, base::Owned(result)));
}
@@ -575,13 +548,9 @@ base::CancelableTaskTracker::TaskId HistoryService::GetFaviconForID(
std::vector<favicon_base::FaviconRawBitmapResult>* results =
new std::vector<favicon_base::FaviconRawBitmapResult>();
return tracker->PostTaskAndReply(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
- base::Bind(&HistoryBackend::GetFaviconForID,
- history_backend_.get(),
- favicon_id,
- desired_size,
- results),
+ thread_->message_loop_proxy().get(), FROM_HERE,
+ base::Bind(&HistoryBackend::GetFaviconForID, history_backend_.get(),
+ favicon_id, desired_size, results),
base::Bind(&RunWithFaviconResults, callback, base::Owned(results)));
}
@@ -598,15 +567,10 @@ HistoryService::UpdateFaviconMappingsAndFetch(
std::vector<favicon_base::FaviconRawBitmapResult>* results =
new std::vector<favicon_base::FaviconRawBitmapResult>();
return tracker->PostTaskAndReply(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
+ thread_->message_loop_proxy().get(), FROM_HERE,
base::Bind(&HistoryBackend::UpdateFaviconMappingsAndFetch,
- history_backend_.get(),
- page_url,
- icon_urls,
- icon_types,
- desired_sizes,
- results),
+ history_backend_.get(), page_url, icon_urls, icon_types,
+ desired_sizes, results),
base::Bind(&RunWithFaviconResults, callback, base::Owned(results)));
}
@@ -627,11 +591,10 @@ void HistoryService::MergeFavicon(
page_url, icon_url, icon_type, bitmap_data, pixel_size));
}
-void HistoryService::SetFavicons(
- const GURL& page_url,
- favicon_base::IconType icon_type,
- const GURL& icon_url,
- const std::vector<SkBitmap>& bitmaps) {
+void HistoryService::SetFavicons(const GURL& page_url,
+ favicon_base::IconType icon_type,
+ const GURL& icon_url,
+ const std::vector<SkBitmap>& bitmaps) {
DCHECK(thread_) << "History service being called after cleanup";
DCHECK(thread_checker_.CalledOnValidThread());
if (history_client_ && !history_client_->CanAddURL(page_url))
@@ -677,15 +640,11 @@ base::CancelableTaskTracker::TaskId HistoryService::QueryURL(
DCHECK(thread_checker_.CalledOnValidThread());
history::QueryURLResult* query_url_result = new history::QueryURLResult();
return tracker->PostTaskAndReply(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
- base::Bind(&HistoryBackend::QueryURL,
- history_backend_.get(),
- url,
- want_visits,
- base::Unretained(query_url_result)),
- base::Bind(
- &RunWithQueryURLResult, callback, base::Owned(query_url_result)));
+ thread_->message_loop_proxy().get(), FROM_HERE,
+ base::Bind(&HistoryBackend::QueryURL, history_backend_.get(), url,
+ want_visits, base::Unretained(query_url_result)),
+ base::Bind(&RunWithQueryURLResult, callback,
+ base::Owned(query_url_result)));
}
// Downloads -------------------------------------------------------------------
@@ -697,32 +656,28 @@ void HistoryService::CreateDownload(
const HistoryService::DownloadCreateCallback& callback) {
DCHECK(thread_) << "History service being called after cleanup";
DCHECK(thread_checker_.CalledOnValidThread());
- PostTaskAndReplyWithResult(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
- base::Bind(
- &HistoryBackend::CreateDownload, history_backend_.get(), create_info),
- callback);
+ PostTaskAndReplyWithResult(thread_->message_loop_proxy().get(), FROM_HERE,
+ base::Bind(&HistoryBackend::CreateDownload,
+ history_backend_.get(), create_info),
+ callback);
}
void HistoryService::GetNextDownloadId(const DownloadIdCallback& callback) {
DCHECK(thread_) << "History service being called after cleanup";
DCHECK(thread_checker_.CalledOnValidThread());
PostTaskAndReplyWithResult(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
+ thread_->message_loop_proxy().get(), FROM_HERE,
base::Bind(&HistoryBackend::GetNextDownloadId, history_backend_.get()),
callback);
}
// Handle queries for a list of all downloads in the history database's
// 'downloads' table.
-void HistoryService::QueryDownloads(
- const DownloadQueryCallback& callback) {
+void HistoryService::QueryDownloads(const DownloadQueryCallback& callback) {
DCHECK(thread_) << "History service being called after cleanup";
DCHECK(thread_checker_.CalledOnValidThread());
std::vector<history::DownloadRow>* rows =
- new std::vector<history::DownloadRow>();
+ new std::vector<history::DownloadRow>();
scoped_ptr<std::vector<history::DownloadRow>> scoped_rows(rows);
// Beware! The first Bind() does not simply |scoped_rows.get()| because
// base::Passed(&scoped_rows) nullifies |scoped_rows|, and compilers do not
@@ -759,13 +714,9 @@ base::CancelableTaskTracker::TaskId HistoryService::QueryHistory(
DCHECK(thread_checker_.CalledOnValidThread());
history::QueryResults* query_results = new history::QueryResults();
return tracker->PostTaskAndReply(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
- base::Bind(&HistoryBackend::QueryHistory,
- history_backend_.get(),
- text_query,
- options,
- base::Unretained(query_results)),
+ thread_->message_loop_proxy().get(), FROM_HERE,
+ base::Bind(&HistoryBackend::QueryHistory, history_backend_.get(),
+ text_query, options, base::Unretained(query_results)),
base::Bind(callback, base::Owned(query_results)));
}
@@ -777,12 +728,9 @@ base::CancelableTaskTracker::TaskId HistoryService::QueryRedirectsFrom(
DCHECK(thread_checker_.CalledOnValidThread());
history::RedirectList* result = new history::RedirectList();
return tracker->PostTaskAndReply(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
- base::Bind(&HistoryBackend::QueryRedirectsFrom,
- history_backend_.get(),
- from_url,
- base::Unretained(result)),
+ thread_->message_loop_proxy().get(), FROM_HERE,
+ base::Bind(&HistoryBackend::QueryRedirectsFrom, history_backend_.get(),
+ from_url, base::Unretained(result)),
base::Bind(callback, base::Owned(result)));
}
@@ -793,13 +741,11 @@ base::CancelableTaskTracker::TaskId HistoryService::QueryRedirectsTo(
DCHECK(thread_) << "History service being called after cleanup";
DCHECK(thread_checker_.CalledOnValidThread());
history::RedirectList* result = new history::RedirectList();
- return tracker->PostTaskAndReply(thread_->message_loop_proxy().get(),
- FROM_HERE,
- base::Bind(&HistoryBackend::QueryRedirectsTo,
- history_backend_.get(),
- to_url,
- base::Unretained(result)),
- base::Bind(callback, base::Owned(result)));
+ return tracker->PostTaskAndReply(
+ thread_->message_loop_proxy().get(), FROM_HERE,
+ base::Bind(&HistoryBackend::QueryRedirectsTo, history_backend_.get(),
+ to_url, base::Unretained(result)),
+ base::Bind(callback, base::Owned(result)));
}
base::CancelableTaskTracker::TaskId HistoryService::GetVisibleVisitCountToHost(
@@ -811,14 +757,10 @@ base::CancelableTaskTracker::TaskId HistoryService::GetVisibleVisitCountToHost(
history::VisibleVisitCountToHostResult* result =
new history::VisibleVisitCountToHostResult();
return tracker->PostTaskAndReply(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
+ thread_->message_loop_proxy().get(), FROM_HERE,
base::Bind(&HistoryBackend::GetVisibleVisitCountToHost,
- history_backend_.get(),
- url,
- base::Unretained(result)),
- base::Bind(&RunWithVisibleVisitCountToHostResult,
- callback,
+ history_backend_.get(), url, base::Unretained(result)),
+ base::Bind(&RunWithVisibleVisitCountToHostResult, callback,
base::Owned(result)));
}
@@ -831,13 +773,9 @@ base::CancelableTaskTracker::TaskId HistoryService::QueryMostVisitedURLs(
DCHECK(thread_checker_.CalledOnValidThread());
history::MostVisitedURLList* result = new history::MostVisitedURLList();
return tracker->PostTaskAndReply(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
- base::Bind(&HistoryBackend::QueryMostVisitedURLs,
- history_backend_.get(),
- result_count,
- days_back,
- base::Unretained(result)),
+ thread_->message_loop_proxy().get(), FROM_HERE,
+ base::Bind(&HistoryBackend::QueryMostVisitedURLs, history_backend_.get(),
+ result_count, days_back, base::Unretained(result)),
base::Bind(callback, base::Owned(result)));
}
@@ -851,14 +789,9 @@ base::CancelableTaskTracker::TaskId HistoryService::QueryFilteredURLs(
DCHECK(thread_checker_.CalledOnValidThread());
history::FilteredURLList* result = new history::FilteredURLList();
return tracker->PostTaskAndReply(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
- base::Bind(&HistoryBackend::QueryFilteredURLs,
- history_backend_.get(),
- result_count,
- filter,
- extended_info,
- base::Unretained(result)),
+ thread_->message_loop_proxy().get(), FROM_HERE,
+ base::Bind(&HistoryBackend::QueryFilteredURLs, history_backend_.get(),
+ result_count, filter, extended_info, base::Unretained(result)),
base::Bind(callback, base::Owned(result)));
}
@@ -1048,14 +981,11 @@ void HistoryService::ExpireHistoryBetween(
base::CancelableTaskTracker* tracker) {
DCHECK(thread_) << "History service being called after cleanup";
DCHECK(thread_checker_.CalledOnValidThread());
- tracker->PostTaskAndReply(thread_->message_loop_proxy().get(),
- FROM_HERE,
- base::Bind(&HistoryBackend::ExpireHistoryBetween,
- history_backend_,
- restrict_urls,
- begin_time,
- end_time),
- callback);
+ tracker->PostTaskAndReply(
+ thread_->message_loop_proxy().get(), FROM_HERE,
+ base::Bind(&HistoryBackend::ExpireHistoryBetween, history_backend_,
+ restrict_urls, begin_time, end_time),
+ callback);
}
void HistoryService::ExpireHistory(
@@ -1065,8 +995,7 @@ void HistoryService::ExpireHistory(
DCHECK(thread_) << "History service being called after cleanup";
DCHECK(thread_checker_.CalledOnValidThread());
tracker->PostTaskAndReply(
- thread_->message_loop_proxy().get(),
- FROM_HERE,
+ thread_->message_loop_proxy().get(), FROM_HERE,
base::Bind(&HistoryBackend::ExpireHistory, history_backend_, expire_list),
callback);
}
@@ -1084,17 +1013,16 @@ void HistoryService::ExpireLocalAndRemoteHistoryBetween(
// TODO(dubroy): This API does not yet support deletion of specific URLs.
DCHECK(restrict_urls.empty());
- delete_directive_handler_.CreateDeleteDirectives(
- std::set<int64>(), begin_time, end_time);
+ delete_directive_handler_.CreateDeleteDirectives(std::set<int64>(),
+ begin_time, end_time);
// Attempt online deletion from the history server, but ignore the result.
// Deletion directives ensure that the results will eventually be deleted.
//
// TODO(davidben): |callback| should not run until this operation completes
// too.
- web_history->ExpireHistoryBetween(
- restrict_urls, begin_time, end_time,
- base::Bind(&ExpireWebHistoryComplete));
+ web_history->ExpireHistoryBetween(restrict_urls, begin_time, end_time,
+ base::Bind(&ExpireWebHistoryComplete));
}
ExpireHistoryBetween(restrict_urls, begin_time, end_time, callback, tracker);
}
@@ -1113,8 +1041,8 @@ bool HistoryService::GetRowForURL(const GURL& url, history::URLRow* url_row) {
void HistoryService::NotifyAddVisit(const history::BriefVisitInfo& info) {
DCHECK(thread_checker_.CalledOnValidThread());
- FOR_EACH_OBSERVER(
- history::HistoryServiceObserver, observers_, OnAddVisit(this, info));
+ FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_,
+ OnAddVisit(this, info));
}
void HistoryService::NotifyURLVisited(ui::PageTransition transition,
@@ -1122,15 +1050,13 @@ void HistoryService::NotifyURLVisited(ui::PageTransition transition,
const history::RedirectList& redirects,
base::Time visit_time) {
DCHECK(thread_checker_.CalledOnValidThread());
- FOR_EACH_OBSERVER(history::HistoryServiceObserver,
- observers_,
+ FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_,
OnURLVisited(this, transition, row, redirects, visit_time));
}
void HistoryService::NotifyURLsModified(const history::URLRows& changed_urls) {
DCHECK(thread_checker_.CalledOnValidThread());
- FOR_EACH_OBSERVER(history::HistoryServiceObserver,
- observers_,
+ FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_,
OnURLsModified(this, changed_urls));
}
diff --git a/chrome/browser/history/history_service.h b/components/history/core/browser/history_service.h
index b00a05a..dda6ef8 100644
--- a/chrome/browser/history/history_service.h
+++ b/components/history/core/browser/history_service.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_
-#define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_
+#ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_
+#define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_
#include <set>
#include <string>
@@ -23,11 +23,11 @@
#include "base/task/cancelable_task_tracker.h"
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
-#include "chrome/browser/history/delete_directive_handler.h"
-#include "chrome/browser/history/typed_url_syncable_service.h"
#include "components/favicon_base/favicon_callback.h"
#include "components/favicon_base/favicon_usage_data.h"
+#include "components/history/core/browser/delete_directive_handler.h"
#include "components/history/core/browser/keyword_id.h"
+#include "components/history/core/browser/typed_url_syncable_service.h"
#include "components/keyed_service/core/keyed_service.h"
#include "sql/init_status.h"
#include "sync/api/syncable_service.h"
@@ -203,10 +203,10 @@ class HistoryService : public syncer::SyncableService, public KeyedService {
// empty.
//
// If success is false, neither the row nor the vector will be valid.
- typedef base::Callback<
- void(bool, // Success flag, when false, nothing else is valid.
- const history::URLRow&,
- const history::VisitVector&)> QueryURLCallback;
+ typedef base::Callback<void(
+ bool, // Success flag, when false, nothing else is valid.
+ const history::URLRow&,
+ const history::VisitVector&)> QueryURLCallback;
// Queries the basic information about the URL in the history database. If
// the caller is interested in the visits (each time the URL is visited),
@@ -264,11 +264,11 @@ class HistoryService : public syncer::SyncableService, public KeyedService {
// Requests the number of user-visible visits (i.e. no redirects or subframes)
// to all urls on the same scheme/host/port as |url|. This is only valid for
// HTTP and HTTPS URLs.
- typedef base::Callback<
- void(bool, // Were we able to determine the # of visits?
- int, // Number of visits.
- base::Time)> // Time of first visit. Only set if bool
- // is true and int is > 0.
+ typedef base::Callback<void(
+ bool, // Were we able to determine the # of visits?
+ int, // Number of visits.
+ base::Time)> // Time of first visit. Only set if bool
+ // is true and int is > 0.
GetVisibleVisitCountToHostCallback;
base::CancelableTaskTracker::TaskId GetVisibleVisitCountToHost(
@@ -362,9 +362,8 @@ class HistoryService : public syncer::SyncableService, public KeyedService {
// contains all the download's creation state, and 'callback' runs when the
// history service request is complete. The callback is called on the thread
// that calls CreateDownload().
- void CreateDownload(
- const history::DownloadRow& info,
- const DownloadCreateCallback& callback);
+ void CreateDownload(const history::DownloadRow& info,
+ const DownloadCreateCallback& callback);
// Implemented by the caller of 'GetNextDownloadId' below, and is called with
// the maximum id of all downloads records in the database plus 1.
@@ -439,7 +438,7 @@ class HistoryService : public syncer::SyncableService, public KeyedService {
// returned Subscription is destroyed. This must occurs before HistoryService
// is destroyed.
scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription>
- AddFaviconChangedCallback(const OnFaviconChangedCallback& callback)
+ AddFaviconChangedCallback(const OnFaviconChangedCallback& callback)
WARN_UNUSED_RESULT;
// Testing -------------------------------------------------------------------
@@ -517,7 +516,8 @@ class HistoryService : public syncer::SyncableService, public KeyedService {
friend class HistoryURLProvider;
friend class HistoryURLProviderTest;
friend class ::InMemoryURLIndexTest;
- template<typename Info, typename Callback> friend class DownloadRequest;
+ template <typename Info, typename Callback>
+ friend class DownloadRequest;
friend class PageUsageRequest;
friend class RedirectRequest;
friend class SyncBookmarkDataTypeControllerTest;
@@ -809,4 +809,4 @@ class HistoryService : public syncer::SyncableService, public KeyedService {
DISALLOW_COPY_AND_ASSIGN(HistoryService);
};
-#endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_
+#endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_SERVICE_H_
diff --git a/chrome/browser/history/in_memory_history_backend.cc b/components/history/core/browser/in_memory_history_backend.cc
index 27a3b88..ab540e6 100644
--- a/chrome/browser/history/in_memory_history_backend.cc
+++ b/components/history/core/browser/in_memory_history_backend.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/history/in_memory_history_backend.h"
+#include "components/history/core/browser/in_memory_history_backend.h"
#include <set>
#include <vector>
@@ -10,7 +10,7 @@
#include "base/command_line.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
-#include "chrome/browser/history/history_service.h"
+#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/in_memory_database.h"
#include "components/history/core/browser/url_database.h"
diff --git a/chrome/browser/history/in_memory_history_backend.h b/components/history/core/browser/in_memory_history_backend.h
index 4b76c71..51ad318 100644
--- a/chrome/browser/history/in_memory_history_backend.h
+++ b/components/history/core/browser/in_memory_history_backend.h
@@ -17,8 +17,8 @@
// main thread where operations can be completed synchronously. It listens for
// notifications from the "regular" history backend and keeps itself in sync.
-#ifndef CHROME_BROWSER_HISTORY_IN_MEMORY_HISTORY_BACKEND_H_
-#define CHROME_BROWSER_HISTORY_IN_MEMORY_HISTORY_BACKEND_H_
+#ifndef COMPONENTS_HISTORY_CORE_BROWSER_IN_MEMORY_HISTORY_BACKEND_H_
+#define COMPONENTS_HISTORY_CORE_BROWSER_IN_MEMORY_HISTORY_BACKEND_H_
#include <string>
@@ -61,9 +61,7 @@ class InMemoryHistoryBackend : public HistoryServiceObserver {
// Returns the underlying database associated with this backend. The current
// autocomplete code was written fro this, but it should probably be removed
// so that it can deal directly with this object, rather than the DB.
- InMemoryDatabase* db() const {
- return db_.get();
- }
+ InMemoryDatabase* db() const { return db_.get(); }
private:
FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, DeleteAll);
@@ -104,4 +102,4 @@ class InMemoryHistoryBackend : public HistoryServiceObserver {
} // namespace history
-#endif // CHROME_BROWSER_HISTORY_IN_MEMORY_HISTORY_BACKEND_H_
+#endif // COMPONENTS_HISTORY_CORE_BROWSER_IN_MEMORY_HISTORY_BACKEND_H_
diff --git a/chrome/browser/history/typed_url_syncable_service.cc b/components/history/core/browser/typed_url_syncable_service.cc
index 57719f1..4ce8903 100644
--- a/chrome/browser/history/typed_url_syncable_service.cc
+++ b/components/history/core/browser/typed_url_syncable_service.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/history/typed_url_syncable_service.h"
+#include "components/history/core/browser/typed_url_syncable_service.h"
#include "base/auto_reset.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/history/history_backend.h"
+#include "components/history/core/browser/history_backend.h"
#include "net/base/net_util.h"
#include "sync/protocol/sync.pb.h"
#include "sync/protocol/typed_url_specifics.pb.h"
@@ -118,8 +118,7 @@ syncer::SyncError TypedUrlSyncableService::ProcessSyncChanges(
// TODO(mgist): Add implementation
- return syncer::SyncError(FROM_HERE,
- syncer::SyncError::DATATYPE_ERROR,
+ return syncer::SyncError(FROM_HERE, syncer::SyncError::DATATYPE_ERROR,
"Typed url syncable service is not implemented.",
syncer::TYPED_URLS);
}
@@ -200,21 +199,21 @@ void TypedUrlSyncableService::OnUrlsDeleted(bool all_history,
url != synced_typed_urls_.end(); ++url) {
VisitVector visits;
URLRow row(*url);
- AddTypedUrlToChangeList(syncer::SyncChange::ACTION_DELETE,
- row, visits, url->spec(), &changes);
+ AddTypedUrlToChangeList(syncer::SyncChange::ACTION_DELETE, row, visits,
+ url->spec(), &changes);
}
// Clear cache of server state.
synced_typed_urls_.clear();
} else {
DCHECK(rows);
// Delete rows.
- for (URLRows::const_iterator row = rows->begin();
- row != rows->end(); ++row) {
+ for (URLRows::const_iterator row = rows->begin(); row != rows->end();
+ ++row) {
// Add specifics to change list for all synced urls that were deleted.
if (synced_typed_urls_.find(row->url()) != synced_typed_urls_.end()) {
VisitVector visits;
- AddTypedUrlToChangeList(syncer::SyncChange::ACTION_DELETE,
- *row, visits, row->url().spec(), &changes);
+ AddTypedUrlToChangeList(syncer::SyncChange::ACTION_DELETE, *row, visits,
+ row->url().spec(), &changes);
// Delete typed url from cache.
synced_typed_urls_.erase(row->url());
}
@@ -260,8 +259,7 @@ bool TypedUrlSyncableService::ShouldSyncVisit(
// suggestions. But there are relatively few URLs with > 10 visits, and those
// tend to be more broadly distributed such that there's no need to sync up
// every visit to preserve their relative ordering.
- return (transition == ui::PAGE_TRANSITION_TYPED &&
- typed_count > 0 &&
+ return (transition == ui::PAGE_TRANSITION_TYPED && typed_count > 0 &&
(typed_count < kTypedUrlVisitThrottleThreshold ||
(typed_count % kTypedUrlVisitThrottleMultiple) == 0));
}
@@ -286,10 +284,9 @@ bool TypedUrlSyncableService::CreateOrUpdateSyncNode(
syncer::SyncChange::SyncChangeType change_type;
// If server already has URL, then send a sync update, else add it.
- change_type =
- (synced_typed_urls_.find(url.url()) != synced_typed_urls_.end()) ?
- syncer::SyncChange::ACTION_UPDATE :
- syncer::SyncChange::ACTION_ADD;
+ change_type = (synced_typed_urls_.find(url.url()) != synced_typed_urls_.end())
+ ? syncer::SyncChange::ACTION_UPDATE
+ : syncer::SyncChange::ACTION_ADD;
// Ensure cache of server state is up to date.
synced_typed_urls_.insert(url.url());
@@ -314,17 +311,15 @@ void TypedUrlSyncableService::AddTypedUrlToChangeList(
WriteToTypedUrlSpecifics(row, visits, typed_url);
}
- change_list->push_back(
- syncer::SyncChange(FROM_HERE, change_type,
- syncer::SyncData::CreateLocalData(
- kTypedUrlTag, title, entity_specifics)));
+ change_list->push_back(syncer::SyncChange(
+ FROM_HERE, change_type, syncer::SyncData::CreateLocalData(
+ kTypedUrlTag, title, entity_specifics)));
}
void TypedUrlSyncableService::WriteToTypedUrlSpecifics(
const URLRow& url,
const VisitVector& visits,
sync_pb::TypedUrlSpecifics* typed_url) {
-
DCHECK(!url.last_visit().is_null());
DCHECK(!visits.empty());
DCHECK_EQ(url.last_visit().ToInternalValue(),
@@ -407,13 +402,12 @@ void TypedUrlSyncableService::WriteToTypedUrlSpecifics(
CHECK_EQ(typed_url->visits_size(), typed_url->visit_transitions_size());
}
-bool TypedUrlSyncableService::FixupURLAndGetVisits(
- URLRow* url,
- VisitVector* visits) {
+bool TypedUrlSyncableService::FixupURLAndGetVisits(URLRow* url,
+ VisitVector* visits) {
++num_db_accesses_;
CHECK(history_backend_);
- if (!history_backend_->GetMostRecentVisitsForURL(
- url->id(), kMaxVisitsToFetch, visits)) {
+ if (!history_backend_->GetMostRecentVisitsForURL(url->id(), kMaxVisitsToFetch,
+ visits)) {
++num_db_errors_;
return false;
}
@@ -425,8 +419,8 @@ bool TypedUrlSyncableService::FixupURLAndGetVisits(
// This is a workaround for http://crbug.com/84258.
if (visits->empty()) {
DVLOG(1) << "Found empty visits for URL: " << url->url();
- VisitRow visit(
- url->id(), url->last_visit(), 0, ui::PAGE_TRANSITION_TYPED, 0);
+ VisitRow visit(url->id(), url->last_visit(), 0, ui::PAGE_TRANSITION_TYPED,
+ 0);
visits->push_back(visit);
}
diff --git a/chrome/browser/history/typed_url_syncable_service.h b/components/history/core/browser/typed_url_syncable_service.h
index d7e27c7..15c865e 100644
--- a/chrome/browser/history/typed_url_syncable_service.h
+++ b/components/history/core/browser/typed_url_syncable_service.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_HISTORY_TYPED_URL_SYNCABLE_SERVICE_H_
-#define CHROME_BROWSER_HISTORY_TYPED_URL_SYNCABLE_SERVICE_H_
+#ifndef COMPONENTS_HISTORY_CORE_BROWSER_TYPED_URL_SYNCABLE_SERVICE_H_
+#define COMPONENTS_HISTORY_CORE_BROWSER_TYPED_URL_SYNCABLE_SERVICE_H_
#include <set>
#include <vector>
@@ -64,14 +64,15 @@ class TypedUrlSyncableService : public syncer::SyncableService {
}
private:
- typedef std::vector<std::pair<URLID, URLRow> > TypedUrlUpdateVector;
- typedef std::vector<std::pair<GURL, std::vector<VisitInfo> > >
+ typedef std::vector<std::pair<URLID, URLRow>> TypedUrlUpdateVector;
+ typedef std::vector<std::pair<GURL, std::vector<VisitInfo>>>
TypedUrlVisitVector;
// This is a helper map used only in Merge/Process* functions. The lifetime
// of the iterator is longer than the map object.
- typedef std::map<GURL, std::pair<syncer::SyncChange::SyncChangeType,
- URLRows::iterator> > TypedUrlMap;
+ typedef std::map<GURL,
+ std::pair<syncer::SyncChange::SyncChangeType,
+ URLRows::iterator>> TypedUrlMap;
// This is a helper map used to associate visit vectors from the history db
// to the typed urls in the above map.
typedef std::map<GURL, VisitVector> UrlVisitVectorMap;
@@ -92,12 +93,11 @@ class TypedUrlSyncableService : public syncer::SyncableService {
bool CreateOrUpdateSyncNode(URLRow typed_url,
syncer::SyncChangeList* changes);
- void AddTypedUrlToChangeList(
- syncer::SyncChange::SyncChangeType change_type,
- const URLRow& row,
- const VisitVector& visits,
- std::string title,
- syncer::SyncChangeList* change_list);
+ void AddTypedUrlToChangeList(syncer::SyncChange::SyncChangeType change_type,
+ const URLRow& row,
+ const VisitVector& visits,
+ std::string title,
+ syncer::SyncChangeList* change_list);
// Converts the passed URL information to a TypedUrlSpecifics structure for
// writing to the sync DB.
@@ -112,8 +112,7 @@ class TypedUrlSyncableService : public syncer::SyncableService {
// etc) by modifying the passed |url| object and |visits| vector.
// Returns false if we could not fetch the visits for the passed URL, and
// tracks DB error statistics internally for reporting via UMA.
- virtual bool FixupURLAndGetVisits(URLRow* url,
- VisitVector* visits);
+ virtual bool FixupURLAndGetVisits(URLRow* url, VisitVector* visits);
// TODO(sync): Consider using "delete all" sync logic instead of in-memory
// cache of typed urls. See http://crbug.com/231689.
@@ -159,4 +158,4 @@ class TypedUrlSyncableService : public syncer::SyncableService {
} // namespace history
-#endif // CHROME_BROWSER_HISTORY_TYPED_URL_SYNCABLE_SERVICE_H_
+#endif // COMPONENTS_HISTORY_CORE_BROWSER_TYPED_URL_SYNCABLE_SERVICE_H_
diff --git a/components/search_engines/template_url_service_unittest.cc b/components/search_engines/template_url_service_unittest.cc
index 368496c..0e771ab2 100644
--- a/components/search_engines/template_url_service_unittest.cc
+++ b/components/search_engines/template_url_service_unittest.cc
@@ -18,10 +18,10 @@
#include "base/test/simple_test_clock.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
-#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/search_engines/template_url_service_test_util.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/history/core/browser/history_service.h"
#include "components/search_engines/keyword_web_data_service.h"
#include "components/search_engines/search_host_to_urls_map.h"
#include "components/search_engines/search_terms_data.h"