OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_SIGNIN_VIEW_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_SIGNIN_VIEW_CONTROLLER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/observer_list.h" |
| 10 #include "chrome/browser/ui/profile_chooser_constants.h" |
| 11 |
| 12 class Browser; |
| 13 class ModalSigninDelegate; |
| 14 class Profile; |
| 15 |
| 16 namespace content { |
| 17 class WebContentsDelegate; |
| 18 } |
| 19 |
| 20 namespace views { |
| 21 class WebView; |
| 22 } |
| 23 |
| 24 class SigninViewController { |
| 25 public: |
| 26 SigninViewController(); |
| 27 ~SigninViewController(); |
| 28 |
| 29 // Returns true if the signin flow should be shown as tab-modal for |mode|. |
| 30 static bool ShouldShowModalSigninForMode(profiles::BubbleViewMode mode); |
| 31 |
| 32 // Creates the web view that contains the signin flow in |mode| using |
| 33 // |profile| as the web content's profile, then sets |delegate| as the created |
| 34 // web content's delegate. |
| 35 static views::WebView* CreateGaiaWebView( |
| 36 content::WebContentsDelegate* delegate, |
| 37 profiles::BubbleViewMode mode, |
| 38 Profile* profile); |
| 39 |
| 40 // Shows the signin flow as a tab modal dialog attached to |browser|'s active |
| 41 // web contents. |
| 42 void ShowModalSignin(profiles::BubbleViewMode mode, Browser* browser); |
| 43 |
| 44 // Closes the tab-modal signin flow previously shown using this |
| 45 // SigninViewController, if one exists. Does nothing otherwise. |
| 46 void CloseModalSignin(); |
| 47 |
| 48 // Notifies this object that it's |modal_signin_delegate_| member has become |
| 49 // invalid. |
| 50 void ResetModalSigninDelegate(); |
| 51 |
| 52 private: |
| 53 ModalSigninDelegate* modal_signin_delegate_; |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(SigninViewController); |
| 56 }; |
| 57 |
| 58 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_SIGNIN_VIEW_CONTROLLER_H_ |
OLD | NEW |