| 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 <memory> |
| 8 #include <string> |
| 9 |
| 7 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
| 8 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 9 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
| 10 #include "base/task_scheduler/post_task.h" | 13 #include "base/task_scheduler/post_task.h" |
| 11 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 12 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/google/google_brand.h" | 16 #include "chrome/browser/google/google_brand.h" |
| 14 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
| 15 #include "chrome/browser/sync/profile_sync_service_factory.h" | 18 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 16 #include "chrome/common/channel_info.h" | 19 #include "chrome/common/channel_info.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 void ChromeInternalLogSource::PopulateSyncLogs(SystemLogsResponse* response) { | 165 void ChromeInternalLogSource::PopulateSyncLogs(SystemLogsResponse* response) { |
| 163 // We are only interested in sync logs for the primary user profile. | 166 // We are only interested in sync logs for the primary user profile. |
| 164 Profile* profile = ProfileManager::GetPrimaryUserProfile(); | 167 Profile* profile = ProfileManager::GetPrimaryUserProfile(); |
| 165 if (!profile || | 168 if (!profile || |
| 166 !ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService(profile)) | 169 !ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService(profile)) |
| 167 return; | 170 return; |
| 168 | 171 |
| 169 browser_sync::ProfileSyncService* service = | 172 browser_sync::ProfileSyncService* service = |
| 170 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); | 173 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); |
| 171 std::unique_ptr<base::DictionaryValue> sync_logs( | 174 std::unique_ptr<base::DictionaryValue> sync_logs( |
| 172 syncer::sync_ui_util::ConstructAboutInformation( | 175 syncer::sync_ui_util::ConstructAboutInformation(service, |
| 173 service, service->signin(), chrome::GetChannel())); | 176 chrome::GetChannel())); |
| 174 | 177 |
| 175 // Remove identity section. | 178 // Remove identity section. |
| 176 base::ListValue* details = NULL; | 179 base::ListValue* details = NULL; |
| 177 sync_logs->GetList(syncer::sync_ui_util::kDetailsKey, &details); | 180 sync_logs->GetList(syncer::sync_ui_util::kDetailsKey, &details); |
| 178 if (!details) | 181 if (!details) |
| 179 return; | 182 return; |
| 180 for (base::ListValue::iterator it = details->begin(); | 183 for (base::ListValue::iterator it = details->begin(); |
| 181 it != details->end(); ++it) { | 184 it != details->end(); ++it) { |
| 182 base::DictionaryValue* dict = NULL; | 185 base::DictionaryValue* dict = NULL; |
| 183 if (it->GetAsDictionary(&dict)) { | 186 if (it->GetAsDictionary(&dict)) { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 void ChromeInternalLogSource::PopulateInstallerBrandCode( | 298 void ChromeInternalLogSource::PopulateInstallerBrandCode( |
| 296 SystemLogsResponse* response) { | 299 SystemLogsResponse* response) { |
| 297 std::string brand; | 300 std::string brand; |
| 298 google_brand::GetBrand(&brand); | 301 google_brand::GetBrand(&brand); |
| 299 response->emplace(kInstallerBrandCode, | 302 response->emplace(kInstallerBrandCode, |
| 300 brand.empty() ? "Unknown brand code" : brand); | 303 brand.empty() ? "Unknown brand code" : brand); |
| 301 } | 304 } |
| 302 #endif | 305 #endif |
| 303 | 306 |
| 304 } // namespace system_logs | 307 } // namespace system_logs |
| OLD | NEW |