Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Issue 2915913002: [WebAPKs] Display same text for menu & engagement banner (Closed)

Created:
3 years, 6 months ago by pkotwicz
Modified:
3 years, 5 months ago
Reviewers:
dominickn
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[WebAPKs] Display same text for menu & engagement banner This CL changes the text of the banner displayed when installing a WebAPK from the app menu to match the text of the banner displayed via the engagement checks. Using the same text in both banners prevents creating a second banner if a user tries to install a WebAPK from the app menu if the "user engagement A2HS" banner is already visible. BUG=728300

Patch Set 1 #

Patch Set 2 : Merge branch 'same_infobar_title0' into same_infobar_title #

Total comments: 4

Patch Set 3 : Merge branch 'master' into same_infobar_title #

Patch Set 4 : Merge branch 'master' into same_infobar_title #

Patch Set 5 : Merge branch 'master' into same_infobar_title #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -55 lines) Patch
M chrome/browser/android/banners/app_banner_infobar_delegate_android.h View 1 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/android/banners/app_banner_infobar_delegate_android.cc View 1 2 3 4 6 chunks +6 lines, -7 lines 3 comments Download
M chrome/browser/android/banners/app_banner_manager_android.h View 1 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/android/banners/app_banner_manager_android.cc View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/android/shortcut_helper.h View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/android/shortcut_helper.cc View 1 2 3 4 5 chunks +9 lines, -7 lines 0 comments Download
M chrome/browser/android/shortcut_info.h View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/android/shortcut_info.cc View 1 2 3 4 1 chunk +4 lines, -6 lines 0 comments Download
M chrome/browser/android/shortcut_info_unittest.cc View 1 2 3 4 1 chunk +13 lines, -5 lines 0 comments Download
M chrome/browser/android/webapk/webapk_installer.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/android/webapk/webapk_update_manager.cc View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc View 1 2 3 4 2 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/android/webapps/add_to_homescreen_manager.cc View 1 2 3 4 2 chunks +4 lines, -6 lines 0 comments Download
M chrome/browser/banners/app_banner_manager.h View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/banners/app_banner_manager.cc View 1 2 3 4 1 chunk +0 lines, -7 lines 0 comments Download

Messages

