| 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/sys_info.h" | 8 #include "base/sys_info.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 void ChromeInternalLogSource::PopulateSyncLogs(SystemLogsResponse* response) { | 136 void ChromeInternalLogSource::PopulateSyncLogs(SystemLogsResponse* response) { |
| 137 // We are only interested in sync logs for the primary user profile. | 137 // We are only interested in sync logs for the primary user profile. |
| 138 Profile* profile = ProfileManager::GetPrimaryUserProfile(); | 138 Profile* profile = ProfileManager::GetPrimaryUserProfile(); |
| 139 if (!profile || | 139 if (!profile || |
| 140 !ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService(profile)) | 140 !ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService(profile)) |
| 141 return; | 141 return; |
| 142 | 142 |
| 143 browser_sync::ProfileSyncService* service = | 143 browser_sync::ProfileSyncService* service = |
| 144 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); | 144 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); |
| 145 std::unique_ptr<base::DictionaryValue> sync_logs( | 145 std::unique_ptr<base::DictionaryValue> sync_logs( |
| 146 sync_driver::sync_ui_util::ConstructAboutInformation( | 146 syncer::sync_ui_util::ConstructAboutInformation( |
| 147 service, service->signin(), chrome::GetChannel())); | 147 service, service->signin(), chrome::GetChannel())); |
| 148 | 148 |
| 149 // Remove identity section. | 149 // Remove identity section. |
| 150 base::ListValue* details = NULL; | 150 base::ListValue* details = NULL; |
| 151 sync_logs->GetList(sync_driver::sync_ui_util::kDetailsKey, &details); | 151 sync_logs->GetList(syncer::sync_ui_util::kDetailsKey, &details); |
| 152 if (!details) | 152 if (!details) |
| 153 return; | 153 return; |
| 154 for (base::ListValue::iterator it = details->begin(); | 154 for (base::ListValue::iterator it = details->begin(); |
| 155 it != details->end(); ++it) { | 155 it != details->end(); ++it) { |
| 156 base::DictionaryValue* dict = NULL; | 156 base::DictionaryValue* dict = NULL; |
| 157 if ((*it)->GetAsDictionary(&dict)) { | 157 if ((*it)->GetAsDictionary(&dict)) { |
| 158 std::string title; | 158 std::string title; |
| 159 dict->GetString("title", &title); | 159 dict->GetString("title", &title); |
| 160 if (title == sync_driver::sync_ui_util::kIdentityTitle) { | 160 if (title == syncer::sync_ui_util::kIdentityTitle) { |
| 161 details->Erase(it, NULL); | 161 details->Erase(it, NULL); |
| 162 break; | 162 break; |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 } | 165 } |
| 166 | 166 |
| 167 // Add sync logs to logs. | 167 // Add sync logs to logs. |
| 168 std::string sync_logs_string; | 168 std::string sync_logs_string; |
| 169 JSONStringValueSerializer serializer(&sync_logs_string); | 169 JSONStringValueSerializer serializer(&sync_logs_string); |
| 170 serializer.Serialize(*sync_logs.get()); | 170 serializer.Serialize(*sync_logs.get()); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 SystemLogsResponse* response) { | 233 SystemLogsResponse* response) { |
| 234 std::string reason; | 234 std::string reason; |
| 235 bool result = base::win::IsKeyboardPresentOnSlate(&reason); | 235 bool result = base::win::IsKeyboardPresentOnSlate(&reason); |
| 236 (*response)[kUsbKeyboardDetected] = result ? "Keyboard Detected:\n" : | 236 (*response)[kUsbKeyboardDetected] = result ? "Keyboard Detected:\n" : |
| 237 "No Keyboard:\n"; | 237 "No Keyboard:\n"; |
| 238 (*response)[kUsbKeyboardDetected] += reason; | 238 (*response)[kUsbKeyboardDetected] += reason; |
| 239 } | 239 } |
| 240 #endif | 240 #endif |
| 241 | 241 |
| 242 } // namespace system_logs | 242 } // namespace system_logs |
| OLD | NEW |