Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ozone wayland dev file dialog patches #481

Open
wants to merge 32 commits into
base: ozone-wayland-dev
Choose a base branch
from

Conversation

jkim-julie
Copy link
Member

This change is to reuse file manager from ChromeOS on Linux/ozone build.

It has steps below.
- Have Separate string resources for file manager from ChromeOS strings resources.
- Add several modules related to file manager to public folder from specific ChromeOS folder.
- Add platform folder to manage it independently on platform as it has many features dependent on ChromeOS.
- Add some guards to run ChromeOS specific code only on ChromeOS.
- Bundle web resources to Linux build.
- Implement FileSelection dialog with the extension.
Most of them are moving files from chromeos folder to chrome/browser folder.

I separated changes for managing and better readability.
We could also keep it as one patch.

fred-wang and others added 30 commits August 27, 2018 09:41
This patch enables hardware assisted video decoding via the
Chromium V4L2VDA. Including changes when Linux is used. In
order to use this, use_linux_v4l2_only flag should be set
to true.

Signed-off-by: Ryo Kodama <[email protected]>

fixup! avoid building not declared formats

"FRAME", "_SLICE",  "V4L2_PIX_FMT_VP9" are not defined in mainline
 Linux headers. This patch avoids building these formats.

Signed-off-by: Ryo Kodama <[email protected]>

Issue Igalia#437
This cl fixes interactions with window's non client area.

WindowEventFilter is now set in DesktopWindowTreeHostPlatform,
and events are properly marked as non client to avoid mouse pressed
handler be kept until release event is sent (which isn't sent at all.
See wayland/x11 protocol documentation).

Basically, it's almost the same as we had with mus.

Issue: Igalia#419

fixup! [ozone/wayland/x11] Make window interactions (move, resize, double click and etc) working

Compilation fixes.

fixup! Make window interactions (move, resize, double click and etc) working

Make sure that compound event filter is destroyed properly.

It may happen that OnClosed is closed, which leads to
DesktopNativeWidgetAura destructions. There is also another path
when DesktopNativeWidgetAura can be destroyed - CloseNow. That is,
if OnClosed has not been closed, CloseNow proceeds and destructs
DesktopNativeWidgetAura.

This patch makes it sure that the non_client_event_filter_ is destroyed
in any case.

fixup! Make window interactions (move, resize, double click and etc) working

Compilation fixes.
This patch sets XSetWindowAttributes::override_redirect to
True, which removes different properties from windows.
At this stage, all windows with width() less than 600 are treated
as menus and override_redirect is set to True.

It's almost same as we had with mus except services.

Issue Igalia#38
Issue Igalia#417
This commit adds a popup window type to ozone windows.
Popup windows are drop down windows, for example.

Issue Igalia#417

fixup! Add popup window type support.

It added case handling on WindowTreeHostPlatform::GetWindowType().
This fixes the following wheel scroll event crash on Weston:

FATAL:latency_tracker.cc(196)] Check failed:
gpu_swap_begin_component.last_event_time >=
original_component.first_event_time (42321552294 bogo-microseconds vs.
3419125241000 bogo-microseconds)

It also pairs us up with Intel's Ozone/Wayland implementation.

TBR=msisov

Issue Igalia#179
If user places the pointer/mouse on any end of a browser window, cursor
type changes accordingly, to indicated a possible interactive resize operation.

If the user crosses the browser window bounds through the same end, the mouse
type stored in ui::CursorManager isn't reset. If pointer reenters the
window through the same end, Aura tries to set the cursor type to the
same as previously (to indicate it is over the same end). During the
call chain, CursorManager::SetCursor compares the last Cursor stored
and the new one and updates the cursor instance if they differ.

In case of regular Chrome/x11 builds, the check passes because
CursorData is set to the Cursor instance, and values always differ
from the CursorData cached by CursorManager.
In case of Linux/Ozone builds, CursorData is only set on Ozone side,
so the call bail out and cursor is not updated.

Patch fixes it by resetting the cursor type whenever pointer leaves
the browser window. This ensures, when reentering from the same end, the
comparison in CursorManager::SetCursor passes, and cursor gets updated.

Issue Igalia#317
Issue Igalia#435
This patch adds an initial support to start a move loop and create
a new window by dragging a tab. To start with, this commit
extends WindowTree::PerformWindowMove, which calls
WindowServer::StartMoveLoop -> PlatformWindow::RunMoveLoop.

X11 Ozone implementation of PlatformWindow uses
WindowMoveLoopClient, which instantiates the move loop and
WholeScreenMoveLoop, which creates an invisible window
and intercepts all the events from it. Then the system screen
location is taken and sent to WindowMoveLoopClient, which
updates actual bounds of X11WindowBase.

The way it works is precisly the same as in stock X11, but
further work to share the code is needed, because there are
some difference between stock x11 and ozone x11 event
handlings, bounds set and etc.

Issue Igalia#264

fixup! [ozone/wayland] Add inital support for a tab drag window.

adapt to
https://crrev.com/c/774778

CanDispatchEvent is modified in such a way that it also tests if
the client in a move loop right now. If so, it must dispatch events
further once whole_screen_move_loop processes them in order to update
mouse locations on aura side.

fixup! [ozone/wayland] Add inital support for a tab drag window.

It removed changes at services from previous change to make it
available without mus and made WindowFinder with ozone work without
mus with creating GetLocalProcessWindowAtPointOzone to
get gfx::NativeWindow at input position.

Issue Igalia#430

fixup! Add inital support for a tab drag window.
This is a work-in-progress, which allows to fetch display data
and unblock start of ozone/x11, which crashes now.

Idieally, X11NativeDisplayDelegate should communicate with
DesktopScreenX11 (to be copied and modified and renamed to
X11DesktopScreenOzone).

fixup! [ozone/x11] Add initial display data fetching mechanism.

Compilation fixes.
X11NativeDisplayDelegate owns X11DisplayManager and it's
registered as an X11DisplayManager's observer and it starts to
communicate with it. When X11DisplayManager is created, it
gathers display information and create DisplaySnapshot.
DesktopScreenOzone gets updated display through
DesktopScreenOzone::OnConfigurationChanged,
X11NativeDisplayDelegate::GetDisplays and
DesktopScreenOzone::OnHostDisplaysReady.

fixup! Add X11DisplayManager to get display information

This patch removed OwnedDisplaySnapshot because it doesn't need to
own DisplayMode. DisplaySnapshot is created with
DisplaySnapshot::DisplayModeList, which is the list has DisplayModes.
Whenever DisplayMode is added to the list, it's cloned and kept in
the list and every DisplayMode should be in the list.
This patches fixes a pointer offset issues, which usually happens
with Ozone/Wayland (and can happen with Ozone/X11).

That is, on certain occasions, the pointer bitmap can have an offset,
which results in wrong visual location of the pointer. This makes
it hard to press ui elements in Chromium.

The reason of that behaviour is that default scale value of the
Cursor class was 0.0f (when it is not explicitly set to something
else), but the SearchTable (cursors_aura) method checks for the
bitmap hotpoints based on the lowest possible scale value, which
is 1.0f. Thus, there was an inconsitancy between the scale value
and the hotpoints. When the cursor had a scale value implicitly
set to 0.0f (in the ctor), 2x hotpoints were used.

Unit tests have also been added.

TEST: CursorTest.EnsureHotspotValuesWithoutScale and
CursorTest.EnsureHotspotValuesWithScale
- Groups ui/base/ime common types into their own GN component
  (ime_types) to break a dependency cycle on ChromeOS that
  this CL would cause otherwise.
- Move chromeos source files under is_chromeos flag to avoid
  depending them when chromeos is not used, but ime is needed.
Introduce Ozone Wayland IME integration.

This CL:
- Implements Ozone wayland specific Linux input method
  context service interface and integrates it with
  zwp_text_input_v1 protocol.
- Introduces new runtime flag --enable-wayland-ime to
  enable this feature (by default false).
- Fixes surrounding text deletion.
- Makes Wayland IME working with InputMethodAuraLinux

fixup! IME for Wayland: Ozone Wayland IME integration

Added condition before setting WaylandInputMethodContextFactory.
It introduces X11DragSource and X11DragContext to handle DnD
on Ozone/X11. They are from DesktopDragDropClientAuraX11 which
includes implementation for platform layer.

X11DragSource handles event and deliver the data at a server side
and X11DragContext handles events and read the data at a client
side.

It splits OSExchangeDataProviderAuraX11 to OSExchangeDataProviderAuraX11
and OSExchangeDataProviderAuraX11Base to resue it.
OSExchangeDataProviderAuraX11 keeps only platform event specific part.
…ing.

That is, after we've added ime imeplementation for Wayland, other
ozone platforms started to crash. To avoid this, use fake factory.

fixup! [ozone/x11/headless] Use FakeInputMethodContextFactory to avoid crashing.

