[go: nahoru, domu]

pine: Create and show pine image

- Take a snapshot prior to shutdown. Alter the existing flow by
  grabbing a snapshot if the active desk has at least one child before
  starting the shutdown animation. The shutdown process will start
  after the screenshot is taken and be blocked until the screenshot
  encoding and writing to disk are completed.
- If the snapshot exists, show it in the pine dialog as ImageView.

Bug: b/319474423
Test: Added unit test + manually
Change-Id: I4d93171c4ff98a815e2f3f7e36b53ba47d160c77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5200614
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Commit-Queue: Min Chen <minch@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1250426}
diff --git a/ash/wm/lock_state_controller_test_api.h b/ash/wm/lock_state_controller_test_api.h
index 1d99214c..c592867 100644
--- a/ash/wm/lock_state_controller_test_api.h
+++ b/ash/wm/lock_state_controller_test_api.h
@@ -42,6 +42,10 @@
     controller_->real_shutdown_timer_.Stop();
   }
 
+  void set_pine_image_callback(base::OnceClosure callback) {
+    controller_->pine_image_callback_for_test_ = std::move(callback);
+  }
+
  private:
   raw_ptr<LockStateController, DanglingUntriaged> controller_;  // not owned
 };