Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync / glue / extension_data_type_controller.cc
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/sync/glue/extension_data_type_controller.h"
6
7 #include "base/metrics/histogram.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h"
10 #include "chrome/browser/sync/profile_sync_components_factory.h"
11 #include "content/public/browser/browser_thread.h"
12 #include "extensions/browser/extension_system.h"
13
14 using content::BrowserThread;
15
16 namespace browser_sync {
17
18 ExtensionDataTypeController::ExtensionDataTypeController(
19     syncer::ModelType type,
20     ProfileSyncComponentsFactory* profile_sync_factory,
21     Profile* profile,
22     ProfileSyncService* sync_service)
23     : UIDataTypeController(
24           BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
25           base::Bind(&ChromeReportUnrecoverableError),
26           type,
27           profile_sync_factory,
28           profile,
29           sync_service) {
30   DCHECK(type == syncer::EXTENSIONS || type == syncer::APPS);
31 }
32
33 ExtensionDataTypeController::~ExtensionDataTypeController() {}
34
35 bool ExtensionDataTypeController::StartModels() {
36   extensions::ExtensionSystem::Get(profile_)->InitForRegularProfile(true);
37   return true;
38 }
39
40 }  // namespace browser_sync