Chromium Code Reviews| 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/glue/generic_change_processor.h" | |
| 9 #include "chrome/browser/sync/profile_sync_factory.h" | 10 #include "chrome/browser/sync/profile_sync_factory.h" |
| 10 | 11 |
| 11 namespace browser_sync { | 12 namespace browser_sync { |
| 12 | 13 |
| 13 AppDataTypeController::AppDataTypeController( | 14 AppDataTypeController::AppDataTypeController( |
| 14 ProfileSyncFactory* profile_sync_factory, | 15 ProfileSyncFactory* profile_sync_factory, |
| 15 Profile* profile, | 16 Profile* profile, |
| 16 ProfileSyncService* sync_service) | 17 ProfileSyncService* sync_service) |
| 17 : FrontendDataTypeController(profile_sync_factory, | 18 : FrontendDataTypeController(profile_sync_factory, |
| 18 profile, | 19 profile, |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 29 bool AppDataTypeController::StartModels() { | 30 bool AppDataTypeController::StartModels() { |
| 30 profile_->InitExtensions(true); | 31 profile_->InitExtensions(true); |
| 31 return true; | 32 return true; |
| 32 } | 33 } |
| 33 | 34 |
| 34 void AppDataTypeController::CreateSyncComponents() { | 35 void AppDataTypeController::CreateSyncComponents() { |
| 35 ProfileSyncFactory::SyncComponents sync_components = | 36 ProfileSyncFactory::SyncComponents sync_components = |
| 36 profile_sync_factory_->CreateAppSyncComponents(sync_service_, | 37 profile_sync_factory_->CreateAppSyncComponents(sync_service_, |
| 37 this); | 38 this); |
| 38 set_model_associator(sync_components.model_associator); | 39 set_model_associator(sync_components.model_associator); |
| 39 set_change_processor(sync_components.change_processor);} | 40 change_processor_.reset(reinterpret_cast<GenericChangeProcessor*>( |
|
akalin
2011/10/11 22:41:08
static_cast
Nicolas Zea
2011/10/12 04:24:19
Done.
| |
| 41 sync_components.change_processor)); | |
| 42 } | |
| 43 | |
| 44 ChangeProcessor* AppDataTypeController::change_processor() const { | |
| 45 return change_processor_.get(); | |
| 46 } | |
| 40 | 47 |
| 41 void AppDataTypeController::RecordUnrecoverableError( | 48 void AppDataTypeController::RecordUnrecoverableError( |
| 42 const tracked_objects::Location& from_here, | 49 const tracked_objects::Location& from_here, |
| 43 const std::string& message) { | 50 const std::string& message) { |
| 44 UMA_HISTOGRAM_COUNTS("Sync.AppRunFailures", 1); | 51 UMA_HISTOGRAM_COUNTS("Sync.AppRunFailures", 1); |
| 45 } | 52 } |
| 46 | 53 |
| 47 void AppDataTypeController::RecordAssociationTime(base::TimeDelta time) { | 54 void AppDataTypeController::RecordAssociationTime(base::TimeDelta time) { |
| 48 UMA_HISTOGRAM_TIMES("Sync.AppAssociationTime", time); | 55 UMA_HISTOGRAM_TIMES("Sync.AppAssociationTime", time); |
| 49 } | 56 } |
| 50 | 57 |
| 51 void AppDataTypeController::RecordStartFailure(StartResult result) { | 58 void AppDataTypeController::RecordStartFailure(StartResult result) { |
| 52 UMA_HISTOGRAM_ENUMERATION("Sync.AppStartFailures", | 59 UMA_HISTOGRAM_ENUMERATION("Sync.AppStartFailures", |
| 53 result, | 60 result, |
| 54 MAX_START_RESULT); | 61 MAX_START_RESULT); |
| 55 } | 62 } |
| 56 | 63 |
| 57 } // namespace browser_sync | 64 } // namespace browser_sync |
| OLD | NEW |