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

Side by Side Diff: chrome/browser/chromeos/printing/printers_manager_factory.cc

Issue 2716973002: Use an in memory store until crbug.com/688533 is fixed. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/printing/printers_manager_factory.h" 5 #include "chrome/browser/chromeos/printing/printers_manager_factory.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/debug/dump_without_crashing.h" 10 #include "base/debug/dump_without_crashing.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 PrintersManagerFactory::~PrintersManagerFactory() {} 51 PrintersManagerFactory::~PrintersManagerFactory() {}
52 52
53 PrintersManager* PrintersManagerFactory::BuildServiceInstanceFor( 53 PrintersManager* PrintersManagerFactory::BuildServiceInstanceFor(
54 content::BrowserContext* browser_context) const { 54 content::BrowserContext* browser_context) const {
55 Profile* profile = Profile::FromBrowserContext(browser_context); 55 Profile* profile = Profile::FromBrowserContext(browser_context);
56 56
57 browser_sync::ProfileSyncService* sync_service = 57 browser_sync::ProfileSyncService* sync_service =
58 ProfileSyncServiceFactory::GetForProfile(profile); 58 ProfileSyncServiceFactory::GetForProfile(profile);
59 59
60 // TODO(skau): --disable-sync and --enable-native-cups are mutually exclusive 60 // TODO(skym): After crbug.com/688533 is fixed, this should not use
61 // until crbug.com/688533 is resolved. 61 // CreateInMemoryStoreForTest, but rather a ModelTypeStore creation mechanism
62 DCHECK(sync_service); 62 // that's agnostic to the existence of sync infrastructure.
63 const syncer::ModelTypeStoreFactory& store_factory =
64 sync_service ? sync_service->GetModelTypeStoreFactory(syncer::PRINTERS)
65 : base::BindRepeating(
66 syncer::ModelTypeStore::CreateInMemoryStoreForTest,
67 syncer::PRINTERS);
63 68
64 std::unique_ptr<PrintersSyncBridge> sync_bridge = 69 std::unique_ptr<PrintersSyncBridge> sync_bridge =
65 base::MakeUnique<PrintersSyncBridge>( 70 base::MakeUnique<PrintersSyncBridge>(
66 sync_service->GetModelTypeStoreFactory(syncer::PRINTERS), 71 store_factory,
67 base::BindRepeating( 72 base::BindRepeating(
68 base::IgnoreResult(&base::debug::DumpWithoutCrashing))); 73 base::IgnoreResult(&base::debug::DumpWithoutCrashing)));
69 74
70 return new PrintersManager(profile, std::move(sync_bridge)); 75 return new PrintersManager(profile, std::move(sync_bridge));
71 } 76 }
72 77
73 } // namespace chromeos 78 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698