| 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 set_change_processor(sync_components.change_processor); | 39 change_processor_.reset(static_cast<GenericChangeProcessor*>( |
| 40 sync_components.change_processor)); |
| 41 } |
| 42 |
| 43 GenericChangeProcessor* ExtensionDataTypeController::change_processor() const { |
| 44 return change_processor_.get(); |
| 40 } | 45 } |
| 41 | 46 |
| 42 void ExtensionDataTypeController::RecordUnrecoverableError( | 47 void ExtensionDataTypeController::RecordUnrecoverableError( |
| 43 const tracked_objects::Location& from_here, | 48 const tracked_objects::Location& from_here, |
| 44 const std::string& message) { | 49 const std::string& message) { |
| 45 UMA_HISTOGRAM_COUNTS("Sync.ExtensionRunFailures", 1); | 50 UMA_HISTOGRAM_COUNTS("Sync.ExtensionRunFailures", 1); |
| 46 } | 51 } |
| 47 | 52 |
| 48 void ExtensionDataTypeController::RecordAssociationTime(base::TimeDelta time) { | 53 void ExtensionDataTypeController::RecordAssociationTime(base::TimeDelta time) { |
| 49 UMA_HISTOGRAM_TIMES("Sync.ExtensionAssociationTime", time); | 54 UMA_HISTOGRAM_TIMES("Sync.ExtensionAssociationTime", time); |
| 50 } | 55 } |
| 51 | 56 |
| 52 void ExtensionDataTypeController::RecordStartFailure(StartResult result) { | 57 void ExtensionDataTypeController::RecordStartFailure(StartResult result) { |
| 53 UMA_HISTOGRAM_ENUMERATION("Sync.ExtensionStartFailures", | 58 UMA_HISTOGRAM_ENUMERATION("Sync.ExtensionStartFailures", |
| 54 result, | 59 result, |
| 55 MAX_START_RESULT); | 60 MAX_START_RESULT); |
| 56 } | 61 } |
| 57 | 62 |
| 58 } // namespace browser_sync | 63 } // namespace browser_sync |
| OLD | NEW |