full_restore: Pre flight CL for ARC windows created without tasks.

Adds OnARCTaskReadyForUnparentedWindow. I think this is a clearer
signal than calling OnWindowInitialized again, because the window has
already been initialized for a while at this point.

Refactors some code in FullRestoreController that will be used in
both OnWidgetInitialized and OnARCTaskReadyForUnparentedWindow.

Bug: 1205148
Test: none
Change-Id: Ia1557269ab4f67e425f435537ee55acbe10c6314
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2880797
Commit-Queue: Sammie Quon <[email protected]>
Reviewed-by: Nancy Wang <[email protected]>
Reviewed-by: Jeremy Chinsen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#881175}
diff --git a/components/full_restore/full_restore_info.h b/components/full_restore/full_restore_info.h
index f9bda6da..fd6d43a 100644
--- a/components/full_restore/full_restore_info.h
+++ b/components/full_restore/full_restore_info.h
@@ -60,6 +60,11 @@
     // ARC task also may not be created yet at this point.
     virtual void OnWidgetInitialized(views::Widget* widget) {}
 
+    // Called once a window which was created without an associated task is now
+    // associated with a ARC task. Will not be called for non-ARC windows, or
+    // ARC windows created with an associated task.
+    virtual void OnARCTaskReadyForUnparentedWindow(aura::Window* window) {}
+
    protected:
     ~Observer() override = default;
   };
@@ -93,6 +98,10 @@
   // Notifies observers that |widget| has been initialized.
   void OnWidgetInitialized(views::Widget* widget);
 
+  // Notifies observers that `window`, which previously had no associated task,
+  // now has one.
+  void OnARCTaskReadyForUnparentedWindow(aura::Window* window);
+
  private:
   base::ObserverList<Observer> observers_;