| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/ui/webui/sync_internals/sync_internals_message_hand
ler.h" | 5 #include "ios/chrome/browser/ui/webui/sync_internals/sync_internals_message_hand
ler.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "components/browser_sync/profile_sync_service.h" | 10 #include "components/browser_sync/profile_sync_service.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 void SyncInternalsMessageHandler::OnUpdateCountersUpdated( | 179 void SyncInternalsMessageHandler::OnUpdateCountersUpdated( |
| 180 syncer::ModelType type, | 180 syncer::ModelType type, |
| 181 const syncer::UpdateCounters& counters) { | 181 const syncer::UpdateCounters& counters) { |
| 182 EmitCounterUpdate(type, sync_driver::sync_ui_util::kUpdate, | 182 EmitCounterUpdate(type, sync_driver::sync_ui_util::kUpdate, |
| 183 counters.ToValue()); | 183 counters.ToValue()); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void SyncInternalsMessageHandler::OnStatusCountersUpdated( | 186 void SyncInternalsMessageHandler::OnStatusCountersUpdated( |
| 187 syncer::ModelType type, | 187 syncer::ModelType type, |
| 188 const syncer::StatusCounters& counters) { | 188 std::unique_ptr<syncer::StatusCounters> counters) { |
| 189 EmitCounterUpdate(type, sync_driver::sync_ui_util::kStatus, | 189 EmitCounterUpdate(type, sync_driver::sync_ui_util::kStatus, |
| 190 counters.ToValue()); | 190 counters->ToValue()); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void SyncInternalsMessageHandler::EmitCounterUpdate( | 193 void SyncInternalsMessageHandler::EmitCounterUpdate( |
| 194 syncer::ModelType type, | 194 syncer::ModelType type, |
| 195 const std::string& counter_type, | 195 const std::string& counter_type, |
| 196 std::unique_ptr<base::DictionaryValue> value) { | 196 std::unique_ptr<base::DictionaryValue> value) { |
| 197 std::unique_ptr<base::DictionaryValue> details(new base::DictionaryValue()); | 197 std::unique_ptr<base::DictionaryValue> details(new base::DictionaryValue()); |
| 198 details->SetString(sync_driver::sync_ui_util::kModelType, | 198 details->SetString(sync_driver::sync_ui_util::kModelType, |
| 199 ModelTypeToString(type)); | 199 ModelTypeToString(type)); |
| 200 details->SetString(sync_driver::sync_ui_util::kCounterType, counter_type); | 200 details->SetString(sync_driver::sync_ui_util::kCounterType, counter_type); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 228 *value); | 228 *value); |
| 229 } | 229 } |
| 230 | 230 |
| 231 // Gets the SyncService of the underlying original profile. May return null. | 231 // Gets the SyncService of the underlying original profile. May return null. |
| 232 sync_driver::SyncService* SyncInternalsMessageHandler::GetSyncService() { | 232 sync_driver::SyncService* SyncInternalsMessageHandler::GetSyncService() { |
| 233 ios::ChromeBrowserState* browser_state = | 233 ios::ChromeBrowserState* browser_state = |
| 234 ios::ChromeBrowserState::FromWebUIIOS(web_ui()); | 234 ios::ChromeBrowserState::FromWebUIIOS(web_ui()); |
| 235 return IOSChromeProfileSyncServiceFactory::GetForBrowserState( | 235 return IOSChromeProfileSyncServiceFactory::GetForBrowserState( |
| 236 browser_state->GetOriginalChromeBrowserState()); | 236 browser_state->GetOriginalChromeBrowserState()); |
| 237 } | 237 } |
| OLD | NEW |