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