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

Issue 1148163003: Allow only responsive websites to install as a web app on mobile.

Created:
5 years, 7 months ago by dominickn (DO NOT USE)
Modified:
4 years, 8 months ago
Reviewers:
benwells, gone
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow only responsive websites to install as a web app on mobile. 'Responsiveness' is detected by querying the renderer for the meta viewport tag, and verifying that its contents contain either "width=device-width", or "initial-scale=1". Different tag cases, orderings, and length restrictions are detected and accounted for. If a page is not responsive on mobile, the app install banner display pipeline is halted, and engagement checks are not run. Additional debug logging to the javascript console is produced to inform developers of any issues detected with the meta viewport tag. BUG=463403

Patch Set 1 #

Patch Set 2 : Addressing compile errors on certain platforms #

Patch Set 3 : Fixing bad indentation #

Patch Set 4 : Refactor meta tag observation to live in data fetcher #

Patch Set 5 : Restoring code ordering, and reverting a temporary testing hack #

Patch Set 6 : Fixing a badly named variable #

Patch Set 7 : Preventing unintended method hiding #

Total comments: 8

Patch Set 8 : Cleaning up the current implementation #

Patch Set 9 : Refactoring implementation #

Patch Set 10 : #

Patch Set 11 : Refactoring test #

Patch Set 12 : Merging with latest master #

Total comments: 12

Patch Set 13 : Addressing reviewer comments #

Patch Set 14 : Adding comment explaining using statement #

Total comments: 1

Patch Set 15 : Restoring a lost nullptr check #

Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -19 lines) Patch
M chrome/android/javatests_shell/src/org/chromium/chrome/browser/banners/AppBannerManagerTest.java View 1 2 3 4 5 6 7 8 9 10 6 chunks +20 lines, -6 lines 0 comments Download
M chrome/browser/android/banners/app_banner_data_fetcher_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +17 lines, -0 lines 0 comments Download
M chrome/browser/android/banners/app_banner_data_fetcher_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +87 lines, -2 lines 0 comments Download
M chrome/browser/banners/app_banner_data_fetcher.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +8 lines, -5 lines 0 comments Download
M chrome/browser/banners/app_banner_data_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/banners/app_banner_debug_log.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/banners/app_banner_debug_log.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/test/data/banners/cancel_test_page.html View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/data/banners/manifest_test_page.html View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
A + chrome/test/data/banners/no_meta_viewport_test_page.html View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/test/data/banners/play_app_test_page.html View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 12 (2 generated)
dominickn (DO NOT USE)
This is waiting on advice regarding whether websites offering native apps should be responsive as ...
5 years, 7 months ago (2015-05-26 23:52:29 UTC) #2
benwells
https://codereview.chromium.org/1148163003/diff/120001/chrome/browser/banners/app_banner_data_fetcher.cc File chrome/browser/banners/app_banner_data_fetcher.cc (right): https://codereview.chromium.org/1148163003/diff/120001/chrome/browser/banners/app_banner_data_fetcher.cc#newcode74 chrome/browser/banners/app_banner_data_fetcher.cc:74: is_responsive_(true), I think this can be made cleaner. In ...
5 years, 7 months ago (2015-05-27 05:58:55 UTC) #3
gone
https://codereview.chromium.org/1148163003/diff/120001/chrome/android/javatests_shell/src/org/chromium/chrome/browser/banners/AppBannerManagerTest.java File chrome/android/javatests_shell/src/org/chromium/chrome/browser/banners/AppBannerManagerTest.java (right): https://codereview.chromium.org/1148163003/diff/120001/chrome/android/javatests_shell/src/org/chromium/chrome/browser/banners/AppBannerManagerTest.java#newcode446 chrome/android/javatests_shell/src/org/chromium/chrome/browser/banners/AppBannerManagerTest.java:446: // Visit a site that can have a banner, ...
5 years, 6 months ago (2015-05-27 22:53:35 UTC) #4
dominickn (DO NOT USE)
Thanks for the feedback. I've tweaked the implementation, and reduced the duplication in the tests. ...
5 years, 6 months ago (2015-06-05 07:42:59 UTC) #5
benwells
https://codereview.chromium.org/1148163003/diff/220001/chrome/browser/android/banners/app_banner_data_fetcher_android.cc File chrome/browser/android/banners/app_banner_data_fetcher_android.cc (right): https://codereview.chromium.org/1148163003/diff/220001/chrome/browser/android/banners/app_banner_data_fetcher_android.cc#newcode57 chrome/browser/android/banners/app_banner_data_fetcher_android.cc:57: bool handled = true; should you call the inherited ...
5 years, 6 months ago (2015-06-11 01:54:24 UTC) #6
dominickn (DO NOT USE)
https://codereview.chromium.org/1148163003/diff/220001/chrome/browser/android/banners/app_banner_data_fetcher_android.cc File chrome/browser/android/banners/app_banner_data_fetcher_android.cc (right): https://codereview.chromium.org/1148163003/diff/220001/chrome/browser/android/banners/app_banner_data_fetcher_android.cc#newcode57 chrome/browser/android/banners/app_banner_data_fetcher_android.cc:57: bool handled = true; On 2015/06/11 01:54:23, benwells wrote: ...
5 years, 6 months ago (2015-06-11 03:32:12 UTC) #7
gone
https://codereview.chromium.org/1148163003/diff/260001/chrome/browser/android/banners/app_banner_data_fetcher_android.cc File chrome/browser/android/banners/app_banner_data_fetcher_android.cc (right): https://codereview.chromium.org/1148163003/diff/260001/chrome/browser/android/banners/app_banner_data_fetcher_android.cc#newcode101 chrome/browser/android/banners/app_banner_data_fetcher_android.cc:101: InfoBarService::FromWebContents(web_contents) Shouldn't this be checking if the infobar is ...
5 years, 6 months ago (2015-06-11 17:37:25 UTC) #8
dominickn (DO NOT USE)
On 2015/06/11 17:37:25, dfalcantara wrote: > https://codereview.chromium.org/1148163003/diff/260001/chrome/browser/android/banners/app_banner_data_fetcher_android.cc > File chrome/browser/android/banners/app_banner_data_fetcher_android.cc (right): > > https://codereview.chromium.org/1148163003/diff/260001/chrome/browser/android/banners/app_banner_data_fetcher_android.cc#newcode101 > ...
5 years, 6 months ago (2015-06-12 00:33:47 UTC) #9
benwells
lgtm https://codereview.chromium.org/1148163003/diff/220001/chrome/browser/android/banners/app_banner_data_fetcher_android.h File chrome/browser/android/banners/app_banner_data_fetcher_android.h (right): https://codereview.chromium.org/1148163003/diff/220001/chrome/browser/android/banners/app_banner_data_fetcher_android.h#newcode32 chrome/browser/android/banners/app_banner_data_fetcher_android.h:32: bool OnMessageReceived(const IPC::Message& message) override; On 2015/06/11 03:32:12, ...
5 years, 6 months ago (2015-06-15 04:14:59 UTC) #10
gone
5 years, 6 months ago (2015-06-15 22:42:19 UTC) #11
lgtm % ben's comments

Powered by Google App Engine
This is Rietveld 408576698