Total messages: 18 (3 generated)
pkotwicz
Dominick, can you please take a look?
3 years, 6 months ago (2017-05-31 21:27:14 UTC) #2
dominickn
It looks to me like ShortcutInfo::UpdateFromManifest() sets user_title the reverse of what the app banner ...
3 years, 6 months ago (2017-06-01 01:12:04 UTC) #3
pkotwicz
Unfortunately AddToHomescreenManager::OnUserTitleAvailable() uses ShortcutInfo::user_title so I cannot do what you suggest I have updated ShortcutInfo::UpdateFromManifest() ...
3 years, 6 months ago (2017-06-01 05:28:16 UTC) #4
pkotwicz
Unfortunately AddToHomescreenManager::OnUserTitleAvailable() uses ShortcutInfo::user_title so I cannot do what you suggest I have updated ShortcutInfo::UpdateFromManifest() ...
3 years, 6 months ago (2017-06-01 05:28:18 UTC) #5
dominickn
lgtm % nit https://codereview.chromium.org/2915913002/diff/20001/chrome/browser/android/shortcut_info.cc File chrome/browser/android/shortcut_info.cc (right): https://codereview.chromium.org/2915913002/diff/20001/chrome/browser/android/shortcut_info.cc#newcode22 chrome/browser/android/shortcut_info.cc:22: void ShortcutInfo::UpdateFromManifest(const content::Manifest& manifest) { Please ...
3 years, 6 months ago (2017-06-02 01:42:25 UTC) #6
pkotwicz
https://codereview.chromium.org/2915913002/diff/20001/chrome/browser/android/shortcut_info.cc File chrome/browser/android/shortcut_info.cc (right): https://codereview.chromium.org/2915913002/diff/20001/chrome/browser/android/shortcut_info.cc#newcode22 chrome/browser/android/shortcut_info.cc:22: void ShortcutInfo::UpdateFromManifest(const content::Manifest& manifest) { UpdateManifest() might be called ...
3 years, 6 months ago (2017-06-02 15:53:53 UTC) #7
pkotwicz
Dominick, ping on comment #7
3 years, 6 months ago (2017-06-05 15:01:49 UTC) #8
dominickn
Sorry about the delay here. I've had some hardware issues the last few days so ...
3 years, 6 months ago (2017-06-06 00:20:58 UTC) #9
pkotwicz
https://codereview.chromium.org/2915913002/diff/20001/chrome/browser/android/shortcut_info.cc File chrome/browser/android/shortcut_info.cc (right): https://codereview.chromium.org/2915913002/diff/20001/chrome/browser/android/shortcut_info.cc#newcode22 chrome/browser/android/shortcut_info.cc:22: void ShortcutInfo::UpdateFromManifest(const content::Manifest& manifest) { Ok, I have changed ...
3 years, 6 months ago (2017-06-07 02:22:33 UTC) #10
dominickn
On 2017/06/07 02:22:33, pkotwicz wrote: > https://codereview.chromium.org/2915913002/diff/20001/chrome/browser/android/shortcut_info.cc > File chrome/browser/android/shortcut_info.cc (right): > > https://codereview.chromium.org/2915913002/diff/20001/chrome/browser/android/shortcut_info.cc#newcode22 > ...
3 years, 6 months ago (2017-06-07 03:15:39 UTC) #11
pkotwicz
Dominick, can you please take another look? I have deleted the controversial ShortcutInfo::user_title field. The ...
3 years, 6 months ago (2017-06-16 01:20:40 UTC) #13
dominickn
https://codereview.chromium.org/2915913002/diff/100001/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc File chrome/browser/android/banners/app_banner_infobar_delegate_android.cc (right): https://codereview.chromium.org/2915913002/diff/100001/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc#newcode378 chrome/browser/android/banners/app_banner_infobar_delegate_android.cc:378: shortcut_info_->short_name, This is a behaviour change for app banners. ...
3 years, 6 months ago (2017-06-16 01:32:32 UTC) #14
dominickn
In other words: you should pick |name| over |short_name|, and set |name| = |short_name| only ...
3 years, 6 months ago (2017-06-16 01:38:10 UTC) #15
pkotwicz
https://codereview.chromium.org/2915913002/diff/100001/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc File chrome/browser/android/banners/app_banner_infobar_delegate_android.cc (right): https://codereview.chromium.org/2915913002/diff/100001/chrome/browser/android/banners/app_banner_infobar_delegate_android.cc#newcode378 chrome/browser/android/banners/app_banner_infobar_delegate_android.cc:378: shortcut_info_->short_name, Thank you for your question. This is actually ...
3 years, 6 months ago (2017-06-17 00:17:23 UTC) #16
dominickn
3 years, 6 months ago (2017-06-17 01:05:45 UTC) #17
https://codereview.chromium.org/2915913002/diff/100001/chrome/browser/android...
File chrome/browser/android/banners/app_banner_infobar_delegate_android.cc
(right):

https://codereview.chromium.org/2915913002/diff/100001/chrome/browser/android...
chrome/browser/android/banners/app_banner_infobar_delegate_android.cc:378:
shortcut_info_->short_name,
On 2017/06/17 00:17:23, pkotwicz wrote:
> Thank you for your question.
> 
> This is actually incorrect. The banner title and the name of the installed web
> app used to come from two different places:
> The banner title used to come from AppBannerManager::app_title_
> The name of the install web app used to come from CreateShortcutInfo() in
> app_banner_manager_android.cc
> 
> If I changed the logic in ShortcutInfo::UpdateFromManifest() to match the
banner
> code, this would change home screen shortcuts to use the "name" instead of the
> "short_name". This would be a change in behavior for both home screen
shortcuts
> added from the app menu and home screen shortcuts added from the banner. As
far
> as I can tell, the "short_name" has been used for home screen shortcuts for at
> least a year.

Yes, we should still use the |short_name| for the home screen shortcut, so my
proposed solution there would break that.

The behaviour we want is to use |name| for the banner title if it's present,
rather than |short_name|. This means devs can use a longer, full name in the
banner and have the truncated one be in the actual shortcut if the real name is
too long. In short:

A2HS Dialog:
  - if not WebAPK: prefer short_name (actual text that will go in the shortcut)
  - if WebAPK: prefer name in the banner, but use short_name for shortcut

Banner:
 - prefer name in the banner, but use short_name for shortcut

Powered by Google App Engine
This is Rietveld 408576698