-
Notifications
You must be signed in to change notification settings - Fork 921
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
Deprecate in favor of navigator.brave.isBrave() #5831
Conversation
404295c
to
9eb7851
Compare
navigator.brave.isBrave() can be used to identify brave. Resolves brave/brave-browser#6041
9eb7851
to
8aa730b
Compare
I think there is a tiny left-over: the headers download URL fragment |
@@ -44,11 +44,6 @@ class BraveReferralsService { | |||
void SetReferralInitializedCallbackForTest( | |||
ReferralInitializedCallback referral_initialized_callback); | |||
|
|||
static bool GetMatchingReferralHeaders( |
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.
please also check obsolete headers - e.g. it seems base/values.h
and url/gurl.h
are now unneeded
@@ -99,7 +83,6 @@ class BraveReferralsService { | |||
std::unique_ptr<network::SimpleURLLoader> referral_init_loader_; | |||
std::unique_ptr<network::SimpleURLLoader> referral_finalization_check_loader_; | |||
std::unique_ptr<base::OneShotTimer> initialization_timer_; | |||
std::unique_ptr<base::RepeatingTimer> fetch_referral_headers_timer_; |
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.
also remove referral_headers_loader_
continue; | ||
} | ||
for (const auto& domain_value : domains_list->GetList()) { | ||
URLPattern url_pattern(URLPattern::SCHEME_HTTPS | |
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.
header for this is also not needed, probably there are others
@@ -116,7 +116,6 @@ test("brave_unit_tests") { | |||
"//brave/chromium_src/components/variations/service/field_trial_unittest.cc", | |||
"//brave/chromium_src/components/version_info/brave_version_info_unittest.cc", | |||
"//brave/chromium_src/net/cookies/brave_canonical_cookie_unittest.cc", | |||
"//brave/chromium_src/services/network/public/cpp/cors/cors_unittest.cc", |
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.
probably now can drop
"//services/network/public/cpp:cpp",
"//services/network:test_support",
from deps
// rewards service. Eliminating this will also help to avoid using | ||
// PrefChangeRegistrar and corresponding |base::Unretained| usages, that are | ||
// illegal. | ||
std::unique_ptr<base::ListValue> referral_headers_list_; | ||
std::map<uint64_t, net::CompletionOnceCallback> callbacks_; | ||
std::unique_ptr<PrefChangeRegistrar, content::BrowserThread::DeleteOnUIThread> |
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.
drop this
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.
also forward declaration for PrefChangeRegistrar
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.
and #include "content/public/browser/browser_thread.h"
@@ -47,8 +47,6 @@ class BraveRequestHandler { | |||
|
|||
private: | |||
void SetupCallbacks(); | |||
void InitPrefChangeRegistrar(); | |||
void OnReferralHeadersChanged(); | |||
void OnPreferenceChanged(const std::string& pref_name); |
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.
unrelated to this PR, but OnPreferenceChanged
and UpdateAdBlockFromPref
do not exist in .cc so also can be erased :)
@@ -17,7 +17,6 @@ | |||
#include "brave/browser/net/brave_stp_util.h" | |||
#include "brave/browser/translate/buildflags/buildflags.h" | |||
#include "brave/common/pref_names.h" | |||
#include "brave/components/brave_referrals/buildflags/buildflags.h" | |||
#include "brave/components/brave_rewards/browser/buildflags/buildflags.h" | |||
#include "brave/components/brave_webtorrent/browser/buildflags/buildflags.h" | |||
#include "chrome/browser/browser_process.h" |
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.
not used now, also pref_change_registrar.h
pref_service.h
, probably pref_names.h
] | ||
|
||
deps += [ | ||
"//brave/components/brave_referrals/browser", |
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.
also import("//brave/components/brave_referrals/buildflags/buildflags.gni")
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.
also "//brave/components/brave_referrals/buildflags",
We're going to have to leave these in for the moment as some Brave partners haven't updated to use the navigator.brave.isBrave method. Let's keep an eye on https://github.com/brave/brave-browser/wiki/Custom-Headers which should be getting updated as partners make progress |
@bsclifton Since no new partners will sign up and the partner list is known, is it possible to at least remove the data fetch logic and cookie insertion logic? That's the part that makes me the most uncomfortable. |
@bershanskiy that's a good suggestion - @bbondy what do you think about removing the service call and having the list hard-coded (as we won't be adding to it)? |
I would love to see the list fully removed but it will require working with @lukemulks and others on a case by case basis until the list is empty. |
Resolves brave/brave-browser#6041
Resolves
Submitter Checklist:
npm run lint
)git rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
After-merge Checklist:
changes has landed on.