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 #include "content/public/browser/web_contents_delegate.h" | |
12 | |
13 class Browser; | |
14 class Profile; | |
15 | |
16 namespace views { | |
17 class WebView; | |
18 } | |
19 | |
20 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
| |
21 public: | |
22 class Observer { | |
23 public: | |
24 // Called when the modal signin window should be closed as a result of a | |
25 // direct or indirect user action, such as when signin is completed or | |
26 // cancelled. | |
27 virtual void OnCloseRequested() = 0; | |
28 }; | |
29 | |
30 SigninViewController(); | |
31 ~SigninViewController() override; | |
32 | |
33 // Returns true if the signin flow should be shown as tab-modal for |mode|. | |
34 static bool ShouldShowModalSigninForMode(profiles::BubbleViewMode mode); | |
35 | |
36 // Creates the web view that contains the signin flow in |mode| using | |
37 // |profile| as the web content's profile, then sets |delegate| as the created | |
38 // web content's delegate. | |
39 static views::WebView* CreateGaiaWebView(WebContentsDelegate* delegate, | |
40 profiles::BubbleViewMode mode, | |
41 Profile* profile); | |
42 | |
43 // Shows the signin flow as a tab modal dialog attached to |browser|'s active | |
44 // web contents. | |
45 void ShowModalSignin(profiles::BubbleViewMode mode, Browser* browser); | |
46 | |
47 // Closes the tab-modal signin flow previously shown using this | |
48 // SigninViewController, if one exists. Does nothing otherwise. | |
49 void CloseModalSignin(); | |
50 | |
51 void AddObserver(Observer* observer); | |
52 void RemoveObserver(Observer* observer); | |
53 | |
54 private: | |
55 base::ObserverList<Observer> observers_; | |
56 | |
57 DISALLOW_COPY_AND_ASSIGN(SigninViewController); | |
58 }; | |
59 | |
60 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_SIGNIN_VIEW_CONTROLLER_H_ | |
OLD | NEW |