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