| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/feedback/system_logs/log_sources/chrome_internal_log_so
urce.h" | 5 #include "chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_so
urce.h" |
| 6 | 6 |
| 7 #include "base/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 void ChromeInternalLogSource::PopulateSyncLogs(SystemLogsResponse* response) { | 79 void ChromeInternalLogSource::PopulateSyncLogs(SystemLogsResponse* response) { |
| 80 // We are only interested in sync logs for the primary user profile. | 80 // We are only interested in sync logs for the primary user profile. |
| 81 Profile* profile = ProfileManager::GetPrimaryUserProfile(); | 81 Profile* profile = ProfileManager::GetPrimaryUserProfile(); |
| 82 if (!profile || | 82 if (!profile || |
| 83 !ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService(profile)) | 83 !ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService(profile)) |
| 84 return; | 84 return; |
| 85 | 85 |
| 86 ProfileSyncService* service = | 86 ProfileSyncService* service = |
| 87 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); | 87 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); |
| 88 scoped_ptr<base::DictionaryValue> sync_logs( | 88 scoped_ptr<base::DictionaryValue> sync_logs( |
| 89 sync_ui_util::ConstructAboutInformation( | 89 sync_driver::ConstructAboutInformation(service, service->signin(), |
| 90 service, service->signin(), chrome::GetChannel())); | 90 chrome::GetChannel())); |
| 91 | 91 |
| 92 // Remove identity section. | 92 // Remove identity section. |
| 93 base::ListValue* details = NULL; | 93 base::ListValue* details = NULL; |
| 94 sync_logs->GetList(kDetailsKey, &details); | 94 sync_logs->GetList(sync_driver::kDetailsKey, &details); |
| 95 if (!details) | 95 if (!details) |
| 96 return; | 96 return; |
| 97 for (base::ListValue::iterator it = details->begin(); | 97 for (base::ListValue::iterator it = details->begin(); |
| 98 it != details->end(); ++it) { | 98 it != details->end(); ++it) { |
| 99 base::DictionaryValue* dict = NULL; | 99 base::DictionaryValue* dict = NULL; |
| 100 if ((*it)->GetAsDictionary(&dict)) { | 100 if ((*it)->GetAsDictionary(&dict)) { |
| 101 std::string title; | 101 std::string title; |
| 102 dict->GetString("title", &title); | 102 dict->GetString("title", &title); |
| 103 if (title == kIdentityTitle) { | 103 if (title == sync_driver::kIdentityTitle) { |
| 104 details->Erase(it, NULL); | 104 details->Erase(it, NULL); |
| 105 break; | 105 break; |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 | 109 |
| 110 // Add sync logs to logs. | 110 // Add sync logs to logs. |
| 111 std::string sync_logs_string; | 111 std::string sync_logs_string; |
| 112 JSONStringValueSerializer serializer(&sync_logs_string); | 112 JSONStringValueSerializer serializer(&sync_logs_string); |
| 113 serializer.Serialize(*sync_logs.get()); | 113 serializer.Serialize(*sync_logs.get()); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 SystemLogsResponse* response) { | 159 SystemLogsResponse* response) { |
| 160 std::string reason; | 160 std::string reason; |
| 161 bool result = base::win::IsKeyboardPresentOnSlate(&reason); | 161 bool result = base::win::IsKeyboardPresentOnSlate(&reason); |
| 162 (*response)[kUsbKeyboardDetected] = result ? "Keyboard Detected:\n" : | 162 (*response)[kUsbKeyboardDetected] = result ? "Keyboard Detected:\n" : |
| 163 "No Keyboard:\n"; | 163 "No Keyboard:\n"; |
| 164 (*response)[kUsbKeyboardDetected] += reason; | 164 (*response)[kUsbKeyboardDetected] += reason; |
| 165 } | 165 } |
| 166 #endif | 166 #endif |
| 167 | 167 |
| 168 } // namespace system_logs | 168 } // namespace system_logs |
| OLD | NEW |