-
Notifications
You must be signed in to change notification settings - Fork 867
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
Brave news android #11121
Brave news android #11121
Conversation
139d164
to
606e9db
Compare
#if BUILDFLAG(ENABLE_BRAVE_NEWS) && defined(OS_ANDROID) | ||
base::FEATURE_ENABLED_BY_DEFAULT | ||
#else | ||
base::FEATURE_DISABLED_BY_DEFAULT | ||
#endif |
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.
Is this intentional to enable by default on Androiid?
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.
yes, i thought so since we will be keeping it in Nightly for now. @petemill does this look ok to you?
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.
perhaps we should disable them by default and enable in nightly channel via griffin only?
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.
yes, how about this:
Enable by default for non-android (i.e. desktop)
Enable by default for local / non-official build (for android local development)
Disable by default for android
we will then enable on android nightly via griffin
Please manually test with flag on and off to check NTP doesn't crash.
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.
done
...e-ads/src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_v1.cc
Outdated
Show resolved
Hide resolved
...e-ads/src/bat/ads/internal/eligible_ads/inline_content_ads/eligible_inline_content_ads_v1.cc
Outdated
Show resolved
Hide resolved
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.
See comments. Thanks
android/java/org/chromium/chrome/browser/app/BraveActivity.java
Outdated
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/brave_news/BraveNewsAdapterFeedCard.java
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/brave_news/BraveNewsBottomSheetDialogFragment.java
Outdated
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/settings/BraveAddNewsSources.java
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/settings/BraveAddNewsSources.java
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/settings/BraveNewsCategorySources.java
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/ntp_background_images/util/NTPUtil.java
Outdated
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java
Outdated
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java
Outdated
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java
Outdated
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/brave_news/models/FeedItemsCard.java
Outdated
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java
Outdated
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/brave_news/models/FeedItemCard.java
Outdated
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/app/BraveActivity.java
Outdated
Show resolved
Hide resolved
android/java/org/chromium/chrome/browser/app/BraveActivity.java
Outdated
Show resolved
Hide resolved
cccad1f
to
ffc56b0
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.
++
looking forward to see it on Nightly
61a4a0a
to
ca7b719
Compare
The latest merge commit seemed to combine 2 duplicate branches and a merge commit of master. It resulted in reverted some needed code. The android build failure in CI was the desktop NTP WebUI compile failing due to the removal of the mojom dep. I fixed the duplicate commit issues by creating a new squashed commit on master (making sure to preserve your "author" status @alexsafe!). Code differences (which should be the fixes) can be seen here: |
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.
Great work @alexsafe for getting every facet of this feature for Android working well! It was fun working with you on it. Once CI is ✅ we should be good to merge.
ca7b719
to
79667db
Compare
Feature flag is favored over buildflag now, so remove it from remaining places.
79667db
to
9fab483
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 for //chromium_src/chrome/browser/flags/android/chrome_feature_list.cc
Note: these cases are to ensure that there's no obvious regressions via NTP when Brave News is disabled. The reason for this check is that Brave News is staying on Nightly so we need to ensure that once channel migrations occur and the code moves into
|
News Disabled |
News Disabled |
---|---|
News Enabled |
News Enabled |
---|---|
News Disabled |
News Enabled |
---|---|
Verified the below items using Asus Zenfone (x86) with Android 6 running 1.34.43
Bravex86.apk:
- ensured that Brave News isn't available/visible under NTP (attempt to scroll down and ensure it's not possible)
- ensured that NTP loads without any issues (no NTP SI on x86 devices)
- ensured that tapping on the image attribution links at the bottom correctly loads within the same tab (note: I only got one NTP image, even though my component says it's up to date)
- ensured that you can switch between the
Top Sites
&Privacy Stats
widget stacks without any issues - ensured that
Brave News
isn't being displayed when tapping on theHamburger Menu
- ensured that
Brave News
isn't being displayed underSettings
via theFeatures
section
Verification passed on Brave v1.34.43 on Samsung s7 (Android 8.0).
- ensured that Brave News isn't available/visible under NTP (attempt to scroll down and ensure it's not possible)
- enusred that NTP & NTP-SI load without any issues
- ensured that tapping on the logos under NTP-SI correctly loads the sponsored website within the same tab without any issues
- ensured that tapping on the image attribution links at the bottom correctly loads within the same tab (note: some are pointing to https://community.brave.com)
- ensured that you can switch between the
Top Sites
&Privacy Stats
widget stacks without any issues - ensured that
Brave News
isn't being displayed when tapping on theHamburger Menu
- ensured that
Brave News
isn't being displayed underSettings
via theFeatures
section
@@ -29,6 +29,21 @@ BraveNewsController* BraveNewsControllerFactory::GetForContext( | |||
GetInstance()->GetServiceForBrowserContext(context, true)); | |||
} | |||
|
|||
// static | |||
mojo::PendingRemote<mojom::BraveNewsController> | |||
BraveNewsControllerFactory::GetRemoteService(content::BrowserContext* context) { |
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.
GetForContext
should return the pending remote, GetRemoteService
should go away and GetControllerForContext
duplicates the existing GetForContext
so I don't understand why it was added. I see // Wire up JS mojom to service
in BraveNewTabUI
so GetControllerForContext
can be a private method with a friend class for BraveNewTabUI
until that is updated
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, not GetControllerForContext
because BraveNewsControllerFactory
-> BraveNewsServiceFactory
, but a private GetServiceForContext
that returns the raw pointer is ok for now until BraveNewTabUI
is updated to use the mojo interface directly
@@ -0,0 +1,21 @@ | |||
source_set("brave_news") { | |||
sources = [ | |||
"brave_news_controller_factory.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.
this should be BraveNewsService
/BraveNewsServiceFactory
Resolves brave/brave-browser#16398
Contains the android implementation for Brave news using the mojom service.
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
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Figma for news: https://www.figma.com/file/vXS7viFBwQH9YlPwZDGCAT/Mobile-Brave-News?node-id=192%3A1391
Specs: https://docs.google.com/document/d/1X9lA00zHa8pKol63i0O23LA4UcSHDYoagIOH2DqwljI/edit#heading=h.6xjamuox37y8
There might be some intentional discrepancies between the docs/design and the implementation.
IMPORTANT! The feature is under a flag and is planned to be kept in Nightly for now. It can be managed from brave://flags .Please make sure nothing is broken in the NTP for when the feature is also disabled.
Test plan for DISABLED state
https://brave-today-cdn.brave.com/sources.json