From 0dc8c5fd25aec13a5d3533f1e643d6ad17f9853e Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Fri, 19 Jun 2020 10:32:00 +0200 Subject: Adapt favicon and history component for WebEngine - Remove component/sync dependency of component/history - Add FaviconHandler::Type() to support toggle touch icons at runtime - Add FaviconHandler::Delegate::OnHandlerCompleted() to notify when icon downloading is done - Make FaviconHandler and FaviconService working when HistoryService is not set due to off-the-record profile Task-number: QTBUG-51184 Change-Id: Ic596f216b270ac4b76f0f37feb6d523d50592aae Reviewed-by: Allan Sandfeld Jensen --- chromium/components/favicon/core/BUILD.gn | 9 ++++++++ .../components/favicon/core/favicon_handler.cc | 25 ++++++++++++++++++++ chromium/components/favicon/core/favicon_handler.h | 8 +++++++ chromium/components/favicon/core/favicon_service.h | 8 +++++++ .../favicon/core/favicon_service_impl.cc | 2 ++ .../components/favicon/core/favicon_service_impl.h | 9 ++++++++ chromium/components/history/core/browser/BUILD.gn | 27 ++++++++++++++++++++++ .../history/core/browser/browsing_history_driver.h | 4 ++++ .../core/browser/browsing_history_service.cc | 4 ++++ .../history/core/browser/history_backend.cc | 14 +++++++++++ .../history/core/browser/history_backend.h | 6 +++++ .../history/core/browser/history_database.cc | 6 +++++ .../history/core/browser/history_database.h | 8 +++++++ .../history/core/browser/history_service.cc | 16 +++++++++++++ .../history/core/browser/history_service.h | 4 ++++ .../history/core/browser/web_history_service.cc | 6 +++++ .../history/core/browser/web_history_service.h | 4 ++++ 17 files changed, 160 insertions(+) (limited to 'chromium') diff --git a/chromium/components/favicon/core/BUILD.gn b/chromium/components/favicon/core/BUILD.gn index e281da5a8aa..755e70f5896 100644 --- a/chromium/components/favicon/core/BUILD.gn +++ b/chromium/components/favicon/core/BUILD.gn @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/features.gni") + static_library("core") { sources = [ "core_favicon_service.cc", @@ -32,6 +34,13 @@ static_library("core") { "large_icon_worker.h", ] + if (use_qt) { + sources += [ + "favicon_service_impl.cc", + "favicon_service_impl.h", + ] + } + deps = [ "//base", "//base:i18n", diff --git a/chromium/components/favicon/core/favicon_handler.cc b/chromium/components/favicon/core/favicon_handler.cc index ddfc129b658..b03e3d150a3 100644 --- a/chromium/components/favicon/core/favicon_handler.cc +++ b/chromium/components/favicon/core/favicon_handler.cc @@ -223,6 +223,13 @@ void FaviconHandler::FetchFavicon(const GURL& page_url, bool is_same_document) { current_candidate_index_ = 0u; best_favicon_ = DownloadedFavicon(); +#if defined(TOOLKIT_QT) + if (delegate_->IsOffTheRecord()) { + OnFaviconDataForInitialURLFromFaviconService(std::vector()); + return; + } +#endif + // Request the favicon from the history service. In parallel to this the // renderer is going to notify us (well WebContents) when the favicon url is // available. We use |last_page_url_| specifically (regardless of other @@ -478,6 +485,9 @@ void FaviconHandler::OnGotInitialHistoryDataAndIconURLCandidates() { // The page lists no candidates that match our target |icon_types_|, so // check if any existing mappings should be deleted. MaybeDeleteFaviconMappings(); +#if defined(TOOLKIT_QT) + delegate_->OnHandlerCompleted(this); +#endif return; } @@ -492,6 +502,9 @@ void FaviconHandler::OnGotInitialHistoryDataAndIconURLCandidates() { // TODO: Store all of the icon URLs associated with a page in history so // that we can check whether the page's icon URLs match the page's icon URLs // at the time that the favicon data was stored to the history database. +#if defined(TOOLKIT_QT) + delegate_->OnHandlerCompleted(this); +#endif return; } @@ -565,6 +578,9 @@ void FaviconHandler::OnDidDownloadFavicon( // Clear download related state. current_candidate_index_ = final_candidates_->size(); best_favicon_ = DownloadedFavicon(); +#if defined(TOOLKIT_QT) + delegate_->OnHandlerCompleted(this); +#endif } } @@ -656,9 +672,13 @@ void FaviconHandler::GetFaviconAndUpdateMappingsUnlessIncognito( // favicon for another page that shares the same favicon. Ask for the // favicon given the favicon URL. if (delegate_->IsOffTheRecord()) { +#if defined(TOOLKIT_QT) + std::move(callback).Run(std::vector()); +#else service_->GetFavicon(icon_url, icon_type, preferred_icon_size(), std::move(callback), &cancelable_task_tracker_for_candidates_); +#endif } else { // Ask the history service for the icon. This does two things: // 1. Attempts to fetch the favicon data from the database. @@ -695,6 +715,11 @@ void FaviconHandler::OnFaviconData( ScheduleImageDownload(current_candidate()->icon_url, current_candidate()->icon_type); } +#if defined(TOOLKIT_QT) + else { + delegate_->OnHandlerCompleted(this); + } +#endif } void FaviconHandler::ScheduleImageDownload(const GURL& image_url, diff --git a/chromium/components/favicon/core/favicon_handler.h b/chromium/components/favicon/core/favicon_handler.h index 631d3bf584b..2826297e977 100644 --- a/chromium/components/favicon/core/favicon_handler.h +++ b/chromium/components/favicon/core/favicon_handler.h @@ -124,6 +124,10 @@ class FaviconHandler { virtual void OnFaviconDeleted( const GURL& page_url, FaviconDriverObserver::NotificationIconType notification_icon_type) = 0; + +#if defined(TOOLKIT_QT) + virtual void OnHandlerCompleted(FaviconHandler *handler) {} +#endif }; // |service| may be null (which means favicons are not saved). If |service| @@ -163,6 +167,10 @@ class FaviconHandler { FaviconDriverObserver::NotificationIconType handler_type, bool candidates_from_web_manifest); +#if defined(TOOLKIT_QT) + FaviconDriverObserver::NotificationIconType Type() const { return handler_type_; } +#endif + private: // Used to track a candidate for the favicon. struct FaviconCandidate { diff --git a/chromium/components/favicon/core/favicon_service.h b/chromium/components/favicon/core/favicon_service.h index b6ba9f6b67e..26a6fbda174 100644 --- a/chromium/components/favicon/core/favicon_service.h +++ b/chromium/components/favicon/core/favicon_service.h @@ -17,6 +17,10 @@ class GURL; +namespace history { +class HistoryService; +} + namespace favicon { class FaviconService : public CoreFaviconService, public LargeFaviconProvider { @@ -153,6 +157,10 @@ class FaviconService : public CoreFaviconService, public LargeFaviconProvider { favicon_base::IconType icon_type, const gfx::Image& image, base::OnceCallback callback) = 0; +#if defined(TOOLKIT_QT) + virtual history::HistoryService* HistoryService() const = 0; + virtual void SetHistoryService(history::HistoryService* history_service) = 0; +#endif }; } // namespace favicon diff --git a/chromium/components/favicon/core/favicon_service_impl.cc b/chromium/components/favicon/core/favicon_service_impl.cc index bcf470bcd07..7c5379cc663 100644 --- a/chromium/components/favicon/core/favicon_service_impl.cc +++ b/chromium/components/favicon/core/favicon_service_impl.cc @@ -29,8 +29,10 @@ FaviconServiceImpl::FaviconServiceImpl( history::HistoryService* history_service) : favicon_client_(std::move(favicon_client)), history_service_(history_service) { +#if !defined(TOOLKIT_QT) // TODO(https://crbug.com/1024959): convert to DCHECK once crash is resolved. CHECK(history_service_); +#endif } FaviconServiceImpl::~FaviconServiceImpl() {} diff --git a/chromium/components/favicon/core/favicon_service_impl.h b/chromium/components/favicon/core/favicon_service_impl.h index 9daed8cdb31..2b759934518 100644 --- a/chromium/components/favicon/core/favicon_service_impl.h +++ b/chromium/components/favicon/core/favicon_service_impl.h @@ -125,6 +125,15 @@ class FaviconServiceImpl : public FaviconService { void UnableToDownloadFavicon(const GURL& icon_url) override; bool WasUnableToDownloadFavicon(const GURL& icon_url) const override; void ClearUnableToDownloadFavicons() override; +#if defined(TOOLKIT_QT) + history::HistoryService* HistoryService() const override { + return history_service_; + } + + void SetHistoryService(history::HistoryService* history_service) override { + history_service_ = history_service; + } +#endif private: using MissingFaviconURLHash = size_t; diff --git a/chromium/components/history/core/browser/BUILD.gn b/chromium/components/history/core/browser/BUILD.gn index ed2342484ed..949740cdc81 100644 --- a/chromium/components/history/core/browser/BUILD.gn +++ b/chromium/components/history/core/browser/BUILD.gn @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/features.gni") + static_library("browser") { sources = [ "browsing_history_driver.h", @@ -122,6 +124,31 @@ static_library("browser") { "//url", ] + if (use_qt) { + sources -= [ + "browsing_history_service.cc", + "browsing_history_service.h", + "sync/delete_directive_handler.cc", + "sync/delete_directive_handler.h", + "sync/history_delete_directives_model_type_controller.cc", + "sync/history_delete_directives_model_type_controller.h", + "sync/typed_url_model_type_controller.cc", + "sync/typed_url_model_type_controller.h", + "sync/typed_url_sync_bridge.cc", + "sync/typed_url_sync_bridge.h", + "sync/typed_url_sync_metadata_database.cc", + "sync/typed_url_sync_metadata_database.h", + ] + + public_deps -= [ + "//components/sync/protocol", + ] + + deps -= [ + "//components/sync", + ] + } + if (is_android) { sources += [ "android/android_cache_database.cc", diff --git a/chromium/components/history/core/browser/browsing_history_driver.h b/chromium/components/history/core/browser/browsing_history_driver.h index 00f651523ae..d783b5f9baa 100644 --- a/chromium/components/history/core/browser/browsing_history_driver.h +++ b/chromium/components/history/core/browser/browsing_history_driver.h @@ -26,11 +26,13 @@ class WebHistoryService; // platform logic and classes, facilitating both sending an receiving data. class BrowsingHistoryDriver { public: +#if !defined(TOOLKIT_QT) // Callback for QueryHistory(). virtual void OnQueryComplete( const std::vector& results, const BrowsingHistoryService::QueryResultsInfo& query_results_info, base::OnceClosure continuation_closure) = 0; +#endif // !defined(TOOLKIT_QT) // Callback for RemoveVisits(). virtual void OnRemoveVisitsComplete() = 0; @@ -62,6 +64,7 @@ class BrowsingHistoryDriver { // accessible. virtual WebHistoryService* GetWebHistoryService() = 0; +#if !defined(TOOLKIT_QT) // Whether the Clear Browsing Data UI should show a notice about the existence // of other forms of browsing history stored in user's account. The response // is returned in a `callback`. @@ -69,6 +72,7 @@ class BrowsingHistoryDriver { const syncer::SyncService* sync_service, WebHistoryService* history_service, base::OnceCallback callback) = 0; +#endif // !defined(TOOLKIT_QT) protected: BrowsingHistoryDriver() {} diff --git a/chromium/components/history/core/browser/browsing_history_service.cc b/chromium/components/history/core/browser/browsing_history_service.cc index 0f89304b287..f7b7757c23b 100644 --- a/chromium/components/history/core/browser/browsing_history_service.cc +++ b/chromium/components/history/core/browser/browsing_history_service.cc @@ -23,7 +23,9 @@ #include "components/history/core/browser/browsing_history_driver.h" #include "components/history/core/browser/history_types.h" #include "components/keyed_service/core/service_access_type.h" +#if !defined(TOOLKIT_QT) #include "components/sync/protocol/history_delete_directive_specifics.pb.h" +#endif // !defined(TOOLKIT_QT) namespace history { @@ -347,6 +349,7 @@ void BrowsingHistoryService::RemoveVisits( expire_list.reserve(items.size()); DCHECK(urls_to_be_deleted_.empty()); +#if !defined(TOOLKIT_QT) for (const BrowsingHistoryService::HistoryEntry& entry : items) { // In order to ensure that visits will be deleted from the server and other // clients (even if they are offline), create a sync delete directive for @@ -386,6 +389,7 @@ void BrowsingHistoryService::RemoveVisits( if (web_history && local_history_) local_history_->ProcessLocalDeleteDirective(delete_directive); } +#endif // !defined(TOOLKIT_QT) if (local_history_) { local_history_->ExpireHistory( diff --git a/chromium/components/history/core/browser/history_backend.cc b/chromium/components/history/core/browser/history_backend.cc index 1a6bb7ad482..885d4de9e57 100644 --- a/chromium/components/history/core/browser/history_backend.cc +++ b/chromium/components/history/core/browser/history_backend.cc @@ -46,9 +46,13 @@ #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" +#if !defined(TOOLKIT_QT) #include "components/history/core/browser/sync/typed_url_sync_bridge.h" +#endif #include "components/history/core/browser/url_utils.h" +#if !defined(TOOLKIT_QT) #include "components/sync/model/client_tag_based_model_type_processor.h" +#endif #include "components/url_formatter/url_formatter.h" #include "net/base/escape.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" @@ -69,7 +73,9 @@ using favicon::FaviconBitmapID; using favicon::FaviconBitmapIDSize; using favicon::FaviconBitmapType; using favicon::IconMapping; +#if !defined(TOOLKIT_QT) using syncer::ClientTagBasedModelTypeProcessor; +#endif /* The HistoryBackend consists of two components: @@ -304,11 +310,13 @@ void HistoryBackend::Init( InitImpl(history_database_params); delegate_->DBLoaded(); +#if !defined(TOOLKIT_QT) typed_url_sync_bridge_ = std::make_unique( this, db_.get(), std::make_unique( syncer::TYPED_URLS, /*dump_stack=*/base::RepeatingClosure())); typed_url_sync_bridge_->Init(); +#endif // !defined(TOOLKIT_QT) memory_pressure_listener_ = std::make_unique( FROM_HERE, base::BindRepeating(&HistoryBackend::OnMemoryPressure, @@ -1065,10 +1073,12 @@ void HistoryBackend::AddPagesWithDetails(const URLRows& urls, ScheduleCommit(); } +#if !defined(TOOLKIT_QT) void HistoryBackend::SetTypedURLSyncBridgeForTest( std::unique_ptr bridge) { typed_url_sync_bridge_ = std::move(bridge); } +#endif // !defined(TOOLKIT_QT) bool HistoryBackend::IsExpiredVisitTime(const base::Time& time) { return time < expirer_.GetCurrentExpirationTime(); @@ -1257,11 +1267,13 @@ QueryURLResult HistoryBackend::QueryURL(const GURL& url, bool want_visits) { return result; } +#if !defined(TOOLKIT_QT) base::WeakPtr HistoryBackend::GetTypedURLSyncControllerDelegate() { DCHECK(typed_url_sync_bridge_); return typed_url_sync_bridge_->change_processor()->GetControllerDelegate(); } +#endif // !defined(TOOLKIT_QT) // Statistics ------------------------------------------------------------------ @@ -2268,10 +2280,12 @@ void HistoryBackend::KillHistoryDatabase() { if (!db_) return; +#if !defined(TOOLKIT_QT) // Notify SyncBridge about storage error. It will report failure to sync // engine and stop accepting remote updates. if (typed_url_sync_bridge_) typed_url_sync_bridge_->OnDatabaseError(); +#endif // !defined(TOOLKIT_QT) // Rollback transaction because Raze() cannot be called from within a // transaction. diff --git a/chromium/components/history/core/browser/history_backend.h b/chromium/components/history/core/browser/history_backend.h index bbf6b21b217..7bf1c9734d3 100644 --- a/chromium/components/history/core/browser/history_backend.h +++ b/chromium/components/history/core/browser/history_backend.h @@ -477,10 +477,12 @@ class HistoryBackend : public base::RefCountedThreadSafe, bool GetURLByID(URLID url_id, URLRow* url_row); +#if !defined(TOOLKIT_QT) // Returns the sync controller delegate for syncing typed urls. The returned // delegate is owned by `this` object. base::WeakPtr GetTypedURLSyncControllerDelegate(); +#endif // !defined(TOOLKIT_QT) // Deleting ------------------------------------------------------------------ @@ -564,7 +566,9 @@ class HistoryBackend : public base::RefCountedThreadSafe, ExpireHistoryBackend* expire_backend() { return &expirer_; } #endif +#if !defined(TOOLKIT_QT) void SetTypedURLSyncBridgeForTest(std::unique_ptr bridge); +#endif // Returns true if the passed visit time is already expired (used by the sync // code to avoid syncing visits that would immediately be expired). @@ -815,10 +819,12 @@ class HistoryBackend : public base::RefCountedThreadSafe, // List of observers base::ObserverList::Unchecked observers_; +#if !defined(TOOLKIT_QT) // Used to manage syncing of the typed urls datatype. It will be null before // HistoryBackend::Init is called. Defined after observers_ because // it unregisters itself as observer during destruction. std::unique_ptr typed_url_sync_bridge_; +#endif // !defined(TOOLKIT_QT) DISALLOW_COPY_AND_ASSIGN(HistoryBackend); }; diff --git a/chromium/components/history/core/browser/history_database.cc b/chromium/components/history/core/browser/history_database.cc index 460823346f1..3b1606635ab 100644 --- a/chromium/components/history/core/browser/history_database.cc +++ b/chromium/components/history/core/browser/history_database.cc @@ -122,7 +122,11 @@ sql::InitStatus HistoryDatabase::Init(const base::FilePath& history_name) { return LogInitFailure(InitStep::META_TABLE_INIT); if (!CreateURLTable(false) || !InitVisitTable() || !InitKeywordSearchTermsTable() || !InitDownloadTable() || +#if !defined(TOOLKIT_QT) !InitSegmentTables() || !InitSyncTable() || !InitVisitAnnotationsTables()) +#else + !InitSegmentTables() || !InitVisitAnnotationsTables()) +#endif return LogInitFailure(InitStep::CREATE_TABLES); CreateMainURLIndex(); @@ -609,6 +613,7 @@ sql::InitStatus HistoryDatabase::EnsureCurrentVersion() { meta_table_.SetVersionNumber(cur_version); } +#if !defined(TOOLKIT_QT) if (cur_version == 40) { std::vector visited_url_rowids_sorted; if (!GetAllVisitedURLRowidsForMigrationToVersion40( @@ -620,6 +625,7 @@ sql::InitStatus HistoryDatabase::EnsureCurrentVersion() { cur_version++; meta_table_.SetVersionNumber(cur_version); } +#endif if (cur_version == 41) { if (!MigrateKeywordsSearchTermsLowerTermColumn()) diff --git a/chromium/components/history/core/browser/history_database.h b/chromium/components/history/core/browser/history_database.h index 868f56046d5..e3d41a3abbd 100644 --- a/chromium/components/history/core/browser/history_database.h +++ b/chromium/components/history/core/browser/history_database.h @@ -11,7 +11,9 @@ #include "build/build_config.h" #include "components/history/core/browser/download_database.h" #include "components/history/core/browser/history_types.h" +#if !defined(TOOLKIT_QT) #include "components/history/core/browser/sync/typed_url_sync_metadata_database.h" +#endif #include "components/history/core/browser/url_database.h" #include "components/history/core/browser/visit_annotations_database.h" #include "components/history/core/browser/visit_database.h" @@ -45,7 +47,9 @@ class HistoryDatabase : public DownloadDatabase, public AndroidURLsDatabase, public AndroidCacheDatabase, #endif +#if !defined(TOOLKIT_QT) public TypedURLSyncMetadataDatabase, +#endif public URLDatabase, public VisitDatabase, public VisitAnnotationsDatabase, @@ -181,7 +185,11 @@ class HistoryDatabase : public DownloadDatabase, sql::Database& GetDB() override; // Overridden from TypedURLSyncMetadataDatabase. +#if !defined(TOOLKIT_QT) sql::MetaTable& GetMetaTable() override; +#else + sql::MetaTable& GetMetaTable(); +#endif // Migration ----------------------------------------------------------------- diff --git a/chromium/components/history/core/browser/history_service.cc b/chromium/components/history/core/browser/history_service.cc index c3f16455a7d..5c7db060135 100644 --- a/chromium/components/history/core/browser/history_service.cc +++ b/chromium/components/history/core/browser/history_service.cc @@ -46,12 +46,16 @@ #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" +#if !defined(TOOLKIT_QT) #include "components/history/core/browser/sync/delete_directive_handler.h" +#endif #include "components/history/core/browser/visit_database.h" #include "components/history/core/browser/visit_delegate.h" #include "components/history/core/browser/web_history_service.h" +#if !defined(TOOLKIT_QT) #include "components/sync/model/proxy_model_type_controller_delegate.h" #include "components/sync/model/sync_error_factory.h" +#endif #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/page_transition_types.h" @@ -1039,9 +1043,11 @@ bool HistoryService::Init( base::BindOnce(&HistoryBackend::Init, history_backend_, no_db, history_database_params)); +#if !defined(TOOLKIT_QT) delete_directive_handler_ = std::make_unique( base::BindRepeating(base::IgnoreResult(&HistoryService::ScheduleDBTask), base::Unretained(this))); +#endif // !defined(TOOLKIT_QT) if (visit_delegate_ && !visit_delegate_->Init(this)) { // This is rare enough that it's worth logging. @@ -1083,6 +1089,7 @@ base::WeakPtr HistoryService::AsWeakPtr() { return weak_ptr_factory_.GetWeakPtr(); } +#if !defined(TOOLKIT_QT) base::WeakPtr HistoryService::GetDeleteDirectivesSyncableService() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -1101,11 +1108,14 @@ HistoryService::GetTypedURLSyncControllerDelegate() { base::BindRepeating(&HistoryBackend::GetTypedURLSyncControllerDelegate, base::Unretained(history_backend_.get()))); } +#endif // !defined(TOOLKIT_QT) void HistoryService::ProcessLocalDeleteDirective( const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +#if !defined(TOOLKIT_QT) delete_directive_handler_->ProcessLocalDeleteDirective(delete_directive); +#endif } void HistoryService::SetInMemoryBackend( @@ -1183,6 +1193,7 @@ void HistoryService::DeleteLocalAndRemoteHistoryBetween( base::CancelableTaskTracker* tracker) { // TODO(crbug.com/929111): This should be factored out into a separate class // that dispatches deletions to the proper places. +#if !defined(TOOLKIT_QT) if (web_history) { delete_directive_handler_->CreateDeleteDirectives(std::set(), begin_time, end_time); @@ -1220,6 +1231,7 @@ void HistoryService::DeleteLocalAndRemoteHistoryBetween( /*restrict_urls=*/{}, begin_time, end_time, base::DoNothing(), partial_traffic_annotation); } +#endif // !defined(TOOLKIT_QT) ExpireHistoryBetween(/*restrict_urls=*/{}, begin_time, end_time, /*user_initiated=*/true, std::move(callback), tracker); } @@ -1227,6 +1239,7 @@ void HistoryService::DeleteLocalAndRemoteHistoryBetween( void HistoryService::DeleteLocalAndRemoteUrl(WebHistoryService* web_history, const GURL& url) { DCHECK(url.is_valid()); +#if !defined(TOOLKIT_QT) // TODO(crbug.com/929111): This should be factored out into a separate class // that dispatches deletions to the proper places. if (web_history) { @@ -1259,13 +1272,16 @@ void HistoryService::DeleteLocalAndRemoteUrl(WebHistoryService* web_history, /*restrict_urls=*/{url}, base::Time(), base::Time::Max(), base::DoNothing(), partial_traffic_annotation); } +#endif // !defined(TOOLKIT_QT) DeleteURLs({url}); } void HistoryService::OnDBLoaded() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); backend_loaded_ = true; +#if !defined(TOOLKIT_QT) delete_directive_handler_->OnBackendLoaded(); +#endif NotifyHistoryServiceLoaded(); } diff --git a/chromium/components/history/core/browser/history_service.h b/chromium/components/history/core/browser/history_service.h index d3d8e518a4d..c77dd6dd6cd 100644 --- a/chromium/components/history/core/browser/history_service.h +++ b/chromium/components/history/core/browser/history_service.h @@ -582,6 +582,7 @@ class HistoryService : public KeyedService { base::WeakPtr AsWeakPtr(); +#if !defined(TOOLKIT_QT) // For sync codebase only: returns the SyncableService API that implements // sync datatype HISTORY_DELETE_DIRECTIVES. base::WeakPtr GetDeleteDirectivesSyncableService(); @@ -590,6 +591,7 @@ class HistoryService : public KeyedService { // TypedURLSyncBridge. Must be called from the UI thread. std::unique_ptr GetTypedURLSyncControllerDelegate(); +#endif // !defined(TOOLKIT_QT) // Override `backend_task_runner_` for testing; needs to be called before // Init. @@ -929,7 +931,9 @@ class HistoryService : public KeyedService { base::ObserverList::Unchecked observers_; FaviconsChangedCallbackList favicons_changed_callback_list_; +#if !defined(TOOLKIT_QT) std::unique_ptr delete_directive_handler_; +#endif base::OnceClosure origin_queried_closure_for_testing_; diff --git a/chromium/components/history/core/browser/web_history_service.cc b/chromium/components/history/core/browser/web_history_service.cc index 6a5059cda18..a9197b5688c 100644 --- a/chromium/components/history/core/browser/web_history_service.cc +++ b/chromium/components/history/core/browser/web_history_service.cc @@ -22,8 +22,10 @@ #include "components/signin/public/identity_manager/identity_manager.h" #include "components/signin/public/identity_manager/primary_account_access_token_fetcher.h" #include "components/signin/public/identity_manager/scope_set.h" +#if !defined(TOOLKIT_QT) #include "components/sync/base/sync_util.h" #include "components/sync/protocol/history_status.pb.h" +#endif #include "google_apis/gaia/gaia_urls.h" #include "google_apis/gaia/google_service_auth_error.h" #include "net/base/load_flags.h" @@ -527,6 +529,7 @@ void WebHistoryService::QueryWebAndAppActivity( request->Start(); } +#if !defined(TOOLKIT_QT) void WebHistoryService::QueryOtherFormsOfBrowsingHistory( version_info::Channel channel, QueryOtherFormsOfBrowsingHistoryCallback callback, @@ -563,6 +566,7 @@ void WebHistoryService::QueryOtherFormsOfBrowsingHistory( request->Start(); } +#endif // !defined(TOOLKIT_QT) // static void WebHistoryService::QueryHistoryCompletionCallback( @@ -643,6 +647,7 @@ void WebHistoryService::QueryWebAndAppActivityCompletionCallback( std::move(callback).Run(web_and_app_activity_enabled); } +#if !defined(TOOLKIT_QT) void WebHistoryService::QueryOtherFormsOfBrowsingHistoryCompletionCallback( WebHistoryService::QueryOtherFormsOfBrowsingHistoryCallback callback, WebHistoryService::Request* request, @@ -660,5 +665,6 @@ void WebHistoryService::QueryOtherFormsOfBrowsingHistoryCompletionCallback( std::move(callback).Run(has_other_forms_of_browsing_history); } +#endif // !defined(TOOLKIT_QT) } // namespace history diff --git a/chromium/components/history/core/browser/web_history_service.h b/chromium/components/history/core/browser/web_history_service.h index f10d26efc1c..9977e151c5d 100644 --- a/chromium/components/history/core/browser/web_history_service.h +++ b/chromium/components/history/core/browser/web_history_service.h @@ -155,12 +155,14 @@ class WebHistoryService : public KeyedService { // Used for tests. size_t GetNumberOfPendingAudioHistoryRequests(); +#if !defined(TOOLKIT_QT) // Whether there are other forms of browsing history stored on the server. void QueryOtherFormsOfBrowsingHistory( version_info::Channel channel, QueryOtherFormsOfBrowsingHistoryCallback callback, const net::PartialNetworkTrafficAnnotationTag& partial_traffic_annotation); +#endif // !defined(TOOLKIT_QT) protected: // This function is pulled out for testing purposes. Caller takes ownership of @@ -207,6 +209,7 @@ class WebHistoryService : public KeyedService { WebHistoryService::Request* request, bool success); +#if !defined(TOOLKIT_QT) // Called by `request` when a query for other forms of browsing history has // completed. Unpacks the response and calls `callback`, which is the original // callback that was passed to QueryOtherFormsOfBrowsingHistory(). @@ -214,6 +217,7 @@ class WebHistoryService : public KeyedService { WebHistoryService::QueryWebAndAppActivityCallback callback, WebHistoryService::Request* request, bool success); +#endif // !defined(TOOLKIT_QT) private: friend class WebHistoryServiceTest; -- cgit v1.2.1