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/search_engine_data_type_controller.h" | 5 #include "chrome/browser/sync/glue/search_engine_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/search_engines/template_url_service.h" | 9 #include "chrome/browser/search_engines/template_url_service.h" |
10 #include "chrome/browser/search_engines/template_url_service_factory.h" | 10 #include "chrome/browser/search_engines/template_url_service_factory.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // Cleanup for our extra registrar usage. | 63 // Cleanup for our extra registrar usage. |
64 void SearchEngineDataTypeController::CleanUpState() { | 64 void SearchEngineDataTypeController::CleanUpState() { |
65 registrar_.RemoveAll(); | 65 registrar_.RemoveAll(); |
66 } | 66 } |
67 | 67 |
68 void SearchEngineDataTypeController::CreateSyncComponents() { | 68 void SearchEngineDataTypeController::CreateSyncComponents() { |
69 ProfileSyncFactory::SyncComponents sync_components = | 69 ProfileSyncFactory::SyncComponents sync_components = |
70 profile_sync_factory_->CreateSearchEngineSyncComponents(sync_service_, | 70 profile_sync_factory_->CreateSearchEngineSyncComponents(sync_service_, |
71 this); | 71 this); |
72 set_model_associator(sync_components.model_associator); | 72 set_model_associator(sync_components.model_associator); |
73 set_change_processor(sync_components.change_processor); | 73 change_processor_.reset(reinterpret_cast<GenericChangeProcessor*>( |
| 74 sync_components.change_processor)); |
| 75 } |
| 76 |
| 77 ChangeProcessor* SearchEngineDataTypeController::change_processor() const { |
| 78 return change_processor_.get(); |
74 } | 79 } |
75 | 80 |
76 void SearchEngineDataTypeController::RecordUnrecoverableError( | 81 void SearchEngineDataTypeController::RecordUnrecoverableError( |
77 const tracked_objects::Location& from_here, | 82 const tracked_objects::Location& from_here, |
78 const std::string& message) { | 83 const std::string& message) { |
79 UMA_HISTOGRAM_COUNTS("Sync.SearchEngineRunFailures", 1); | 84 UMA_HISTOGRAM_COUNTS("Sync.SearchEngineRunFailures", 1); |
80 } | 85 } |
81 | 86 |
82 void SearchEngineDataTypeController::RecordAssociationTime( | 87 void SearchEngineDataTypeController::RecordAssociationTime( |
83 base::TimeDelta time) { | 88 base::TimeDelta time) { |
84 UMA_HISTOGRAM_TIMES("Sync.SearchEngineAssociationTime", time); | 89 UMA_HISTOGRAM_TIMES("Sync.SearchEngineAssociationTime", time); |
85 } | 90 } |
86 | 91 |
87 void SearchEngineDataTypeController::RecordStartFailure(StartResult result) { | 92 void SearchEngineDataTypeController::RecordStartFailure(StartResult result) { |
88 UMA_HISTOGRAM_ENUMERATION("Sync.SearchEngineStartFailures", | 93 UMA_HISTOGRAM_ENUMERATION("Sync.SearchEngineStartFailures", |
89 result, | 94 result, |
90 MAX_START_RESULT); | 95 MAX_START_RESULT); |
91 } | 96 } |
92 | 97 |
93 } // namespace browser_sync | 98 } // namespace browser_sync |
OLD | NEW |