[go: nahoru, domu]

Reland "Add onboarding dialog to enable camera roll for existing phone hub users"

This is a reland of 8839401c012b41eb248d4d0d6b0e6b43b09606a3

Updates in this reland:
* CameraRollManager member ui_state_ has no initial value which fails
the tests in memory sanitizer. Give an initial value to fix the issue.
* camera_roll_opt_in_view has no need to be observer of
CameraRollManager, removing the observer implementation.

Original change's description:
> Add onboarding dialog to enable camera roll for existing phone hub users
>
> Change-Id: I05d6ee2fbea31f324b18b2d57853859358872400
> Bug: NO-ISSUE
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3206668
> Commit-Queue: Jianbing Wu <jianbing@google.com>
> Auto-Submit: Jianbing Wu <jianbing@google.com>
> Reviewed-by: Jon Mann <jonmann@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#934049}

Bug: NO-ISSUE
Change-Id: Ie664bf8ca0eea0ab16c3fe456cfa10ee3270b0e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3245480
Commit-Queue: Jianbing Wu <jianbing@google.com>
Auto-Submit: Jianbing Wu <jianbing@google.com>
Reviewed-by: Jon Mann <jonmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#936194}
diff --git a/ash/system/phonehub/camera_roll_view.h b/ash/system/phonehub/camera_roll_view.h
index 350aa66..a8bcbaf 100644
--- a/ash/system/phonehub/camera_roll_view.h
+++ b/ash/system/phonehub/camera_roll_view.h
@@ -6,6 +6,7 @@
 #define ASH_SYSTEM_PHONEHUB_CAMERA_ROLL_VIEW_H_
 
 #include "ash/ash_export.h"
+#include "ash/system/phonehub/camera_roll_opt_in_view.h"
 #include "base/gtest_prod_util.h"
 #include "chromeos/components/phonehub/camera_roll_manager.h"
 #include "ui/views/view.h"
@@ -34,12 +35,14 @@
   CameraRollView operator=(CameraRollView&) = delete;
 
   // chromeos::phonehub::CameraRollManager::Observer:
-  void OnCameraRollItemsChanged() override;
+  void OnCameraRollViewUiStateUpdated() override;
 
   // views::View:
   const char* GetClassName() const override;
 
  private:
+  FRIEND_TEST_ALL_PREFIXES(CameraRollViewTest, DisplayOptInView);
+  FRIEND_TEST_ALL_PREFIXES(CameraRollViewTest, OptInAlready);
   FRIEND_TEST_ALL_PREFIXES(CameraRollViewTest, ViewLayout);
 
   class CameraRollItemsView : public views::View {
@@ -71,6 +74,7 @@
 
   chromeos::phonehub::CameraRollManager* camera_roll_manager_ = nullptr;
   chromeos::phonehub::UserActionRecorder* user_action_recorder_ = nullptr;
+  CameraRollOptInView* opt_in_view_ = nullptr;
   CameraRollItemsView* items_view_ = nullptr;
 };