|
|
DescriptionDo not filter the picker window with Aura.
The picker window is embedded in the parent window and does not have its own native window.
TESTED=verified on Linux, Win and ChromeOS that the picker window is not listed to share with or without a delegate tab, and the chrome window is correctly listed.
BUG=384370
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=277866
Patch Set 1 #
Total comments: 2
Patch Set 2 : #
Total comments: 3
Messages
Total messages: 20 (0 generated)
I verified this works on Linux and Windows. Some questions: 1. are there any platforms using views but not Aura? 2. is this correct for ChromeOs? Do we still need RegisterAuraWindow?
PTAL
I'll let Sergey take the first crack at this; I only touched that specific code block to do some refactoring. Otherwise, I was fixing the dialog widget creation. (this odd dialog is the only one I've seen that can be web- or window-modal) On 2014/06/13 16:41:54, jiayl wrote: > 1. are there any platforms using views but not Aura? Not at the moment. > 2. is this correct for ChromeOs? Do we still need RegisterAuraWindow? No idea, sorry :(
https://codereview.chromium.org/338503007/diff/1/chrome/browser/ui/views/desk... File chrome/browser/ui/views/desktop_media_picker_views.cc (right): https://codereview.chromium.org/338503007/diff/1/chrome/browser/ui/views/desk... chrome/browser/ui/views/desktop_media_picker_views.cc:550: // own native window with Aura. So we do not filter any window. Actually it's not always the case. We still have a separate dialog window in some cases - see line 547. If CreateWebModalDialogView() is used to create the dialog, then we don't want to filter it, but we still want filtering when the dialog is created using DialogDelegate::CreateDialogWidget()
On 2014/06/13 16:41:54, jiayl wrote: > I verified this works on Linux and Windows. > > Some questions: > > 1. are there any platforms using views but not Aura? > 2. is this correct for ChromeOs? Do we still need RegisterAuraWindow? Yes. RegisterAuraWindow() is useful there when dialog needs to be filtered.
https://codereview.chromium.org/338503007/diff/1/chrome/browser/ui/views/desk... File chrome/browser/ui/views/desktop_media_picker_views.cc (right): https://codereview.chromium.org/338503007/diff/1/chrome/browser/ui/views/desk... chrome/browser/ui/views/desktop_media_picker_views.cc:550: // own native window with Aura. So we do not filter any window. On 2014/06/13 17:38:41, Sergey Ulanov wrote: > Actually it's not always the case. We still have a separate dialog window in > some cases - see line 547. > If CreateWebModalDialogView() is used to create the dialog, then we don't want > to filter it, but we still want filtering when the dialog is created using > DialogDelegate::CreateDialogWidget() But I tested both the desktopCapture example extension (i.e. CreateDialogWidget) code path and the tab delegated code path (i.e. createWebModalDialogViews), the picker dialog is not listed in the picker without filtering.
On 2014/06/13 16:53:03, msw wrote: > I'll let Sergey take the first crack at this; I only touched that specific code > block to do some refactoring. Otherwise, I was fixing the dialog widget > creation. (this odd dialog is the only one I've seen that can be web- or > window-modal) > > On 2014/06/13 16:41:54, jiayl wrote: > > 1. are there any platforms using views but not Aura? > Not at the moment. > > 2. is this correct for ChromeOs? Do we still need RegisterAuraWindow? > No idea, sorry :( I verified on ChromeOS that the filtering is not needed as well.
On 2014/06/13 17:54:54, jiayl wrote: > https://codereview.chromium.org/338503007/diff/1/chrome/browser/ui/views/desk... > File chrome/browser/ui/views/desktop_media_picker_views.cc (right): > > https://codereview.chromium.org/338503007/diff/1/chrome/browser/ui/views/desk... > chrome/browser/ui/views/desktop_media_picker_views.cc:550: // own native window > with Aura. So we do not filter any window. > On 2014/06/13 17:38:41, Sergey Ulanov wrote: > > Actually it's not always the case. We still have a separate dialog window in > > some cases - see line 547. > > If CreateWebModalDialogView() is used to create the dialog, then we don't want > > to filter it, but we still want filtering when the dialog is created using > > DialogDelegate::CreateDialogWidget() > > But I tested both the desktopCapture example extension (i.e. CreateDialogWidget) > code path and the tab delegated code path (i.e. createWebModalDialogViews), the > picker dialog is not listed in the picker without filtering. Right. DialogDelegate::CreateDialogWidget() is used when the API is called from a background extension page that doesn't have UI context.
On 2014/06/13 22:34:51, Sergey Ulanov wrote: > On 2014/06/13 17:54:54, jiayl wrote: > > > https://codereview.chromium.org/338503007/diff/1/chrome/browser/ui/views/desk... > > File chrome/browser/ui/views/desktop_media_picker_views.cc (right): > > > > > https://codereview.chromium.org/338503007/diff/1/chrome/browser/ui/views/desk... > > chrome/browser/ui/views/desktop_media_picker_views.cc:550: // own native > window > > with Aura. So we do not filter any window. > > On 2014/06/13 17:38:41, Sergey Ulanov wrote: > > > Actually it's not always the case. We still have a separate dialog window in > > > some cases - see line 547. > > > If CreateWebModalDialogView() is used to create the dialog, then we don't > want > > > to filter it, but we still want filtering when the dialog is created using > > > DialogDelegate::CreateDialogWidget() > > > > But I tested both the desktopCapture example extension (i.e. > CreateDialogWidget) > > code path and the tab delegated code path (i.e. createWebModalDialogViews), > the > > picker dialog is not listed in the picker without filtering. > > Right. DialogDelegate::CreateDialogWidget() is used when the API is called from > a background extension page that doesn't have UI context. Updated the patch to only filter when there is a parent. The problem that a parent is always passed even when there is no chrome window associated with the call is tracked in crbug/385116
PTAL
https://codereview.chromium.org/338503007/diff/20001/chrome/browser/ui/views/... File chrome/browser/ui/views/desktop_media_picker_views.cc (right): https://codereview.chromium.org/338503007/diff/20001/chrome/browser/ui/views/... chrome/browser/ui/views/desktop_media_picker_views.cc:572: if (!parent_window && !parent_web_contents) { You need just !parent_web_contents. parent_window is not relevant when deciding what type of window to show - see line 589. You may need !parent_window in line 581, for the case when Ash is not active.
https://codereview.chromium.org/338503007/diff/20001/chrome/browser/ui/views/... File chrome/browser/ui/views/desktop_media_picker_views.cc (right): https://codereview.chromium.org/338503007/diff/20001/chrome/browser/ui/views/... chrome/browser/ui/views/desktop_media_picker_views.cc:572: if (!parent_window && !parent_web_contents) { On 2014/06/16 21:48:43, Sergey Ulanov wrote: > You need just !parent_web_contents. parent_window is not relevant when deciding > what type of window to show - see line 589. You may need !parent_window in line > 581, for the case when Ash is not active. That's not true. If the parent_web_contents is NULL but parent_window is not NULL, the picker is still embedded in the parent_window and we should not filter. I've tested it by always setting parent_web_contents NULL.
https://codereview.chromium.org/338503007/diff/20001/chrome/browser/ui/views/... File chrome/browser/ui/views/desktop_media_picker_views.cc (right): https://codereview.chromium.org/338503007/diff/20001/chrome/browser/ui/views/... chrome/browser/ui/views/desktop_media_picker_views.cc:572: if (!parent_window && !parent_web_contents) { On 2014/06/16 22:07:34, jiayl wrote: > On 2014/06/16 21:48:43, Sergey Ulanov wrote: > > You need just !parent_web_contents. parent_window is not relevant when > deciding > > what type of window to show - see line 589. You may need !parent_window in > line > > 581, for the case when Ash is not active. > > That's not true. If the parent_web_contents is NULL but parent_window is not > NULL, the picker is still embedded in the parent_window and we should not > filter. I've tested it by always setting parent_web_contents NULL. Did you try it with Ash? I think with Ash you'll get a different window and you still need filtering even when parent_window!=null.
On 2014/06/16 22:14:01, Sergey Ulanov wrote: > https://codereview.chromium.org/338503007/diff/20001/chrome/browser/ui/views/... > File chrome/browser/ui/views/desktop_media_picker_views.cc (right): > > https://codereview.chromium.org/338503007/diff/20001/chrome/browser/ui/views/... > chrome/browser/ui/views/desktop_media_picker_views.cc:572: if (!parent_window && > !parent_web_contents) { > On 2014/06/16 22:07:34, jiayl wrote: > > On 2014/06/16 21:48:43, Sergey Ulanov wrote: > > > You need just !parent_web_contents. parent_window is not relevant when > > deciding > > > what type of window to show - see line 589. You may need !parent_window in > > line > > > 581, for the case when Ash is not active. > > > > That's not true. If the parent_web_contents is NULL but parent_window is not > > NULL, the picker is still embedded in the parent_window and we should not > > filter. I've tested it by always setting parent_web_contents NULL. > > Did you try it with Ash? I think with Ash you'll get a different window and you > still need filtering even when parent_window!=null. I tested on a Pixel that the picker window is not listed as a sharable window without filtering, when parnet_web_contents is NULL and parent_window not NULL. The picker is not modal, but it's still not independently captured.
Ping reviewers.
lgtm
lgtm
The CQ bit was checked by jiayl@chromium.org
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jiayl@chromium.org/338503007/20001
Message was sent while issue was closed.
Change committed as 277866 |