-
Notifications
You must be signed in to change notification settings - Fork 873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send platform, build channel and country code as part of ad confirmation calls where it meets privacy standards #5067
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* Copyright (c) 2020 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "brave/common/brave_channel_info.h" | ||
|
||
#include "chrome/common/channel_info.h" | ||
|
||
namespace brave { | ||
|
||
std::string GetChannelName() { | ||
#if defined(OFFICIAL_BUILD) | ||
std::string channel_name = chrome::GetChannelName(); | ||
if (channel_name.empty()) { | ||
channel_name = "release"; | ||
} | ||
|
||
return channel_name; | ||
#else // OFFICIAL_BUILD | ||
return "developer"; | ||
#endif // !OFFICIAL_BUILD | ||
} | ||
|
||
} // namespace brave |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* Copyright (c) 2020 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef BRAVE_COMMON_BRAVE_CHANNEL_INFO_H_ | ||
#define BRAVE_COMMON_BRAVE_CHANNEL_INFO_H_ | ||
|
||
#include <string> | ||
|
||
namespace brave { | ||
|
||
std::string GetChannelName(); | ||
|
||
} | ||
|
||
#endif // BRAVE_COMMON_BRAVE_CHANNEL_INFO_H_ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,15 @@ | |
|
||
#include "base/json/json_reader.h" | ||
#include "brave/components/brave_rewards/browser/android_util.h" | ||
#include "brave/common/brave_channel_info.h" | ||
|
||
namespace android_util { | ||
|
||
ledger::ClientInfoPtr GetAndroidClientInfo() { | ||
auto info = ledger::ClientInfo::New(); | ||
info->platform = ledger::Platform::ANDROID_R; | ||
info->os = ledger::OperatingSystem::UNDEFINED; | ||
info->channel = brave::GetChannelName(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when this is fixed to use chrome::GetChannelName the layering violation here needs to be fixed as well. You cannot use brave/common or chrome/common in components There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @aseren FYI for the refactoring we spoke about |
||
return info; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ | |
#include "brave/base/containers/utils.h" | ||
#include "brave/browser/ui/webui/brave_rewards_source.h" | ||
#include "brave/components/brave_rewards/common/pref_names.h" | ||
#include "brave/common/brave_channel_info.h" | ||
#include "brave/common/pref_names.h" | ||
#include "brave/components/brave_ads/browser/ads_service.h" | ||
#include "brave/components/brave_ads/browser/ads_service_factory.h" | ||
|
@@ -3273,6 +3274,8 @@ ledger::ClientInfoPtr GetDesktopClientInfo() { | |
info->os = ledger::OperatingSystem::UNDEFINED; | ||
#endif | ||
|
||
info->channel = brave::GetChannelName(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bridiver raised brave/brave-browser#12769 for Rewards and brave/brave-browser#12768 for Ads |
||
|
||
return info; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ source_set("p3a") { | |
] | ||
|
||
deps = [ | ||
"//brave/common", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is actually a layering violation, but it always has been there :( I'll fix it in some other PR |
||
"//brave/components/p3a:buildflags", | ||
"//brave/components/brave_prochlo", | ||
"//brave/components/brave_prochlo:prochlo_proto", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,11 @@ const uint64_t kRetryDownloadingCatalogAfterSeconds = | |
const std::map<int, std::vector<std::string>> kSupportedRegionsSchemas = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. global objects with non-trivial destructor are prohibited by the style guide (see examples utilizing base::NoDestrutor in the code) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As unrelated to this ticket, I have raised brave/brave-browser#9164, thanks |
||
// Append newly supported regions with a new schema version and update | ||
// |kSupportedRegionsSchemaVersionNumber| to match the new version | ||
|
||
// |kLargeAnonymityCountryCodes| and |kOtherCountryCodes| in | ||
// bat-native-confirmations/src/bat/confirmations/internal/static_values.h | ||
// must be updated to reflect newly supported regions | ||
|
||
// | ||
// Format: { schema_version : { region... } } | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raised brave/brave-browser#9166 to resolve across Brave Ads