Home | History | Annotate | Download | only in glue
      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 "content/public/browser/browser_thread.h"
     11 #include "extensions/browser/extension_system.h"
     12 
     13 using content::BrowserThread;
     14 
     15 namespace browser_sync {
     16 
     17 ExtensionDataTypeController::ExtensionDataTypeController(
     18     syncer::ModelType type,
     19     sync_driver::SyncApiComponentFactory* sync_factory,
     20     Profile* profile)
     21     : UIDataTypeController(
     22           BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
     23           base::Bind(&ChromeReportUnrecoverableError),
     24           type,
     25           sync_factory),
     26       profile_(profile) {
     27   DCHECK(type == syncer::EXTENSIONS || type == syncer::APPS);
     28 }
     29 
     30 ExtensionDataTypeController::~ExtensionDataTypeController() {}
     31 
     32 bool ExtensionDataTypeController::StartModels() {
     33   extensions::ExtensionSystem::Get(profile_)->InitForRegularProfile(true);
     34   return true;
     35 }
     36 
     37 }  // namespace browser_sync
     38