OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sync/glue/extension_setting_data_type_controller.h" | 5 #include "chrome/browser/sync/glue/extension_setting_data_type_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "chrome/browser/extensions/api/storage/backend_task_runner.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
11 #include "components/sync/driver/generic_change_processor.h" | 12 #include "components/sync/driver/generic_change_processor.h" |
12 #include "components/sync/model/syncable_service.h" | 13 #include "components/sync/model/syncable_service.h" |
13 #include "content/public/browser/browser_thread.h" | |
14 #include "extensions/browser/extension_system.h" | 14 #include "extensions/browser/extension_system.h" |
15 | 15 |
16 using content::BrowserThread; | |
17 | |
18 namespace browser_sync { | 16 namespace browser_sync { |
19 | 17 |
20 ExtensionSettingDataTypeController::ExtensionSettingDataTypeController( | 18 ExtensionSettingDataTypeController::ExtensionSettingDataTypeController( |
21 syncer::ModelType type, | 19 syncer::ModelType type, |
22 const base::Closure& dump_stack, | 20 const base::Closure& dump_stack, |
23 syncer::SyncClient* sync_client, | 21 syncer::SyncClient* sync_client, |
24 Profile* profile) | 22 Profile* profile) |
25 : AsyncDirectoryTypeController( | 23 : AsyncDirectoryTypeController(type, |
26 type, | 24 dump_stack, |
27 dump_stack, | 25 sync_client, |
28 sync_client, | 26 syncer::GROUP_FILE, |
29 syncer::GROUP_FILE, | 27 extensions::GetBackendTaskRunner()), |
30 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)), | |
31 profile_(profile) { | 28 profile_(profile) { |
32 DCHECK(type == syncer::EXTENSION_SETTINGS || type == syncer::APP_SETTINGS); | 29 DCHECK(type == syncer::EXTENSION_SETTINGS || type == syncer::APP_SETTINGS); |
33 } | 30 } |
34 | 31 |
35 ExtensionSettingDataTypeController::~ExtensionSettingDataTypeController() {} | 32 ExtensionSettingDataTypeController::~ExtensionSettingDataTypeController() {} |
36 | 33 |
37 bool ExtensionSettingDataTypeController::StartModels() { | 34 bool ExtensionSettingDataTypeController::StartModels() { |
38 DCHECK(CalledOnValidThread()); | 35 DCHECK(CalledOnValidThread()); |
39 extensions::ExtensionSystem::Get(profile_)->InitForRegularProfile(true); | 36 extensions::ExtensionSystem::Get(profile_)->InitForRegularProfile(true); |
40 return true; | 37 return true; |
41 } | 38 } |
42 | 39 |
43 } // namespace browser_sync | 40 } // namespace browser_sync |
OLD | NEW |