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

Unified Diff: chrome/browser/chromeos/printing/printers_manager_factory.cc

Issue 2732333003: [Sync] ModelTypeStore factory shouldn't require valid PSS to function correctly (Closed)
Patch Set: Address comments Created 3 years, 9 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/sync/chrome_sync_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/printing/printers_manager_factory.cc
diff --git a/chrome/browser/chromeos/printing/printers_manager_factory.cc b/chrome/browser/chromeos/printing/printers_manager_factory.cc
index ca2162fe7351ff76339d42f845ba8806d2ebc60f..e3bcf4cb667286bf60ed63d77bd68139665ed8c4 100644
--- a/chrome/browser/chromeos/printing/printers_manager_factory.cc
+++ b/chrome/browser/chromeos/printing/printers_manager_factory.cc
@@ -16,6 +16,7 @@
#include "components/browser_sync/profile_sync_service.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "content/public/browser/browser_context.h"
+#include "content/public/browser/browser_thread.h"
namespace chromeos {
@@ -54,17 +55,10 @@ PrintersManager* PrintersManagerFactory::BuildServiceInstanceFor(
content::BrowserContext* browser_context) const {
Profile* profile = Profile::FromBrowserContext(browser_context);
- browser_sync::ProfileSyncService* sync_service =
- ProfileSyncServiceFactory::GetForProfile(profile);
-
- // TODO(skym): After crbug.com/688533 is fixed, this should not use
- // CreateInMemoryStoreForTest, but rather a ModelTypeStore creation mechanism
- // that's agnostic to the existence of sync infrastructure.
const syncer::ModelTypeStoreFactory& store_factory =
- sync_service ? sync_service->GetModelTypeStoreFactory(syncer::PRINTERS)
- : base::BindRepeating(
- syncer::ModelTypeStore::CreateInMemoryStoreForTest,
- syncer::PRINTERS);
+ browser_sync::ProfileSyncService::GetModelTypeStoreFactory(
+ syncer::PRINTERS, profile->GetPath(),
+ content::BrowserThread::GetBlockingPool());
std::unique_ptr<PrintersSyncBridge> sync_bridge =
base::MakeUnique<PrintersSyncBridge>(
« no previous file with comments | « no previous file | chrome/browser/sync/chrome_sync_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698