Index: chrome/browser/ui/views/profiles/signin_view_controller.h |
diff --git a/chrome/browser/ui/views/profiles/signin_view_controller.h b/chrome/browser/ui/views/profiles/signin_view_controller.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9ef0a38e79d7acd23320e52e4f1c22865bd98559 |
--- /dev/null |
+++ b/chrome/browser/ui/views/profiles/signin_view_controller.h |
@@ -0,0 +1,60 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_SIGNIN_VIEW_CONTROLLER_H_ |
+#define CHROME_BROWSER_UI_VIEWS_PROFILES_SIGNIN_VIEW_CONTROLLER_H_ |
+ |
+#include "base/macros.h" |
+#include "base/observer_list.h" |
+#include "chrome/browser/ui/profile_chooser_constants.h" |
+#include "content/public/browser/web_contents_delegate.h" |
+ |
+class Browser; |
+class Profile; |
+ |
+namespace views { |
+class WebView; |
+} |
+ |
+class SigninViewController : public content::WebContentsDelegate { |
sky
2015/12/01 21:12:37
Why do you need this and ModalSigninDelegate to be
anthonyvd
2015/12/01 22:25:04
I don't believe I need it, it's some leftover from
|
+ public: |
+ class Observer { |
+ public: |
+ // Called when the modal signin window should be closed as a result of a |
+ // direct or indirect user action, such as when signin is completed or |
+ // cancelled. |
+ virtual void OnCloseRequested() = 0; |
+ }; |
+ |
+ SigninViewController(); |
+ ~SigninViewController() override; |
+ |
+ // Returns true if the signin flow should be shown as tab-modal for |mode|. |
+ static bool ShouldShowModalSigninForMode(profiles::BubbleViewMode mode); |
+ |
+ // Creates the web view that contains the signin flow in |mode| using |
+ // |profile| as the web content's profile, then sets |delegate| as the created |
+ // web content's delegate. |
+ static views::WebView* CreateGaiaWebView(WebContentsDelegate* delegate, |
+ profiles::BubbleViewMode mode, |
+ Profile* profile); |
+ |
+ // Shows the signin flow as a tab modal dialog attached to |browser|'s active |
+ // web contents. |
+ void ShowModalSignin(profiles::BubbleViewMode mode, Browser* browser); |
+ |
+ // Closes the tab-modal signin flow previously shown using this |
+ // SigninViewController, if one exists. Does nothing otherwise. |
+ void CloseModalSignin(); |
+ |
+ void AddObserver(Observer* observer); |
+ void RemoveObserver(Observer* observer); |
+ |
+ private: |
+ base::ObserverList<Observer> observers_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(SigninViewController); |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_VIEWS_PROFILES_SIGNIN_VIEW_CONTROLLER_H_ |