OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS_H_ |
7 | 7 |
8 #include <memory> | |
9 | |
10 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 9 #include "base/macros.h" |
12 #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h" | 10 #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h" |
13 #include "ui/views/controls/button/button.h" | 11 #include "ui/views/controls/button/button.h" |
14 #include "ui/views/controls/link_listener.h" | 12 #include "ui/views/controls/link_listener.h" |
15 #include "ui/views/controls/styled_label_listener.h" | 13 #include "ui/views/controls/styled_label_listener.h" |
16 #include "ui/views/window/dialog_delegate.h" | 14 #include "ui/views/window/dialog_delegate.h" |
17 | 15 |
18 class Browser; | 16 class Browser; |
19 class Profile; | 17 class Profile; |
20 | 18 |
21 // A tab-modal dialog to allow a user signing in with a managed account | 19 // A tab-modal dialog to allow a user signing in with a managed account |
22 // to create a new Chrome profile. | 20 // to create a new Chrome profile. |
23 class ProfileSigninConfirmationDialogViews : public views::DialogDelegateView, | 21 class ProfileSigninConfirmationDialogViews : public views::DialogDelegateView, |
24 public views::StyledLabelListener, | 22 public views::StyledLabelListener, |
25 public views::ButtonListener { | 23 public views::ButtonListener { |
26 public: | 24 public: |
27 // Create and show the dialog, which owns itself. | 25 // Create and show the dialog, which owns itself. |
28 static void ShowDialog( | 26 static void ShowDialog(Browser* browser, |
29 Browser* browser, | 27 Profile* profile, |
30 Profile* profile, | 28 const std::string& username, |
31 const std::string& username, | 29 ui::ProfileSigninConfirmationDelegate* delegate); |
32 std::unique_ptr<ui::ProfileSigninConfirmationDelegate> delegate); | |
33 | 30 |
34 private: | 31 private: |
35 ProfileSigninConfirmationDialogViews( | 32 ProfileSigninConfirmationDialogViews( |
36 Browser* browser, | 33 Browser* browser, |
37 const std::string& username, | 34 const std::string& username, |
38 std::unique_ptr<ui::ProfileSigninConfirmationDelegate> delegate); | 35 ui::ProfileSigninConfirmationDelegate* delegate); |
39 ~ProfileSigninConfirmationDialogViews() override; | 36 ~ProfileSigninConfirmationDialogViews() override; |
40 | 37 |
41 // views::DialogDelegateView: | 38 // views::DialogDelegateView: |
42 base::string16 GetWindowTitle() const override; | 39 base::string16 GetWindowTitle() const override; |
43 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | 40 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; |
44 int GetDefaultDialogButton() const override; | 41 int GetDefaultDialogButton() const override; |
45 views::View* CreateExtraView() override; | 42 views::View* CreateExtraView() override; |
46 bool Accept() override; | 43 bool Accept() override; |
47 bool Cancel() override; | 44 bool Cancel() override; |
48 ui::ModalType GetModalType() const override; | 45 ui::ModalType GetModalType() const override; |
(...skipping 16 matching lines...) Expand all Loading... |
65 // is true, the dialog will offer to create a new profile before signin. | 62 // is true, the dialog will offer to create a new profile before signin. |
66 void Show(bool prompt_for_new_profile); | 63 void Show(bool prompt_for_new_profile); |
67 | 64 |
68 // Weak ptr to parent view. | 65 // Weak ptr to parent view. |
69 Browser* browser_; | 66 Browser* browser_; |
70 | 67 |
71 // The GAIA username being signed in. | 68 // The GAIA username being signed in. |
72 std::string username_; | 69 std::string username_; |
73 | 70 |
74 // Dialog button handler. | 71 // Dialog button handler. |
75 std::unique_ptr<ui::ProfileSigninConfirmationDelegate> delegate_; | 72 ui::ProfileSigninConfirmationDelegate* delegate_; |
76 | 73 |
77 // Whether the user should be prompted to create a new profile. | 74 // Whether the user should be prompted to create a new profile. |
78 bool prompt_for_new_profile_; | 75 bool prompt_for_new_profile_; |
79 | 76 |
80 DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialogViews); | 77 DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialogViews); |
81 }; | 78 }; |
82 | 79 |
83 #endif // CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS
_H_ | 80 #endif // CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS
_H_ |
OLD | NEW |