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

Issue 2598163002: WebContentsObserver update for PlzNavigate methods (Closed)

Created:
3 years, 12 months ago by shaktisahu
Modified:
3 years, 10 months ago
Reviewers:
Ted C, jam, Maria
CC:
chromium-reviews, dominickn+watch_chromium.org, nasko+codewatch_chromium.org, creis+watch_chromium.org, mdjones+watch_chromium.org, donnd+watch_chromium.org, lizeb+watch-custom-tabs_chromium.org, pkotwicz+watch_chromium.org, agrieve+watch_chromium.org, darin-cc_chromium.org, zpeng+watch_chromium.org, android-webview-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

WebContentsObserver update for PlzNavigate methods This is the first CL to update the Java WebContentsObserver and its usages to use the new methods for PlzNavigate. Added a Java class for NavigationHandle and updated the WebContentsObserverProxy to use the new methods. Replaced deprecated methods with new methods at various call sites of WebContentsObserver. I would upload a second CL which will update the same for TabWebContentsObserver, TabObserver and its usages. BUG=676139 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Patch Set 1 #

Patch Set 2 : Fixed AwWebContentsObserver #

Total comments: 8

Patch Set 3 : Added isInMainFrame check #

Patch Set 4 : Removed Java NavigationHandle #

Patch Set 5 : AW fix #

Total comments: 3

Patch Set 6 : Renamed params and fixed crash due to PageTransition type #

Patch Set 7 : Revert back a state CHECK #

Unified diffs Side-by-side diffs Delta from patch set Stats (+128 lines, -93 lines) Patch
M android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java View 1 2 3 4 5 2 chunks +10 lines, -14 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java View 1 2 3 4 5 2 chunks +12 lines, -18 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/customtabs/PostMessageHandler.java View 1 2 3 4 5 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManager.java View 1 2 3 4 5 3 chunks +10 lines, -13 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java View 1 2 3 4 5 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenActivity.java View 1 2 3 4 5 1 chunk +3 lines, -3 lines 0 comments Download
M content/browser/android/web_contents_observer_proxy.h View 1 2 3 3 chunks +19 lines, -14 lines 0 comments Download
M content/browser/android/web_contents_observer_proxy.cc View 1 2 3 4 5 2 chunks +30 lines, -11 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java View 1 2 3 4 5 1 chunk +3 lines, -3 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java View 1 2 3 4 5 1 chunk +12 lines, -3 lines 0 comments Download
M content/public/android/java/src/org/chromium/content_public/browser/WebContentsObserver.java View 1 2 3 4 5 6 chunks +23 lines, -7 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 30 (19 generated)
shaktisahu
mariakhomenko@chromium.org: Please review changes in jam@chromium.org: Please review changes in
3 years, 12 months ago (2016-12-24 01:17:37 UTC) #5
jam
Thanks for helping :) I assume you added me for content/browser/frame_host. I don't think we ...
3 years, 12 months ago (2016-12-27 18:29:30 UTC) #8
shaktisahu
tedchoc@ : PTAL
3 years, 12 months ago (2016-12-27 19:09:14 UTC) #10
Maria
A couple of top level comments: - You probably want a separate reviewer for webview ...
3 years, 12 months ago (2016-12-27 19:31:10 UTC) #11
Ted C
On 2016/12/27 19:31:10, Maria wrote: > A couple of top level comments: > > - ...
3 years, 12 months ago (2016-12-27 19:51:30 UTC) #12
Maria
On 2016/12/27 19:51:30, Ted C wrote: > On 2016/12/27 19:31:10, Maria wrote: > > A ...
3 years, 12 months ago (2016-12-27 20:09:22 UTC) #13
Ted C
On 2016/12/27 20:09:22, Maria wrote: > On 2016/12/27 19:51:30, Ted C wrote: > > On ...
3 years, 12 months ago (2016-12-27 20:26:15 UTC) #14
shaktisahu
On 2016/12/27 20:09:22, Maria wrote: > On 2016/12/27 19:51:30, Ted C wrote: > > On ...
3 years, 12 months ago (2016-12-27 20:35:26 UTC) #15
Ted C
On 2016/12/27 20:35:26, shaktisahu wrote: > On 2016/12/27 20:09:22, Maria wrote: > > On 2016/12/27 ...
3 years, 12 months ago (2016-12-27 20:55:14 UTC) #16
shaktisahu
mariakhomenko@, tedchoc@ - PTAL
3 years, 11 months ago (2016-12-28 19:24:30 UTC) #21
Ted C
3 years, 11 months ago (2016-12-28 20:00:21 UTC) #22
Overall this seems very reasonable to me.  I have some naming, api suggestions,
but I think it should be good after those.

https://codereview.chromium.org/2598163002/diff/80001/content/browser/android...
File content/browser/android/web_contents_observer_proxy.cc (right):

https://codereview.chromium.org/2598163002/diff/80001/content/browser/android...
content/browser/android/web_contents_observer_proxy.cc:197: jboolean
is_navigation_to_different_page =
I would get rid of both of these computed values and pass the necessarily bits
to java to allow it to compute it.  In particular, I think that means dropping
is_navigation_to_different_page and passing the raw PageTransition to java.

We have generated constants in org.chromium.ui.base.PageTransition, so this can
be done in java by doing:

(pageTransition & PageTransition.CORE_MASK) == PageTransition.RELOAD;

Not as clean as the C++ side, but makes the APIs much closer.

https://codereview.chromium.org/2598163002/diff/80001/content/browser/frame_h...
File content/browser/frame_host/navigation_handle_impl.cc (left):

https://codereview.chromium.org/2598163002/diff/80001/content/browser/frame_h...
content/browser/frame_host/navigation_handle_impl.cc:223: // enabled.
https://crbug.com/621856
ah, the bug got fixed so you're just resolving the TODO it seems.  That threw me
off initially.

https://codereview.chromium.org/2598163002/diff/80001/content/public/android/...
File
content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java
(right):

https://codereview.chromium.org/2598163002/diff/80001/content/public/android/...
content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java:88:
public void didFinishNavigation(String validatedUrl, boolean isMainFrame,
boolean isErrorPage,
let's keep the java names the same as the navigation handle ones as well.

validatedUrl = url
isMainFrame = isInMainFrame
isFragmentNavigation = isSamePage
isReload ~= pageTransition

Anyone that is currently using isNavigationToDifferentPage will need to do

if (isMainFrame && !isSamePage) {...}

The goal is to have anyone familiar with the C++ navigation handle to be able to
look at the java api and immediately know how to use stuff.

Powered by Google App Engine
This is Rietveld 408576698