| 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/app_data_type_controller.h" | 5 #include "chrome/browser/sync/glue/app_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 AppDataTypeController::StartModels() { | 29 bool AppDataTypeController::StartModels() { |
| 30 profile_->InitExtensions(true); | 30 profile_->InitExtensions(true); |
| 31 return true; | 31 return true; |
| 32 } | 32 } |
| 33 | 33 |
| 34 void AppDataTypeController::CreateSyncComponents() { | 34 void AppDataTypeController::CreateSyncComponents() { |
| 35 ProfileSyncFactory::SyncComponents sync_components = | 35 ProfileSyncFactory::SyncComponents sync_components = |
| 36 profile_sync_factory_->CreateAppSyncComponents(sync_service_, | 36 profile_sync_factory_->CreateAppSyncComponents(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* AppDataTypeController::change_processor() const { | |
| 44 return generic_change_processor_.get(); | |
| 45 } | |
| 46 | 40 |
| 47 void AppDataTypeController::RecordUnrecoverableError( | 41 void AppDataTypeController::RecordUnrecoverableError( |
| 48 const tracked_objects::Location& from_here, | 42 const tracked_objects::Location& from_here, |
| 49 const std::string& message) { | 43 const std::string& message) { |
| 50 UMA_HISTOGRAM_COUNTS("Sync.AppRunFailures", 1); | 44 UMA_HISTOGRAM_COUNTS("Sync.AppRunFailures", 1); |
| 51 } | 45 } |
| 52 | 46 |
| 53 void AppDataTypeController::RecordAssociationTime(base::TimeDelta time) { | 47 void AppDataTypeController::RecordAssociationTime(base::TimeDelta time) { |
| 54 UMA_HISTOGRAM_TIMES("Sync.AppAssociationTime", time); | 48 UMA_HISTOGRAM_TIMES("Sync.AppAssociationTime", time); |
| 55 } | 49 } |
| 56 | 50 |
| 57 void AppDataTypeController::RecordStartFailure(StartResult result) { | 51 void AppDataTypeController::RecordStartFailure(StartResult result) { |
| 58 UMA_HISTOGRAM_ENUMERATION("Sync.AppStartFailures", | 52 UMA_HISTOGRAM_ENUMERATION("Sync.AppStartFailures", |
| 59 result, | 53 result, |
| 60 MAX_START_RESULT); | 54 MAX_START_RESULT); |
| 61 } | 55 } |
| 62 | 56 |
| 63 } // namespace browser_sync | 57 } // namespace browser_sync |
| OLD | NEW |