Added condition before setting LinuxInputMethodContextFactory.

fixup! [ozone/x11/headless] Use FakeInputMethodContextFactory to avoid crashing.

It needs to skip DCHEK at InitializeInputMethodForTesting() as
LinuxInputMethodContextFactory's already set at
OzonePlatform::InitializeUI().
It introduces DesktopDragDropClientOzone and some APIs related to DnD
to PlatformWindowDelegate to deliver DnD status from platform and
system. OnDragEnter/OnDragMotion/OnDragDrop/OnDragLeave reports DnD
status with information based on the status. OnDragDataReceived is
called when it gets dragged data from system, OnDragDataRequest is
called when system requests dragged data and OnCloseDrag is called
when DnD is canceled or performed. These APIs are connected to
DesktopDragDropClientOzone.

It exteneds WaylandDataDevice, WaylandDataSource and WaylandDataOffer
for DnD on Wayland.

The working sequence is blow.
1) When it gets dragging.
WaylandDataDevice gets OnEnter() and DesktopDragDropClientOzone set
dragged data if it has |source_data_|. It means dragging is started
internally. After that, it continously gets Motion and Drop events.
When it gets OnDragDrop, it tries to read dragged data if it doesn't
have yet. As OnDragLeave event comes right after OnDragDrop, it
defers OnDragLeave event handling. After finishing it, it calls
callback and OnDragLeave is handled. The reason that it reads
dragged data on OnDragDrop event, it's blocked if |fd| offered by
|drag_offer_| doesn't have data yet.

2) When it sends dragging.
It calls 'wl_data_device_start_drag' through
'DesktopDragDropClientOzone::StartDragAndDrop'. After getting
OnDragEnter/Motion, it gets WaylandDataSource::OnSend() and fills
|fd| with the dragged data. If Drop is performed without problem,
it gets OnDnDDropPerformed() and OnDnDFinished(). Otherwise,
it gets OnCancel().

fixup! Implements Drag and Drop for Ozone/Wayland

It fixes conflicts based on crrev/com/c/1179505 and
crrev.com/com/c/1179487.

fixup! Implements Drag and Drop for Ozone/Wayland

It fixes compilation error with content_browsertests with adding
OnDragMotion() at StubPlatformWindowDelegate.
…r/extensions/api/

It adds file_manager folder and files for extensions APIs to share
them with Linux/Ozone build.

File manager was used only for ChromeOS and the original code is
from chrome/browser/chromeos/extensions/file_manager.
It adds file_manager for managing files to chrome/browser/
to share them with Linux/Ozone build.
It was used only for ChromeOS and the original code is
from chrome/browser/chromeos/file_manager.
It adds fileapi for managing files to chrome/browser/
to share them with Linux/Ozone build.
It was used only for ChromeOS and the original code is
from chrome/browser/chromeos/fileapi.
It adds file_system_provider for extension APIs to
chrome/browser/extensions/api to share them with Linux/Ozone
build.
It was used only for ChromeOS and the original code is
from chrome/browser/chromeos/extension/file_system_provider.
It updated file manager build path to updated path under
chrome/browser/, not chrome/browser/chromeos/
As file_manager has many features specific to ChromeOs,
it adds platform folder to handle it separately.

It's still not included for building.
…ider/

As it has many features specific to ChromeOs,
this patch adds platform folder to handle it separately.

It's still not included for building.
As it has many features specific to ChromeOs,
this patch adds platform folder to handle it separately.

It's still not included for building.
In order to share file_manager with Linux, it adds OS_CHROMEOS
guard for ChromeOS specific code.
In order to share fileapi with Linux, it adds OS_CHROMEOS
guard for ChromeOS specific code.
In order to share the extensions api code with Linux, it adds
OS_CHROMEOS guard for ChromeOS specific code.

chrome/browser/extensions/api/file_manager/ and
chrome/browser/extensions/api/file_system/ are updated.
It adds build path for file manager for linux and
updates it for ChromeOS as well.
@msisov msisov force-pushed the ozone-wayland-dev branch 2 times, most recently from 0dfc40f to c226de3 Compare October 1, 2018 07:57
@msisov msisov force-pushed the ozone-wayland-dev branch 3 times, most recently from 7c6b2bf to c3cf95e Compare October 11, 2018 09:38
@msisov
Copy link
Member

msisov commented Oct 18, 2018

let's merge it if you don't mind.

