Commit 0a8c34a3 authored by Varun Khaneja's avatar Varun Khaneja Committed by Commit Bot

Set profile management status in CSD pings.

Works for Windows users only, at the moment.
Next: Make it work for Chrome OS users.

Bug: 796332
Change-Id: I1a14597851aaa239b15620c1f0444357176345a1
Reviewed-on: https://chromium-review.googlesource.com/1055940Reviewed-by: default avatarJialiu Lin <jialiul@chromium.org>
Commit-Queue: Varun Khaneja <vakh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558043}
parent d225483d
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/safe_browsing/common/safe_browsing.mojom.h" #include "components/safe_browsing/common/safe_browsing.mojom.h"
#include "components/safe_browsing/common/safe_browsing_prefs.h" #include "components/safe_browsing/common/safe_browsing_prefs.h"
#include "components/safe_browsing/common/utils.h"
#include "components/safe_browsing/proto/csd.pb.h" #include "components/safe_browsing/proto/csd.pb.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_service.h"
...@@ -295,6 +296,9 @@ void ClientSideDetectionService::StartClientReportPhishingRequest( ...@@ -295,6 +296,9 @@ void ClientSideDetectionService::StartClientReportPhishingRequest(
} }
DVLOG(2) << "Starting report for hit on model " << request->model_filename(); DVLOG(2) << "Starting report for hit on model " << request->model_filename();
request->mutable_population()->set_profile_management_status(
GetProfileManagementStatus());
std::string request_data; std::string request_data;
if (!request->SerializeToString(&request_data)) { if (!request->SerializeToString(&request_data)) {
UMA_HISTOGRAM_COUNTS("SBClientPhishing.RequestNotSerialized", 1); UMA_HISTOGRAM_COUNTS("SBClientPhishing.RequestNotSerialized", 1);
......
...@@ -861,6 +861,8 @@ void CheckClientDownloadRequest::SendRequest() { ...@@ -861,6 +861,8 @@ void CheckClientDownloadRequest::SendRequest() {
? ChromeUserPopulation::EXTENDED_REPORTING ? ChromeUserPopulation::EXTENDED_REPORTING
: ChromeUserPopulation::SAFE_BROWSING; : ChromeUserPopulation::SAFE_BROWSING;
request.mutable_population()->set_user_population(population); request.mutable_population()->set_user_population(population);
request.mutable_population()->set_profile_management_status(
GetProfileManagementStatus());
request.set_url(SanitizeUrl(item_->GetUrlChain().back())); request.set_url(SanitizeUrl(item_->GetUrlChain().back()));
request.mutable_digests()->set_sha256(item_->GetHash()); request.mutable_digests()->set_sha256(item_->GetHash());
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "chrome/browser/sessions/session_tab_helper.h" #include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/common/safe_browsing/file_type_policies.h" #include "chrome/common/safe_browsing/file_type_policies.h"
#include "components/data_use_measurement/core/data_use_user_data.h" #include "components/data_use_measurement/core/data_use_user_data.h"
#include "components/safe_browsing/common/utils.h"
#include "components/safe_browsing/db/database_manager.h" #include "components/safe_browsing/db/database_manager.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
...@@ -166,6 +167,8 @@ void PPAPIDownloadRequest::SendRequest() { ...@@ -166,6 +167,8 @@ void PPAPIDownloadRequest::SendRequest() {
? ChromeUserPopulation::EXTENDED_REPORTING ? ChromeUserPopulation::EXTENDED_REPORTING
: ChromeUserPopulation::SAFE_BROWSING; : ChromeUserPopulation::SAFE_BROWSING;
request.mutable_population()->set_user_population(population); request.mutable_population()->set_user_population(population);
request.mutable_population()->set_profile_management_status(
GetProfileManagementStatus());
request.set_download_type(ClientDownloadRequest::PPAPI_SAVE_REQUEST); request.set_download_type(ClientDownloadRequest::PPAPI_SAVE_REQUEST);
ClientDownloadRequest::Resource* resource = request.add_resources(); ClientDownloadRequest::Resource* resource = request.add_resources();
resource->set_type(ClientDownloadRequest::PPAPI_DOCUMENT); resource->set_type(ClientDownloadRequest::PPAPI_DOCUMENT);
......
...@@ -25,6 +25,7 @@ source_set("password_protection") { ...@@ -25,6 +25,7 @@ source_set("password_protection") {
"//components/password_manager/core/browser:browser", "//components/password_manager/core/browser:browser",
"//components/safe_browsing:csd_proto", "//components/safe_browsing:csd_proto",
"//components/safe_browsing:features", "//components/safe_browsing:features",
"//components/safe_browsing/common:common",
"//components/safe_browsing/common:safe_browsing_prefs", "//components/safe_browsing/common:safe_browsing_prefs",
"//components/safe_browsing/db:database_manager", "//components/safe_browsing/db:database_manager",
"//components/safe_browsing/db:v4_protocol_manager_util", "//components/safe_browsing/db:v4_protocol_manager_util",
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/history/core/browser/history_service.h" #include "components/history/core/browser/history_service.h"
#include "components/password_manager/core/browser/password_reuse_detector.h" #include "components/password_manager/core/browser/password_reuse_detector.h"
#include "components/safe_browsing/common/utils.h"
#include "components/safe_browsing/db/database_manager.h" #include "components/safe_browsing/db/database_manager.h"
#include "components/safe_browsing/db/whitelist_checker_client.h" #include "components/safe_browsing/db/whitelist_checker_client.h"
#include "components/safe_browsing/features.h" #include "components/safe_browsing/features.h"
...@@ -551,6 +552,7 @@ void PasswordProtectionService::FillUserPopulation( ...@@ -551,6 +552,7 @@ void PasswordProtectionService::FillUserPopulation(
user_population->set_user_population( user_population->set_user_population(
IsExtendedReporting() ? ChromeUserPopulation::EXTENDED_REPORTING IsExtendedReporting() ? ChromeUserPopulation::EXTENDED_REPORTING
: ChromeUserPopulation::SAFE_BROWSING); : ChromeUserPopulation::SAFE_BROWSING);
user_population->set_profile_management_status(GetProfileManagementStatus());
user_population->set_is_history_sync_enabled(IsHistorySyncEnabled()); user_population->set_is_history_sync_enabled(IsHistorySyncEnabled());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment