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