Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Add whether data reduction proxy is enabled to feedback logs.
Browse files Browse the repository at this point in the history
BUG=436669

Review URL: https://codereview.chromium.org/760803002

Cr-Commit-Position: refs/heads/master@{#306308}
(cherry picked from commit 1a6e763)

Review URL: https://codereview.chromium.org/777523002

Cr-Commit-Position: refs/branch-heads/2214@{#190}
Cr-Branched-From: 03655fd-refs/heads/master@{#303346}
  • Loading branch information
Ben Greenstein committed Dec 3, 2014
1 parent 394b59e commit 2220d93
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h"

#include "base/json/json_string_value_serializer.h"
#include "base/prefs/pref_service.h"
#include "base/sys_info.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/extension_service.h"
Expand All @@ -13,6 +14,7 @@
#include "chrome/browser/sync/about_sync_util.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/common/chrome_version_info.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension.h"
Expand All @@ -23,6 +25,7 @@ namespace {

const char kSyncDataKey[] = "about_sync_data";
const char kExtensionsListKey[] = "extensions";
const char kDataReductionProxyKey[] = "data_reduction_proxy";
const char kChromeVersionTag[] = "CHROME VERSION";
#if !defined(OS_CHROMEOS)
const char kOsVersionTag[] = "OS VERSION";
Expand Down Expand Up @@ -57,6 +60,7 @@ void ChromeInternalLogSource::Fetch(const SysLogsSourceCallback& callback) {

PopulateSyncLogs(&response);
PopulateExtensionInfoLogs(&response);
PopulateDataReductionProxyLogs(&response);

callback.Run(&response);
}
Expand Down Expand Up @@ -133,4 +137,15 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs(
(*response)[kExtensionsListKey] = extensions_list;
}

void ChromeInternalLogSource::PopulateDataReductionProxyLogs(
SystemLogsResponse* response) {
PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs();
bool is_data_reduction_proxy_enabled = prefs->HasPrefPath(
data_reduction_proxy::prefs::kDataReductionProxyEnabled) &&
prefs->GetBoolean(
data_reduction_proxy::prefs::kDataReductionProxyEnabled);
(*response)[kDataReductionProxyKey] = is_data_reduction_proxy_enabled ?
"enabled" : "disabled";
}

} // namespace system_logs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class ChromeInternalLogSource : public SystemLogsSource {
private:
void PopulateSyncLogs(SystemLogsResponse* response);
void PopulateExtensionInfoLogs(SystemLogsResponse* response);
void PopulateDataReductionProxyLogs(SystemLogsResponse* response);

DISALLOW_COPY_AND_ASSIGN(ChromeInternalLogSource);
};
Expand Down

0 comments on commit 2220d93

Please sign in to comment.