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/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 4944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4955 } else { | 4955 } else { |
4956 ProfileSyncService* service = sync_waiter_->service(); | 4956 ProfileSyncService* service = sync_waiter_->service(); |
4957 ProfileSyncService::Status status = sync_waiter_->GetStatus(); | 4957 ProfileSyncService::Status status = sync_waiter_->GetStatus(); |
4958 sync_info->SetString("summary", | 4958 sync_info->SetString("summary", |
4959 ProfileSyncService::BuildSyncStatusSummaryText(status.summary)); | 4959 ProfileSyncService::BuildSyncStatusSummaryText(status.summary)); |
4960 sync_info->SetString("sync url", service->sync_service_url().host()); | 4960 sync_info->SetString("sync url", service->sync_service_url().host()); |
4961 sync_info->SetBoolean("authenticated", status.authenticated); | 4961 sync_info->SetBoolean("authenticated", status.authenticated); |
4962 sync_info->SetString("last synced", service->GetLastSyncedTimeString()); | 4962 sync_info->SetString("last synced", service->GetLastSyncedTimeString()); |
4963 sync_info->SetInteger("updates received", status.updates_received); | 4963 sync_info->SetInteger("updates received", status.updates_received); |
4964 ListValue* synced_datatype_list = new ListValue; | 4964 ListValue* synced_datatype_list = new ListValue; |
4965 syncable::ModelTypeSet synced_datatypes; | 4965 const syncable::ModelEnumSet synced_datatypes = |
4966 service->GetPreferredDataTypes(&synced_datatypes); | 4966 service->GetPreferredDataTypes(); |
4967 for (syncable::ModelTypeSet::iterator it = synced_datatypes.begin(); | 4967 for (syncable::ModelEnumSet::Iterator it = synced_datatypes.First(); |
4968 it != synced_datatypes.end(); ++it) { | 4968 it.Good(); it.Inc()) { |
4969 synced_datatype_list->Append( | 4969 synced_datatype_list->Append( |
4970 new StringValue(syncable::ModelTypeToString(*it))); | 4970 new StringValue(syncable::ModelTypeToString(it.Get()))); |
4971 } | 4971 } |
4972 sync_info->Set("synced datatypes", synced_datatype_list); | 4972 sync_info->Set("synced datatypes", synced_datatype_list); |
4973 } | 4973 } |
4974 return_value->Set("sync_info", sync_info); | 4974 return_value->Set("sync_info", sync_info); |
4975 reply.SendSuccess(return_value.get()); | 4975 reply.SendSuccess(return_value.get()); |
4976 } | 4976 } |
4977 | 4977 |
4978 // Sample json output: { "success": true } | 4978 // Sample json output: { "success": true } |
4979 void TestingAutomationProvider::AwaitFullSyncCompletion( | 4979 void TestingAutomationProvider::AwaitFullSyncCompletion( |
4980 Browser* browser, | 4980 Browser* browser, |
(...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6646 | 6646 |
6647 Send(reply_message_); | 6647 Send(reply_message_); |
6648 redirect_query_ = 0; | 6648 redirect_query_ = 0; |
6649 reply_message_ = NULL; | 6649 reply_message_ = NULL; |
6650 } | 6650 } |
6651 | 6651 |
6652 void TestingAutomationProvider::OnRemoveProvider() { | 6652 void TestingAutomationProvider::OnRemoveProvider() { |
6653 if (g_browser_process) | 6653 if (g_browser_process) |
6654 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6654 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
6655 } | 6655 } |
OLD | NEW |