Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1469)

Unified Diff: chrome/browser/ui/webui/sync_internals_message_handler.h

Issue 2910773003: [Sync] Replace manual DI with SetTestingFactory. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/sync_internals_message_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/sync_internals_message_handler.h
diff --git a/chrome/browser/ui/webui/sync_internals_message_handler.h b/chrome/browser/ui/webui/sync_internals_message_handler.h
index 2ef1840b073e0c6e7243e0868780ea22d8410aa0..fa703cfa35a42582578d4f13e2b0059ae7fe3fe4 100644
--- a/chrome/browser/ui/webui/sync_internals_message_handler.h
+++ b/chrome/browser/ui/webui/sync_internals_message_handler.h
@@ -96,16 +96,14 @@ class SyncInternalsMessageHandler : public content::WebUIMessageHandler,
std::unique_ptr<base::DictionaryValue> value);
protected:
- using SyncServiceProvider = base::RepeatingCallback<syncer::SyncService*()>;
-
using AboutSyncDataDelegate =
base::RepeatingCallback<std::unique_ptr<base::DictionaryValue>(
syncer::SyncService* service,
version_info::Channel channel)>;
// Constructor used for unit testing to override dependencies.
- SyncInternalsMessageHandler(SyncServiceProvider sync_service_provider,
- AboutSyncDataDelegate about_sync_data_delegate);
+ explicit SyncInternalsMessageHandler(
+ AboutSyncDataDelegate about_sync_data_delegate);
private:
// Fetches updated aboutInfo and sends it to the page in the form of an
@@ -113,9 +111,8 @@ class SyncInternalsMessageHandler : public content::WebUIMessageHandler,
void SendAboutInfo();
// Gets the ProfileSyncService of the underlying original profile. May return
- // nullptr (e.g., if sync is disabled on the command line). Shouldn't be
- // called directly, but instead through |sync_service_provider_|.
- syncer::SyncService* BindForSyncServiceProvider();
+ // nullptr (e.g., if sync is disabled on the command line).
+ syncer::SyncService* GetSyncService();
// Sends a dispatch event to the UI. Javascript must be enabled.
void DispatchEvent(const std::string& name, const base::Value& details_value);
@@ -133,9 +130,6 @@ class SyncInternalsMessageHandler : public content::WebUIMessageHandler,
// ProfileSyncService.
bool is_registered_for_counters_ = false;
- // An abstraction of who provides the SyncService.
- SyncServiceProvider sync_service_provider_;
-
// An abstraction of who creates the about sync info value map.
AboutSyncDataDelegate about_sync_data_delegate_;
« no previous file with comments | « no previous file | chrome/browser/ui/webui/sync_internals_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698