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

Issue 1144333004: Make WebView work for external displays (over Presentations).

Created:
5 years, 6 months ago by gsennton
Modified:
5 years, 2 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, nona+watch_chromium.org, penghuang+watch_chromium.org, piman+watch_chromium.org, shuchen+watch_chromium.org, James Su, yusukes+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make WebView work for external displays (over Presentations). On Android we have been using the application context to get information about the current display which means that we always receive metrics for the primary display. With the introduction of Presentations we can now target other displays and thus need to use the Context of the Presentation to fetch information about the current display. BUG=310763

Patch Set 1 #

Total comments: 14

Patch Set 2 : Minor fixes according to boliu@'s comments #

Patch Set 3 : Store DeviceDisplayInfo in WindowAndroid and pass context to DeviceDisplayInfo #

Patch Set 4 : Move screen_android.cc from ui/gfx/ to ui/android/. #

Total comments: 13

Patch Set 5 : Use scoped_ptr to store DeviceDisplayInfo and make DeviceDisplayInfo getters const #

Total comments: 2

Patch Set 6 : Make ScreenOrientationListener context-based and git cl format #

Total comments: 17

Patch Set 7 : Add single global polling in ScreenOrientationListener #

Total comments: 1

Patch Set 8 : Use strong ref to context in ScreenOrientationListener and add display context to WindowAndroid #

Patch Set 9 : Fix another context-use through making WindowAndroid::GetJavaContext public #

Total comments: 2

Patch Set 10 : Minor naming/comment fixes #

Total comments: 59

Patch Set 11 : Minor fixes according to boliu/jdduke's comments #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+306 lines, -602 lines) Patch
M android_webview/java/src/org/chromium/android_webview/AwContents.java View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/android/content_view_core_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/gpu/gpu_data_manager_impl_private.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/renderer_host/compositor_impl_android.cc View 1 2 3 4 5 6 7 8 9 3 chunks +8 lines, -4 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.cc View 1 2 3 4 5 6 7 8 17 chunks +54 lines, -42 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java View 1 2 3 4 5 6 7 8 9 5 chunks +7 lines, -3 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/ScreenOrientationListener.java View 1 2 3 4 5 6 7 8 9 10 chunks +44 lines, -104 lines 1 comment Download
M content/public/android/java/src/org/chromium/content/browser/ScreenOrientationProvider.java View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M ui/android/BUILD.gn View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/base/ActivityWindowAndroid.java View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M ui/android/java/src/org/chromium/ui/base/WindowAndroid.java View 1 2 3 4 5 6 7 8 9 10 3 chunks +15 lines, -4 lines 2 comments Download
M ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java View 1 2 3 4 5 6 7 8 9 10 5 chunks +9 lines, -25 lines 0 comments Download
M ui/android/resources/resource_manager_impl.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M ui/android/resources/resource_manager_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -4 lines 0 comments Download
M ui/android/resources/resource_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
A + ui/android/screen_android.cc View 1 2 3 4 5 2 chunks +31 lines, -20 lines 0 comments Download
M ui/android/ui_android.gyp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M ui/android/window_android.h View 1 2 3 4 5 6 7 8 9 3 chunks +7 lines, -0 lines 0 comments Download
M ui/android/window_android.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +18 lines, -0 lines 0 comments Download
M ui/gfx/BUILD.gn View 1 2 3 4 5 6 7 8 9 3 chunks +1 line, -7 lines 0 comments Download
M ui/gfx/android/device_display_info.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +29 lines, -9 lines 0 comments Download
M ui/gfx/android/device_display_info.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +55 lines, -22 lines 0 comments Download
M ui/gfx/android/gfx_jni_registrar.cc View 1 2 3 4 5 1 chunk +4 lines, -6 lines 0 comments Download
D ui/gfx/android/shared_device_display_info.h View 1 chunk +0 lines, -81 lines 0 comments Download
D ui/gfx/android/shared_device_display_info.cc View 1 chunk +0 lines, -163 lines 0 comments Download
M ui/gfx/gfx.gyp View 1 2 3 4 5 6 7 8 9 3 chunks +0 lines, -8 lines 0 comments Download
D ui/gfx/screen_android.cc View 1 2 3 1 chunk +0 lines, -87 lines 0 comments Download
M ui/snapshot/snapshot_android.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -3 lines 0 comments Download

