Much of this code was already compiled-out. Some exceptions:
- Code branches with if (v1 enabled) { ... } were removed.
- Extracted functions from v1 library LocateUtils class into
FeedServiceBridge.
- Some code in components/feed wasn't yet removed from
the build, but wasn't referenced, and is now removed.
- Shared proto databases for v1 were added to
kObsoleteSharedProtoDbTypeClients
- Obsoleted v1 specific prefs.
Bug: 1165828
Change-Id: I30bcfa7783f94f81f960a908916783e15bd98ef3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2679184
Commit-Queue: Dan H <harringtond@chromium.org>
Reviewed-by: Cathy Li <chili@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#852237}
For context, enable_feed_v1=false removes the v1 version of the NTP
feed from the build. This CL fixes various problems with that
configuration:
* fixed some tests
* fixed some unused resource errors
* some tests were more difficult to fix, i've made some
assertions conditional. Instant start isn't yet implemented
for v2, so it's likely these require more than test updates.
Bug: 1129187
Change-Id: If1cfbdd9e596c61c082565279a545326f1dba244
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2441958
Reviewed-by: Xi Han <hanxi@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Dan H <harringtond@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814276}
Note: this is a slightly modified reland of
https://chromium-review.googlesource.com/c/chromium/src/+/1956275.
The only difference is adding SuppressWarnings for Validators.java,
which was prompted due a change in errorprone.
- Restructure to match chrome/browser/java/res
- Replace strings with references to existing .grd strings
- I kept Piet resources separate, since piet may eventually be moved into
a different library.
- Move feed/library sources into chrome_java
Strings changed:
snackbar_fetch_no_new_suggestions -> ntp_suggestions_fetch_no_new_suggestions
snackbar_fetch_failed -> ntp_suggestions_fetch_failed
snackbar_default_action -> undo
It looks like chromium's strings are translated to more languages, so
this might provide better localization. Some of these strings are
translated differently between feed and zine.
TBR=dtrainor@chromium.org,wnwen@chromium.org,twellington@chromium.org,carlosk@chromium.org
Change-Id: I2a14b0c4b4b60c7ab5b45ead0ec75b09233f4d99
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2017243
Reviewed-by: Dan H <harringtond@chromium.org>
Commit-Queue: Dan H <harringtond@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734726}
- Restructure to match chrome/browser/java/res
- Replace strings with references to existing .grd strings
- I kept Piet resources separate, since piet may eventually be moved into
a different library.
- Move feed/library sources into chrome_java
Strings changed:
snackbar_fetch_no_new_suggestions -> ntp_suggestions_fetch_no_new_suggestions
snackbar_fetch_failed -> ntp_suggestions_fetch_failed
snackbar_default_action -> undo
It looks like chromium's strings are translated to more languages, so
this might provide better localization. Some of these strings are
translated differently between feed and zine.
Bug: 1024945
Change-Id: If9862a4965756e28ba812bf315556d6b8db09e62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1956275
Reviewed-by: David Trainor <dtrainor@chromium.org>
Reviewed-by: Peter Wen <wnwen@chromium.org>
Reviewed-by: Theresa <twellington@chromium.org>
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Commit-Queue: Dan H <harringtond@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734575}
This CL removes dead code for generic signin promos that had been shown
in the NTP before personalized signin promos were implemented. It also
fixes JavaDoc link in the same file.
Bug: 792430
Change-Id: Id555628a12301764fbd0e2a75964978d2be2b59d
Reviewed-on: https://chromium-review.googlesource.com/854896
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527998}
Android uses sentence case for the title, iOS uses title case. This CL
changes the local suggestions only.
Bug: 747973
Change-Id: I06839d73f44f39cf058c9e2f609b6db7a6bb9c2f
Reviewed-on: https://chromium-review.googlesource.com/603714
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492574}
When more suggestions are fetched on the NTP, a spinner is displayed
to signal the user the suggestions are being fetched.
This spinner prevents the user from interacting with the button.
If the suggestions couldn't be fetched (network error...) a toast is
displayed.
If there is no more suggestions, the footer is removed.
Bug: 721229
Change-Id: Ib58fb446e76bbb752f37105135a58068713c96b5
Reviewed-on: https://chromium-review.googlesource.com/602130
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Elodie Banel <lod@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492350}
This CL adds a message to be displayed in the empty ContentSuggestions sections.
BUG=686728
Review-Url: https://codereview.chromium.org/2775593002
Cr-Commit-Position: refs/heads/master@{#460052}
The English string wasn't entirely clear about who published the
headlining article and the other articles, so it was hard to translate.
Review-Url: https://codereview.chromium.org/2765353005
Cr-Commit-Position: refs/heads/master@{#459408}
This string is used as the message of a notification that links to the
NTP instead of directly to a particular article. I'm not 100% certain
that it's the exact string we want to use, but I'd like to get some
string in by BP, because there's no possibility to merge it later if we
find out that link-to-NTP is a blocker.
BUG=678268
Review-Url: https://codereview.chromium.org/2709083006
Cr-Commit-Position: refs/heads/master@{#452853}
We used to only add space between the signin promo and the preceding
item when it was not a suggestion, but since most of the time it is
not a suggestion and the message can be ambiguous when attached to
the suggestions, we now want to just always add that space.
BUG=676311
Review-Url: https://codereview.chromium.org/2613593003
Cr-Commit-Position: refs/heads/master@{#443872}
Previously the foreign tabs section used the generic empty section text. This change adds a custom string to make it slightly me specific and useful. Another benefit of the string we choose, it is explains that this section shows tabs from other devices, which isn't currently explained by the section header.
BUG=663966
Review-Url: https://codereview.chromium.org/2500963005
Cr-Commit-Position: refs/heads/master@{#432484}
Two separate things are being changes in this:
* The title of the foreign tabs suggestions on the new tab page is being updated from "Continue from another device" to "Recent tabs". This helps bring the title more inline with existing UI, and is shorter. There are not currently any local tab suggestions on this page so we dodge ambiguity for now. This could change in the future.
* The individual suggestions no longer contain the foreign device's name. The name is sometimes not very readable or useful, and created long, ugly lines. This also results in a very consistent experience between this section and the other sections, where the 'publisher' line only contains favicon, domain, and age.
BUG=663966
Review-Url: https://codereview.chromium.org/2497343002
Cr-Commit-Position: refs/heads/master@{#432199}
Due to crbug.com/660343 we could not remove an unused resource string,
which is finally removed in this CL. Also an obsolete TODO related to
crbug.com/641568 is removed (offline pages are now opened correctly,
see crbug.com/661214).
BUG=none
Review-Url: https://codereview.chromium.org/2477313003
Cr-Commit-Position: refs/heads/master@{#430273}
This CL is the third of the three CLs.
The overall aim is to show all types of downloads on the NTP in
downloads section.
This CL adds DownloadSuggestionsProvider, which provides both offline
page (e.g. offlined pages) and asset (e.g. images) downloads.
If any of the two previous CLs is reverted, this CL must be reverted too.
BUG=639233
Review-Url: https://codereview.chromium.org/2360263002
Cr-Commit-Position: refs/heads/master@{#429194}
Original issue's description:
> [NTP Client] Use the separate button style for the NoArticles status
>
> Makes the articles and bookmarks sections use the same style of status
> card when they have no snippets.
>
> the hasMoreButton property of categories now only determines whether
> the action item will be shown when there are suggestions to display.
>
> This patch also lets the SuggestionsCategoryInfo be aware of the
> current category it is describing, and moves various category specific
> behaviours into the SuggestionsCategoryInfo class.
>
> Preview: https://goo.gl/photos/VhceT6cjvME6QS8m7
>
> BUG=649670
>
> Committed: https://crrev.com/ffa8e3905fed0b1df0d56ab6e4b17791b31cd171
> Cr-Commit-Position: refs/heads/master@{#423517}
> Revert Data:
> Committed: https://crrev.com/b5e8956c2c8a10484d10a117b3ef5a33ee58cb6c
> Cr-Commit-Position: refs/heads/master@{#423573}
BUG=649670
Review-Url: https://codereview.chromium.org/2401643004
Cr-Commit-Position: refs/heads/master@{#423863}
Reason for revert:
Breaking tests on Android bots, see bug comment.
Original issue's description:
> [NTP Client] Use the separate button style for the NoArticles status
>
> Makes the articles and bookmarks sections use the same style of status
> card when they have no snippets.
>
> the hasMoreButton property of categories now only determines whether
> the action item will be shown when there are suggestions to display.
>
> This patch also lets the SuggestionsCategoryInfo be aware of the
> current category it is describing, and moves various category specific
> behaviours into the SuggestionsCategoryInfo class.
>
> Preview: https://goo.gl/photos/VhceT6cjvME6QS8m7
>
> BUG=649670
>
> Committed: https://crrev.com/ffa8e3905fed0b1df0d56ab6e4b17791b31cd171
> Cr-Commit-Position: refs/heads/master@{#423517}
TBR=bauerb@chromium.org,dgn@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=649670
Review-Url: https://codereview.chromium.org/2398463005
Cr-Commit-Position: refs/heads/master@{#423573}
Makes the articles and bookmarks sections use the same style of status
card when they have no snippets.
the hasMoreButton property of categories now only determines whether
the action item will be shown when there are suggestions to display.
This patch also lets the SuggestionsCategoryInfo be aware of the
current category it is describing, and moves various category specific
behaviours into the SuggestionsCategoryInfo class.
Preview: https://goo.gl/photos/VhceT6cjvME6QS8m7
BUG=649670
Review-Url: https://codereview.chromium.org/2392943002
Cr-Commit-Position: refs/heads/master@{#423517}
- Added a show_if_empty field to CategoryInfo. A category with
this flag enabled will be always shown on the NTP, but if it's
disabled and we have no suggestion for this category when
initialising the NTP, we won't show it at all.
- If the section has a MORE button, when the last suggestion is
dismissed, we show a different Empty State status card that
has no action and leave the MORE button to provide the action.
- Added strings an a new status card for Bookmarks and updated
the ones for articles.
Preview: https://goo.gl/photos/CE8bFvEtuYQNhW1m9
BUG=610648
Review-Url: https://codereview.chromium.org/2249903003
Cr-Commit-Position: refs/heads/master@{#413141}
Add separate flags for enabling the recent tabs and downloads sections.
Update flags shown on snippets-internals page. Modify the
OfflinePageSuggestionsProvider to handle the two categories, especially
to split the OfflinePageItems coming from the OfflinePageModel into two
distinct lists ordered by the last accessed date.
Use the title from the OfflinePageItem, if available; use the URL as
a fallback otherwise.
Add more-button actions for Recent Tabs and Downloads to open the
respective native UIs.
TBR=cpu@chromium.org (for generated_resources.grd)
BUG=628198
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Review-Url: https://codereview.chromium.org/2245583002
Cr-Commit-Position: refs/heads/master@{#411645}
Apart from the ContentSuggestions in a Category and its current status,
there is meta information assigned with a Category that does not change
even for dynamically added categories. This information includes the
title, for example.
Implement a new CategoryInfo struct (with currently only the title
and a card_layout field) and corresponding methods to hand the
information from the ContentSuggestionsProviders to the
ContentSuggestionsService and out towards the UI.
Implement those methods in the three providers we currently have.
For the offline pages, only use a placeholder string at the moment,
because it will provide two distinct categories with different titles
in the future.
BUG=632320
Review-Url: https://codereview.chromium.org/2207493002
Cr-Commit-Position: refs/heads/master@{#410672}
When there are no snippets to display, the Status card now
shows an appropriate message and action for the following
contexts:
- User is signed out
- User has disabled sync
- User has disabled history sync
- User has set a custom passphrase
The detection of those states is done by the newly added
NTPSnippetsStatusService.
Preview: https://goo.gl/photos/gpDA8g6Mm2jW56e87
BUG=612508
Review-Url: https://codereview.chromium.org/2061803002
Cr-Commit-Position: refs/heads/master@{#402537}