-
Notifications
You must be signed in to change notification settings - Fork 909
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
Add brave::IsRegularProfile to exclude Tor profiles and guest sessions too #6608
Conversation
@@ -10,6 +10,7 @@ | |||
#include <utility> | |||
|
|||
#include "brave/browser/ui/brave_actions/brave_action_icon_with_badge_image_source.h" | |||
#include "brave/browser/profiles/profile_util.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.
nit: order
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.
Thanks, I'll force-push fix & skip CI right before merging.
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.
Sorry, I forgot to push this before merging, I'll do a quick follow-up fix on this.
@@ -357,8 +357,7 @@ void AdsServiceImpl::OnTabUpdated( | |||
return; | |||
} | |||
|
|||
const bool is_incognito = profile_->IsOffTheRecord() || | |||
brave::IsTorProfile(profile_); | |||
const bool is_incognito = !brave::IsRegularProfile(profile_); |
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.
nit: Hmm, this will work as expected but I think this could make some confusing because non incogito profile could be false from brave::IsRegularProfile()
.
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.
I would like to do a minimum changes on original code here, maybe @tmancey could suggest what's preferred here and we could do a small quick follow-up on 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.
IMO, using is_regular
seems more clear.
and calling bat_ads_->OnTabUpdated(tab_id.id(), url.spec(), is_active, is_browser_active, is_regular);
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.
Actually I'm a bit confused why bat_ads_ need to take is_incognito param at all, why do we expect this function to be executed if we don't expect to create ads service in incognito profiles in the first place?
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.
Yeah, I also think we don't need to use is_incognito
or replace it with DCHECK.
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.
Yeah, I think it might be better to separate this small piece out into a separate PR to keep this one simple and focused.
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.
Agreed this is legacy code which is no longer needed. We already have a DCHECK
. I have raised brave/brave-browser#11648. Thanks
only CI failure is test-install on Windows platform which is unrelated to this PR. |
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.
rewards code looks good
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.
LGTM++
Resolves brave/brave-browser#11218
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.