Messages

Total messages: 44 (4 generated)
gsennton
Hi Bo, does this look like what we discussed? I haven't changed anything in the ...
5 years, 6 months ago (2015-06-01 10:41:37 UTC) #2
boliu
Looks fine > I have not added any caching yet (we could have WindowAndroid own ...
5 years, 6 months ago (2015-06-01 15:30:19 UTC) #3
gsennton
> > I have not added any caching yet (we could have WindowAndroid own a ...
5 years, 6 months ago (2015-06-04 14:10:30 UTC) #4
boliu
I didn't read PS2 On 2015/06/04 14:10:30, gsennton wrote: > > > I have not ...
5 years, 6 months ago (2015-06-05 04:57:51 UTC) #5
gsennton
5 years, 6 months ago (2015-06-11 18:10:03 UTC) #6
gsennton
Moved screen_android.cc from ui/gfx/ to ui/android/ because we can't include ui/android/window_android or ui/android/view_android from ui/gfx ...
5 years, 6 months ago (2015-06-15 17:34:18 UTC) #8
jdduke (slow)
+mlamouri who worked on the display info/orientation changes previously.
5 years, 6 months ago (2015-06-16 14:47:30 UTC) #9
jdduke (slow)
(actually adding mlamouri this time...) +mlamouri who worked on the display info/orientation changes previously.
5 years, 6 months ago (2015-06-16 14:48:06 UTC) #11
jdduke (slow)
Ugg, I'm really not a fan of this implicit ScreenOrientation responsibility for ensuring updates of ...
5 years, 6 months ago (2015-06-16 15:01:28 UTC) #12
gsennton
https://codereview.chromium.org/1144333004/diff/60001/ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java File ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java (right): https://codereview.chromium.org/1144333004/diff/60001/ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java#newcode193 ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java:193: return mWinManager.getDefaultDisplay(); On 2015/06/16 15:01:28, jdduke wrote: > So ...
5 years, 6 months ago (2015-06-17 11:40:36 UTC) #13
jdduke (slow)
https://codereview.chromium.org/1144333004/diff/60001/ui/gfx/android/device_display_info.cc File ui/gfx/android/device_display_info.cc (right): https://codereview.chromium.org/1144333004/diff/60001/ui/gfx/android/device_display_info.cc#newcode10 ui/gfx/android/device_display_info.cc:10: DeviceDisplayInfo::DeviceDisplayInfo( On 2015/06/17 11:40:36, gsennton wrote: > On 2015/06/16 ...
5 years, 6 months ago (2015-06-17 15:56:05 UTC) #14
boliu
https://codereview.chromium.org/1144333004/diff/60001/ui/gfx/android/device_display_info.cc File ui/gfx/android/device_display_info.cc (right): https://codereview.chromium.org/1144333004/diff/60001/ui/gfx/android/device_display_info.cc#newcode10 ui/gfx/android/device_display_info.cc:10: DeviceDisplayInfo::DeviceDisplayInfo( On 2015/06/17 15:56:04, jdduke wrote: > On 2015/06/17 ...
5 years, 6 months ago (2015-06-17 16:02:20 UTC) #15
gsennton
In PS6 callers to ScreenOrientationListener need to own a ScreenOrientationListener (so there is no global ...
5 years, 6 months ago (2015-06-18 11:37:22 UTC) #16
boliu
On 2015/06/18 11:37:22, gsennton wrote: > In PS6 callers to ScreenOrientationListener need to own a ...
5 years, 6 months ago (2015-06-18 14:30:19 UTC) #17
mlamouri (slow - plz ping)
The Screen Orientation changes look fine. Though, it's getting a bit messy and I'm a ...
5 years, 6 months ago (2015-06-18 15:48:46 UTC) #18
gsennton
> The Screen Orientation changes look fine. Though, it's getting a bit messy and > ...
5 years, 6 months ago (2015-06-19 12:07:55 UTC) #19
mlamouri (slow - plz ping)
On 2015/06/19 at 12:07:55, gsennton wrote: > > The Screen Orientation changes look fine. Though, ...
5 years, 6 months ago (2015-06-19 12:33:51 UTC) #20
gsennton
On 2015/06/19 12:33:51, Mounir Lamouri wrote: > On 2015/06/19 at 12:07:55, gsennton wrote: > > ...
5 years, 6 months ago (2015-06-19 16:36:50 UTC) #21
gsennton
https://codereview.chromium.org/1144333004/diff/60001/ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java File ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java (right): https://codereview.chromium.org/1144333004/diff/60001/ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java#newcode193 ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java:193: return mWinManager.getDefaultDisplay(); On 2015/06/17 11:40:36, gsennton wrote: > On ...
5 years, 6 months ago (2015-06-25 13:59:58 UTC) #22
gsennton
The ScreenOrientationListener in PS8 has been tested as directed by mlamouri@ in #20. I am ...
5 years, 5 months ago (2015-07-02 13:15:25 UTC) #23
gsennton
Ok, so this should be fairly close to done now: I am looking into whether ...
5 years, 5 months ago (2015-07-10 15:35:55 UTC) #24
boliu
Yes, please split this into smaller CLs if possible. And let reviewers know if this ...
5 years, 5 months ago (2015-07-10 22:10:32 UTC) #25
gsennton
Ok, this should be ready for review, added the rest of the necessary reviewers: boliu ...
5 years, 5 months ago (2015-07-14 11:43:27 UTC) #27
boliu
https://codereview.chromium.org/1144333004/diff/180001/content/browser/android/content_view_core_impl.cc File content/browser/android/content_view_core_impl.cc (right): https://codereview.chromium.org/1144333004/diff/180001/content/browser/android/content_view_core_impl.cc#newcode1342 content/browser/android/content_view_core_impl.cc:1342: if (windowAndroid) Don't need this null check. window_android_ is ...
5 years, 5 months ago (2015-07-15 06:38:47 UTC) #28
jdduke (slow)
Sorry, realize I had a batch of comments from last week I never bothered sending. ...
5 years, 5 months ago (2015-07-15 16:03:07 UTC) #29
jdduke (slow)
https://codereview.chromium.org/1144333004/diff/180001/ui/gfx/android/device_display_info.cc File ui/gfx/android/device_display_info.cc (right): https://codereview.chromium.org/1144333004/diff/180001/ui/gfx/android/device_display_info.cc#newcode28 ui/gfx/android/device_display_info.cc:28: UpdateDisplayInfo( On 2015/07/15 16:03:07, jdduke wrote: > Silly question. ...
5 years, 5 months ago (2015-07-15 16:13:41 UTC) #30
gsennton
https://codereview.chromium.org/1144333004/diff/180001/content/browser/android/content_view_core_impl.cc File content/browser/android/content_view_core_impl.cc (right): https://codereview.chromium.org/1144333004/diff/180001/content/browser/android/content_view_core_impl.cc#newcode1342 content/browser/android/content_view_core_impl.cc:1342: if (windowAndroid) On 2015/07/15 06:38:46, boliu wrote: > Don't ...
5 years, 5 months ago (2015-07-15 19:26:21 UTC) #31
boliu
https://codereview.chromium.org/1144333004/diff/180001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/1144333004/diff/180001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java#newcode605 content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:605: private ScreenOrientationListener mScreenOrientationListener; On 2015/07/15 19:26:21, gsennton wrote: > ...
5 years, 5 months ago (2015-07-16 14:36:56 UTC) #32
jdduke (slow)
https://codereview.chromium.org/1144333004/diff/180001/ui/gfx/android/device_display_info.cc File ui/gfx/android/device_display_info.cc (right): https://codereview.chromium.org/1144333004/diff/180001/ui/gfx/android/device_display_info.cc#newcode28 ui/gfx/android/device_display_info.cc:28: UpdateDisplayInfo( On 2015/07/16 14:36:56, boliu wrote: > On 2015/07/15 ...
5 years, 5 months ago (2015-07-16 15:09:04 UTC) #33
boliu
https://codereview.chromium.org/1144333004/diff/180001/ui/gfx/android/device_display_info.cc File ui/gfx/android/device_display_info.cc (right): https://codereview.chromium.org/1144333004/diff/180001/ui/gfx/android/device_display_info.cc#newcode28 ui/gfx/android/device_display_info.cc:28: UpdateDisplayInfo( On 2015/07/16 15:09:03, jdduke wrote: > On 2015/07/16 ...
5 years, 5 months ago (2015-07-16 16:27:03 UTC) #34
jdduke (slow)
On 2015/07/16 16:27:03, boliu wrote: > Actually thinking more about this, having a static DeviceDisplayInfo ...
5 years, 5 months ago (2015-07-16 19:24:27 UTC) #35
jdduke (slow)
On 2015/07/16 19:24:27, jdduke wrote: > On 2015/07/16 16:27:03, boliu wrote: > > Actually thinking ...
5 years, 5 months ago (2015-07-16 19:27:34 UTC) #36
boliu
On 2015/07/16 19:27:34, jdduke wrote: > Don't really care which we do, and perhaps this ...
5 years, 5 months ago (2015-07-16 21:10:13 UTC) #37
mlamouri (slow - plz ping)
content/public/android/java/src/org/chromium/content/browser/ lgtm assuming the tests pass and the Screen Orientation API is still working in ...
5 years, 5 months ago (2015-07-20 13:18:03 UTC) #38
gsennton
This hasn't been touched in ages :/ sorry about that. Updated the major comments. https://codereview.chromium.org/1144333004/diff/180001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java ...
5 years, 2 months ago (2015-10-20 13:27:12 UTC) #39
boliu
No new code to look at, so only replied to comments. Also I don't remember ...
5 years, 2 months ago (2015-10-20 15:07:22 UTC) #40
gsennton
Yup, the patch is huge... I'll check if I can split it up somehow (though ...
5 years, 2 months ago (2015-10-20 18:46:44 UTC) #41
boliu
https://codereview.chromium.org/1144333004/diff/180001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/1144333004/diff/180001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java#newcode605 content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:605: private ScreenOrientationListener mScreenOrientationListener; On 2015/10/20 18:46:44, gsennton wrote: > ...
5 years, 2 months ago (2015-10-21 15:54:59 UTC) #42
gsennton
Ok, so I've started to split this up: I have one change in https://codereview.chromium.org/1419843002 that ...
5 years, 2 months ago (2015-10-21 16:35:32 UTC) #43
gsennton
5 years, 2 months ago (2015-10-22 15:50:37 UTC) #44
Looking at the whole DeviceDisplayInfo logic again, it seems unnecessary to
store one DDI object per WindowAndroid - there should only be one DDI per
display, right?
I am tempted to have a static map [displayID -> DeviceDisplayInfo] that would be
initiated the first time we need a DeviceDisplayInfo (using the provided context
to fetch the global Displaymanager, and then would be updated by listening to
DisplayManager changes (onDisplayAdded/Removed/Changed). 

Does this sound like something we should do now? I.e. can we have many
WindowAndroid per display and is it costly to hold a DeviceDisplayInfo?
(The alternative I'm thinking of would be to store one DeviceDisplayInfo per
WindowAndroid and keep a SharedDeviceDisplayInfo for all the places where we
want to access a DeviceDisplayInfo using the application context.

Powered by Google App Engine
This is Rietveld 408576698