@msisov msisov force-pushed the ozone-wayland-dev branch from 5ff151d to 37f1bc5 Compare October 22, 2018 10:43
@jkim-julie jkim-julie force-pushed the ozone-wayland-dev branch 2 times, most recently from 3a61571 to f15ed30 Compare November 5, 2018 01:30
@jkim-julie jkim-julie force-pushed the ozone-wayland-dev branch 2 times, most recently from bc20ff6 to 076da08 Compare November 26, 2018 04:44
@msisov msisov force-pushed the ozone-wayland-dev branch 2 times, most recently from 087ad68 to 3460de8 Compare December 3, 2018 09:23
@ammen99
Copy link

ammen99 commented Dec 14, 2018

Hi, sorry for constantly bumping old PRs/issues (just being excited to see chrome on wayland being feature-complete), but this looks like it could be merged after a rebase?

@jkim-julie
Copy link
Member Author

Hi, sorry for constantly bumping old PRs/issues (just being excited to see chrome on wayland being feature-complete), but this looks like it could be merged after a rebase?

Hi, thanks for being interested in it.
As you can see from the changed files, it changed a lot of files and build configurations. It could have many conflicts if we keep it and try to rebase based on it. (We rebase ozone-wayland-dev branch weekly.)
So, we decided to leave it as a patch and bring it whenever we need it for products.

@ammen99
Copy link

ammen99 commented Dec 17, 2018

@jkim-julie Thanks for the clarification. I only thought this would help with the file dialogue on ozone/wayland.

msisov pushed a commit that referenced this pull request Dec 23, 2018
[email protected]

Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: If1cf52905e9c5be6cd0b6a28749b114b7e8c768a
Reviewed-on: https://chromium-review.googlesource.com/c/1316439
Reviewed-by: Krishna Govind <[email protected]>
Cr-Commit-Position: refs/branch-heads/3578@{#481}
Cr-Branched-From: 4226ddf-refs/heads/master@{#599034}
@msisov msisov force-pushed the ozone-wayland-dev branch from 0275091 to ea913bd Compare January 7, 2019 08:58
@msisov msisov force-pushed the ozone-wayland-dev branch 2 times, most recently from 21f4a33 to f4c0623 Compare January 21, 2019 06:04
@msisov msisov force-pushed the ozone-wayland-dev branch from f4c0623 to c10fc7b Compare January 28, 2019 08:14
msisov pushed a commit that referenced this pull request Jan 31, 2019
- Navigate to main sync page when sync controls page should *not* be
  available. I.e. when sync is paused, the user is signed out, sync
  is disabled or there is a sync error other than passphrase error.

- Don't show sync controls page when unified consent is disabled.

Bug: 915744
Change-Id: I762a91b170ad379c2ffb8fe9eab4f42a6414fcd0
Reviewed-on: https://chromium-review.googlesource.com/c/1380676
Reviewed-by: Scott Chen <[email protected]>
Commit-Queue: Thomas Tangl <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#617407}(cherry picked from commit 7db78b0)
Reviewed-on: https://chromium-review.googlesource.com/c/1386826
Reviewed-by: Thomas Tangl <[email protected]>
Cr-Commit-Position: refs/branch-heads/3626@{#481}
Cr-Branched-From: d897fb1-refs/heads/master@{#612437}
@msisov msisov force-pushed the ozone-wayland-dev branch from a011df3 to 6ac4d77 Compare February 4, 2019 10:03
@msisov msisov force-pushed the ozone-wayland-dev branch 2 times, most recently from 92c1adf to 14e8e28 Compare March 4, 2019 06:50
msisov pushed a commit that referenced this pull request Mar 14, 2019
[MERGE TO RELEASE BRANCH]

If EncryptEverythingAllowed() was false, then PeopleHandler already
skipped the call to EnableEncryptEverything(), but it did still call
SetEncryptionPassphrase(). That could get users into a weird state
where Sync stopped working.
This CL fixes the issue by also skipping the SetEncryptionPassphrase()
call in case EncryptEverythingAllowed() is false.

Bug: 924847
Change-Id: I3b606e3ea9d0a8f86b865b41eda233dd472cc1eb
Reviewed-on: https://chromium-review.googlesource.com/c/1439299
Reviewed-by: Michael Giuffrida <[email protected]>
Commit-Queue: Marc Treib <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#627004}(cherry picked from commit 347c098)
Reviewed-on: https://chromium-review.googlesource.com/c/1477812
Reviewed-by: Marc Treib <[email protected]>
Cr-Commit-Position: refs/branch-heads/3683@{#481}
Cr-Branched-From: e510299-refs/heads/master@{#625896}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants