| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_data_type_controller.h" | 5 #include "chrome/browser/sync/glue/extension_data_type_controller.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/sync/profile_sync_factory.h" | 9 #include "chrome/browser/sync/profile_sync_factory.h" |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 bool ExtensionDataTypeController::StartModels() { | 29 bool ExtensionDataTypeController::StartModels() { |
| 30 profile_->InitExtensions(true); | 30 profile_->InitExtensions(true); |
| 31 return true; | 31 return true; |
| 32 } | 32 } |
| 33 | 33 |
| 34 void ExtensionDataTypeController::CreateSyncComponents() { | 34 void ExtensionDataTypeController::CreateSyncComponents() { |
| 35 ProfileSyncFactory::SyncComponents sync_components = | 35 ProfileSyncFactory::SyncComponents sync_components = |
| 36 profile_sync_factory_->CreateExtensionSyncComponents(sync_service_, | 36 profile_sync_factory_->CreateExtensionSyncComponents(sync_service_, |
| 37 this); | 37 this); |
| 38 set_model_associator(sync_components.model_associator); | 38 set_model_associator(sync_components.model_associator); |
| 39 generic_change_processor_.reset(static_cast<GenericChangeProcessor*>( | 39 set_change_processor(sync_components.change_processor); |
| 40 sync_components.change_processor)); | |
| 41 } | |
| 42 | |
| 43 GenericChangeProcessor* ExtensionDataTypeController::change_processor() const { | |
| 44 return generic_change_processor_.get(); | |
| 45 } | 40 } |
| 46 | 41 |
| 47 void ExtensionDataTypeController::RecordUnrecoverableError( | 42 void ExtensionDataTypeController::RecordUnrecoverableError( |
| 48 const tracked_objects::Location& from_here, | 43 const tracked_objects::Location& from_here, |
| 49 const std::string& message) { | 44 const std::string& message) { |
| 50 UMA_HISTOGRAM_COUNTS("Sync.ExtensionRunFailures", 1); | 45 UMA_HISTOGRAM_COUNTS("Sync.ExtensionRunFailures", 1); |
| 51 } | 46 } |
| 52 | 47 |
| 53 void ExtensionDataTypeController::RecordAssociationTime(base::TimeDelta time) { | 48 void ExtensionDataTypeController::RecordAssociationTime(base::TimeDelta time) { |
| 54 UMA_HISTOGRAM_TIMES("Sync.ExtensionAssociationTime", time); | 49 UMA_HISTOGRAM_TIMES("Sync.ExtensionAssociationTime", time); |
| 55 } | 50 } |
| 56 | 51 |
| 57 void ExtensionDataTypeController::RecordStartFailure(StartResult result) { | 52 void ExtensionDataTypeController::RecordStartFailure(StartResult result) { |
| 58 UMA_HISTOGRAM_ENUMERATION("Sync.ExtensionStartFailures", | 53 UMA_HISTOGRAM_ENUMERATION("Sync.ExtensionStartFailures", |
| 59 result, | 54 result, |
| 60 MAX_START_RESULT); | 55 MAX_START_RESULT); |
| 61 } | 56 } |
| 62 | 57 |
| 63 } // namespace browser_sync | 58 } // namespace browser_sync |
| OLD | NEW |