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

Side by Side Diff: chrome/browser/autofill/address_storage_factory.cc

Issue 105823007: WIP - Chrome's libaddressinput storage implementation, step 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/autofill/address_storage_factory.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/autofill/address_storage_factory.h"
6
7 #include "base/files/file_path.h"
8 #include "base/path_service.h"
9 #include "base/prefs/json_pref_store.h"
10 #include "base/threading/sequenced_worker_pool.h"
11 #include "chrome/common/chrome_paths.h"
12 #include "content/public/browser/browser_thread.h"
13 #include "third_party/libaddressinput/chromium/chrome_storage_impl.h"
14
15 namespace autofill {
16
17 using ::i18n::addressinput::ChromeStorageImpl;
18
19 // static
20 ChromeStorageImpl* AddressStorageFactory::CreateChromeStorage() {
21 static base::LazyInstance<AddressStorageFactory> instance =
22 LAZY_INSTANCE_INITIALIZER;
23 return new ChromeStorageImpl(instance.Get().json_pref_store_.get());
24 }
25
26 AddressStorageFactory::AddressStorageFactory() {
27 base::FilePath path;
28 PathService::Get(chrome::FILE_LIBADDRESSINPUT_CACHE, &path);
29
30 base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool();
31 scoped_refptr<base::SequencedTaskRunner> task_runner =
32 pool->GetSequencedTaskRunnerWithShutdownBehavior(
33 pool->GetSequenceToken(),
34 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
35
36 json_pref_store_ = new JsonPrefStore(path, task_runner);
37 }
38
39 AddressStorageFactory::~AddressStorageFactory() {}
40
41 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/autofill/address_storage_factory.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698