-
Notifications
You must be signed in to change notification settings - Fork 868
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
Fixed navigation bar color at private tab #25923
Fixed navigation bar color at private tab #25923
Conversation
…41545 Chromium change: https://source.chromium.org/chromium/chromium/src/+/52962da478ed750038f966c386c4ee0ff2d73837 Always apply luminance calculation to navigation bar icons Currently, the navigation bar icons only respond to the color of the navigation bar during animations. Since animations are being disabled for the navbar coloring experiment, it's important that the luminance calculation to properly color the navigation bar icons is applied all the time, not just during animations. Bug: 364228106, 40925025
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
@@ -34,7 +37,11 @@ public int getNavigationBarColor(boolean forceDarkNavigationBar) { | |||
if (BottomToolbarConfiguration.isBottomToolbarEnabled() | |||
&& BraveMenuButtonCoordinator.isMenuFromBottom() | |||
&& mContext != null) { | |||
return mContext.getColor(R.color.default_bg_color_baseline); | |||
if (mTabModelSelector.isIncognitoSelected()) { |
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.
We should think of how to detect whether they deleted/renamed this variable in the upstream. Same applies to mContext
. In any case we should treat variable that we deleted in the bytecode from the upstream's code as Nullable
.
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.
@samartnik
by my understanding the bytecode test does it
assert.assertFalse(fieldExists("org/chromium/chrome/browser/tabbed_mode/TabbedNavigationBarColorController","mTabModelSelector"));
oh, that's assertFalse(fieldExists())
, so it is applied after asm patching and we indeed can miss the upstream change then.
I think it is possible to add some degree of robust if we will change BraveClassVisitor
so it will warn if the specified modification hadn't triggered.
I remember the cases from the past when build succeeded but my bytecode patch wasn't applied because I didn't specified the correct .jar
file.
Created an issue brave/brave-browser#41548
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 I need to check mTabModelSelector
for null
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 fixed at d76aa8a
We should think of how to detect whether they deleted/renamed this variable in the upstream.
maybe we could check for null and if it is, then call DumpWithoutCrashing / reportException
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.
👍 Changes look good!
Thank you for fixing this!
a15ac1b
to
d76aa8a
Compare
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. Thank you @AlexeyBarabash
Released in v1.73.7 |
Resolves brave/brave-browser#41545
This PR fixes issue with the navigation bar color for private tab.
Color is used from @simoarpe 's upcoming PR c972bdd
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: