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

Issue 1569893003: Add "Request app banner" context menu in DevTools (Closed)

Created:
4 years, 11 months ago by horo
Modified:
4 years, 11 months ago
CC:
apavlov+blink_chromium.org, blink-reviews, blink-reviews-api_chromium.org, caseq+blink_chromium.org, chromium-reviews, darin-cc_chromium.org, devtools-reviews_chromium.org, dglazkov+blink, gavinp+loader_chromium.org, jam, Nate Chapin, kozyatinskiy+blink_chromium.org, loading-reviews_chromium.org, loading-reviews+fetch_chromium.org, lushnikov+blink_chromium.org, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-manifest_chromium.org, mlamouri+watch-content_chromium.org, pfeldman+blink_chromium.org, sergeyv+blink_chromium.org, tyoshino+watch_chromium.org, vmpstr+watch_chromium.org, Yoav Weiss
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add "Request app banner" context menu in DevTools BUG=540491 Demo: https://drive.google.com/file/d/0B6skYAFVnosEc1RQRm9KYmxCeXM/view?usp=sharing When the user clicks "Request app banner" context menu, Chrome tries to open "add to homescreen" banner. And if error happens, it will show the detailed information about why the app banner is not opened even if "bypass-app-banner-engagement-checks" flag is not set. RequestAppBanner method from DevTools is handled like this: Android: PageHandler::RequestAppBanner() -> TabWebContentsDelegateAndroid::RequestAppBanner() -> Java TabWebContentsDelegateAndroid.requestAppBanner() -> Java Tab.requestAppBanner() -> Java AppBannerManager.requestAppBanner() -> nativeRequestAppBanner() -> AppBannerManagerAndroid::RequestAppBanner() -> AppBannerManager::TriggerAppBannerFetch() Desktop: PageHandler::RequestAppBanner() -> Browser::RequestAppBanner() -> AppBannerManager::TriggerAppBannerFetch() Committed: https://crrev.com/9638ad271db786762315556b7c2bc9c0a55c8e76 Cr-Commit-Position: refs/heads/master@{#371239}

Patch Set 1 #

Patch Set 2 : rebase on https://codereview.chromium.org/1571633002/ #

Total comments: 10

Patch Set 3 : Android support #

Total comments: 14

Patch Set 4 : incorporated dominickn's comment #

Total comments: 8

Patch Set 5 : incorporated dominickn's comment #

Total comments: 9

Patch Set 6 : incorporated dfalcantara's comment #

Total comments: 12

Patch Set 7 : incorporated pfeldman's comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+322 lines, -99 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java View 1 2 3 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsDelegateAndroid.java View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/android/banners/app_banner_data_fetcher_android.h View 1 2 1 chunk +7 lines, -7 lines 0 comments Download
M chrome/browser/android/banners/app_banner_data_fetcher_android.cc View 1 2 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/browser/android/banners/app_banner_manager_android.h View 1 2 3 1 chunk +12 lines, -4 lines 0 comments Download
M chrome/browser/android/banners/app_banner_manager_android.cc View 1 2 3 6 chunks +29 lines, -16 lines 0 comments Download
M chrome/browser/android/tab_web_contents_delegate_android.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/android/tab_web_contents_delegate_android.cc View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/banners/app_banner_data_fetcher.h View 1 2 3 4 5 5 chunks +11 lines, -3 lines 0 comments Download
M chrome/browser/banners/app_banner_data_fetcher.cc View 1 2 3 4 12 chunks +39 lines, -26 lines 0 comments Download
M chrome/browser/banners/app_banner_data_fetcher_browsertest.cc View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/banners/app_banner_data_fetcher_desktop.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/banners/app_banner_data_fetcher_desktop.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/banners/app_banner_data_fetcher_unittest.cc View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/banners/app_banner_debug_log.h View 1 2 3 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/banners/app_banner_debug_log.cc View 1 2 3 4 3 chunks +11 lines, -12 lines 0 comments Download
M chrome/browser/banners/app_banner_manager.h View 1 2 3 4 5 3 chunks +10 lines, -2 lines 0 comments Download
M chrome/browser/banners/app_banner_manager.cc View 1 2 3 2 chunks +23 lines, -7 lines 0 comments Download
M chrome/browser/banners/app_banner_manager_desktop.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/banners/app_banner_manager_desktop.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/browser.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 6 2 chunks +12 lines, -0 lines 0 comments Download
M components/web_contents_delegate_android/web_contents_delegate_android.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M components/web_contents_delegate_android/web_contents_delegate_android.cc View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/devtools/protocol/page_handler.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/devtools/protocol/page_handler.cc View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
M content/public/browser/web_contents_delegate.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M content/public/browser/web_contents_delegate.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js View 1 2 3 4 5 6 3 chunks +15 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/emulation/module.json View 1 2 3 4 5 6 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/screencast/ScreencastApp.js View 1 2 3 4 5 6 2 chunks +33 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/screencast/module.json View 1 2 3 4 5 6 1 chunk +13 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/devtools/protocol.json View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 54 (21 generated)
pfeldman
Looked at the devtools parts. Please run the app banner part against someone familiar with ...
4 years, 11 months ago (2016-01-14 04:43:05 UTC) #4
horo
https://codereview.chromium.org/1569893003/diff/20001/chrome/browser/devtools/chrome_devtools_manager_delegate.cc File chrome/browser/devtools/chrome_devtools_manager_delegate.cc (right): https://codereview.chromium.org/1569893003/diff/20001/chrome/browser/devtools/chrome_devtools_manager_delegate.cc#newcode41 chrome/browser/devtools/chrome_devtools_manager_delegate.cc:41: scoped_ptr<base::DictionaryValue> CanOpenAppBanner( On 2016/01/14 04:43:05, pfeldman wrote: > I ...
4 years, 11 months ago (2016-01-15 10:00:22 UTC) #11
horo
dfalcantara@, dominickn@ Could you please review this CL?
4 years, 11 months ago (2016-01-15 10:00:48 UTC) #12
dominickn
Mostly nits from me. This feature will be super useful to include (and would have ...
4 years, 11 months ago (2016-01-17 23:20:19 UTC) #14
horo
Thank you! https://codereview.chromium.org/1569893003/diff/40001/chrome/browser/android/banners/app_banner_manager_android.cc File chrome/browser/android/banners/app_banner_manager_android.cc (right): https://codereview.chromium.org/1569893003/diff/40001/chrome/browser/android/banners/app_banner_manager_android.cc#newcode190 chrome/browser/android/banners/app_banner_manager_android.cc:190: true); On 2016/01/17 23:20:18, dominickn wrote: > ...
4 years, 11 months ago (2016-01-18 06:28:56 UTC) #16
dominickn
Looking good! Just a couple of small bits to better integrate is_debug_mode with the existing ...
4 years, 11 months ago (2016-01-18 23:20:42 UTC) #17
horo
Thank you https://codereview.chromium.org/1569893003/diff/60001/chrome/browser/banners/app_banner_data_fetcher.cc File chrome/browser/banners/app_banner_data_fetcher.cc (right): https://codereview.chromium.org/1569893003/diff/60001/chrome/browser/banners/app_banner_data_fetcher.cc#newcode86 chrome/browser/banners/app_banner_data_fetcher.cc:86: is_debug_mode_(is_debug_mode), On 2016/01/18 23:20:41, dominickn wrote: > ...
4 years, 11 months ago (2016-01-19 01:45:43 UTC) #18
dominickn
lgtm (with a follow up for me to look at). I'll defer to dfalcantara for ...
4 years, 11 months ago (2016-01-19 02:25:10 UTC) #19
horo
On 2016/01/19 02:25:10, dominickn wrote: > lgtm (with a follow up for me to look ...
4 years, 11 months ago (2016-01-19 03:40:53 UTC) #20
gone
Android bits lgtm % nits. https://codereview.chromium.org/1569893003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java File chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java (right): https://codereview.chromium.org/1569893003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java#newcode2185 chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java:2185: /** Requests the app ...
4 years, 11 months ago (2016-01-19 18:35:00 UTC) #21
horo
Thank you! https://codereview.chromium.org/1569893003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java File chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java (right): https://codereview.chromium.org/1569893003/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java#newcode2185 chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java:2185: /** Requests the app banner. This method ...
4 years, 11 months ago (2016-01-20 02:26:34 UTC) #22
pfeldman
https://codereview.chromium.org/1569893003/diff/100001/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java File chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java (right): https://codereview.chromium.org/1569893003/diff/100001/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java#newcode142 chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java:142: nativeRequestAppBanner(mNativePointer); It seems like DevTools uses a different code ...
4 years, 11 months ago (2016-01-20 04:30:17 UTC) #23
dominickn
pfeldman: some more background on the banner implementation. Broadly, I think the CL does the ...
4 years, 11 months ago (2016-01-20 05:37:25 UTC) #24
horo
https://codereview.chromium.org/1569893003/diff/100001/chrome/browser/ui/browser.h File chrome/browser/ui/browser.h (right): https://codereview.chromium.org/1569893003/diff/100001/chrome/browser/ui/browser.h#newcode676 chrome/browser/ui/browser.h:676: bool RequestAppBanner(content::WebContents* web_contents) override; On 2016/01/20 04:30:17, pfeldman wrote: ...
4 years, 11 months ago (2016-01-20 11:01:42 UTC) #27
pfeldman
On 2016/01/20 05:37:25, dominickn wrote: > pfeldman: some more background on the banner implementation. Thanks! ...
4 years, 11 months ago (2016-01-20 18:18:41 UTC) #28
dominickn
On 2016/01/20 18:18:41, pfeldman wrote: > That sounds good, but does not explain the changes ...
4 years, 11 months ago (2016-01-21 02:26:30 UTC) #29
horo
> sgtm - thanks for pointing out this method! In that case, you can remove ...
4 years, 11 months ago (2016-01-21 05:59:11 UTC) #30
pfeldman
> On Android, the banner flow begins in C++ native code (app_banner_manager.cc), > but the ...
4 years, 11 months ago (2016-01-21 18:29:49 UTC) #31
pfeldman
> IsDebuggerAttached() returns true when DevTools window is opened. > So even when IsDebuggerAttached() is ...
4 years, 11 months ago (2016-01-21 18:45:48 UTC) #32
dominickn
On 2016/01/21 18:29:49, pfeldman wrote: > Sorry, I still don't get it. If banner flows ...
4 years, 11 months ago (2016-01-22 03:40:22 UTC) #33
pfeldman
Ok, it all makes sense now, thank you for your patience. It is a shame ...
4 years, 11 months ago (2016-01-22 04:11:03 UTC) #34
dominickn
On 2016/01/22 04:11:03, pfeldman wrote: > Ok, it all makes sense now, thank you for ...
4 years, 11 months ago (2016-01-22 04:22:03 UTC) #35
pfeldman
I see. My worry is that user never forces install and hence never sees the ...
4 years, 11 months ago (2016-01-22 05:24:30 UTC) #36
pfeldman
devtools lgtm since what i suggest is incremental wrt this change.
4 years, 11 months ago (2016-01-22 05:28:58 UTC) #37
horo
On 2016/01/22 05:28:58, pfeldman wrote: > devtools lgtm since what i suggest is incremental wrt ...
4 years, 11 months ago (2016-01-22 08:48:39 UTC) #38
horo
jochen@ Could you please review chrome/browser/ui/browser.* and components/web_contents_delegate_android/web_contents_delegate_android.*?
4 years, 11 months ago (2016-01-22 08:49:43 UTC) #40
jochen (gone - plz use gerrit)
lgtm
4 years, 11 months ago (2016-01-25 09:53:23 UTC) #42
horo
Thank you!
4 years, 11 months ago (2016-01-25 09:58:34 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1569893003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1569893003/140001
4 years, 11 months ago (2016-01-25 09:58:40 UTC) #46
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/163720)
4 years, 11 months ago (2016-01-25 13:23:02 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1569893003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1569893003/140001
4 years, 11 months ago (2016-01-25 13:26:28 UTC) #50
commit-bot: I haz the power
Committed patchset #7 (id:140001)
4 years, 11 months ago (2016-01-25 14:36:54 UTC) #52
commit-bot: I haz the power
4 years, 11 months ago (2016-01-25 14:38:18 UTC) #54
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/9638ad271db786762315556b7c2bc9c0a55c8e76
Cr-Commit-Position: refs/heads/master@{#371239}

Powered by Google App Engine
This is Rietveld 408576698