[lacros] support orientation lock

* Adds a new Lacros screen orientation delegate which communicates via wayland_extension.
  * Updates the ScreenOrientationDelegate API so that ScreenOrientationProviderSupported receives the web contents
* Adds a new aura-toplevel interface which provides the ability to set the orientation lock
* Moves the implementation of the client_controlled_shell_surface to shell_surface_base so that its implementation can be shared by both aura-toplevel and remote-shell.

Bug: 1220784
Change-Id: Ie21c76ea8065f4e236c802228cc7bd64fea6ad44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3176186
Commit-Queue: Jonah Williams <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: Roland Bock <[email protected]>
Reviewed-by: Bo <[email protected]>
Reviewed-by: Mitsuru Oshima <[email protected]>
Cr-Commit-Position: refs/heads/main@{#931147}
diff --git a/components/exo/wayland/zaura_shell.h b/components/exo/wayland/zaura_shell.h
index f51497f..c9a61bd0 100644
--- a/components/exo/wayland/zaura_shell.h
+++ b/components/exo/wayland/zaura_shell.h
@@ -16,9 +16,12 @@
 struct wl_resource;
 
 namespace exo {
+
+class ShellSurfaceBase;
+
 namespace wayland {
 
-constexpr uint32_t kZAuraShellVersion = 26;
+constexpr uint32_t kZAuraShellVersion = 27;
 
 // Adds bindings to the Aura Shell. Normally this implies Ash on ChromeOS
 // builds. On non-ChromeOS builds the protocol provides access to Aura windowing
@@ -63,6 +66,7 @@
   void SetInitialWorkspace(const char* initial_workspace);
   void Pin(bool trusted);
   void Unpin();
+  void SetOrientationLock(uint32_t orientation_lock);
 
   // Overridden from SurfaceObserver:
   void OnSurfaceDestroying(Surface* surface) override;
@@ -92,6 +96,20 @@
       const SkRegion& occluded_region);
 };
 
+// Provides an implementation for top level operations on the shell.
+class AuraToplevel {
+ public:
+  AuraToplevel(ShellSurfaceBase* shell_surface);
+  AuraToplevel(const AuraToplevel&) = delete;
+  AuraToplevel& operator=(const AuraToplevel&) = delete;
+  ~AuraToplevel();
+
+  void SetOrientationLock(uint32_t lock_type);
+
+ private:
+  ShellSurfaceBase* shell_surface_;
+};
+
 }  // namespace wayland
 }  // namespace exo