OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_VIEW_CONTRO
LLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_VIEW_CONTRO
LLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_VIEW_CONTRO
LLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_VIEW_CONTRO
LLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <memory> |
9 #include <string> | 10 #include <string> |
10 | 11 |
11 #include "base/callback.h" | 12 #include "base/callback.h" |
12 #include "base/mac/scoped_nsobject.h" | 13 #include "base/mac/scoped_nsobject.h" |
13 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h
" | 14 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h
" |
14 | 15 |
15 @class HyperlinkTextView; | 16 @class HyperlinkTextView; |
16 class Browser; | 17 class Browser; |
17 | 18 |
18 namespace ui { | 19 namespace ui { |
19 class ProfileSigninConfirmationDelegate; | 20 class ProfileSigninConfirmationDelegate; |
20 } | 21 } |
21 | 22 |
22 @interface ProfileSigninConfirmationViewController | 23 @interface ProfileSigninConfirmationViewController |
23 : NSViewController<NSTextViewDelegate> { | 24 : NSViewController<NSTextViewDelegate> { |
24 @private | 25 @private |
25 // The browser object for the sign-in tab. | 26 // The browser object for the sign-in tab. |
26 Browser* browser_; | 27 Browser* browser_; |
27 | 28 |
28 // The GAIA username being signed in. | 29 // The GAIA username being signed in. |
29 std::string username_; | 30 std::string username_; |
30 | 31 |
31 // Indicates whether the user should be given the option to | 32 // Indicates whether the user should be given the option to |
32 // create a new profile before completing sign-in. | 33 // create a new profile before completing sign-in. |
33 bool offerProfileCreation_; | 34 bool offerProfileCreation_; |
34 | 35 |
35 // Dialog button callbacks. | 36 // Dialog button callbacks. |
36 ui::ProfileSigninConfirmationDelegate* delegate_; | 37 std::unique_ptr<ui::ProfileSigninConfirmationDelegate> delegate_; |
37 base::Closure closeDialogCallback_; | 38 base::Closure closeDialogCallback_; |
38 | 39 |
39 // UI elements. | 40 // UI elements. |
40 base::scoped_nsobject<NSBox> promptBox_; | 41 base::scoped_nsobject<NSBox> promptBox_; |
41 base::scoped_nsobject<NSButton> closeButton_; | 42 base::scoped_nsobject<NSButton> closeButton_; |
42 base::scoped_nsobject<NSTextField> titleField_; | 43 base::scoped_nsobject<NSTextField> titleField_; |
43 base::scoped_nsobject<NSTextField> promptField_; | 44 base::scoped_nsobject<NSTextField> promptField_; |
44 base::scoped_nsobject<NSTextView> explanationField_; | 45 base::scoped_nsobject<NSTextView> explanationField_; |
45 base::scoped_nsobject<ConstrainedWindowButton> createProfileButton_; | 46 base::scoped_nsobject<ConstrainedWindowButton> createProfileButton_; |
46 base::scoped_nsobject<ConstrainedWindowButton> cancelButton_; | 47 base::scoped_nsobject<ConstrainedWindowButton> cancelButton_; |
47 base::scoped_nsobject<ConstrainedWindowButton> okButton_; | 48 base::scoped_nsobject<ConstrainedWindowButton> okButton_; |
48 } | 49 } |
49 | 50 |
50 - (id)initWithBrowser:(Browser*)browser | 51 - (id)initWithBrowser:(Browser*)browser |
51 username:(const std::string&)username | 52 username:(const std::string&)username |
52 delegate:(ui::ProfileSigninConfirmationDelegate*)delegate | 53 delegate: |
53 closeDialogCallback:(const base::Closure&)closeDialogCallback | 54 (std::unique_ptr<ui::ProfileSigninConfirmationDelegate>) |
54 offerProfileCreation:(bool)offer; | 55 delegate |
| 56 closeDialogCallback:(const base::Closure&)closeDialogCallback |
| 57 offerProfileCreation:(bool)offer; |
55 - (IBAction)cancel:(id)sender; | 58 - (IBAction)cancel:(id)sender; |
56 - (IBAction)ok:(id)sender; | 59 - (IBAction)ok:(id)sender; |
57 - (IBAction)close:(id)sender; | 60 - (IBAction)close:(id)sender; |
58 - (IBAction)createProfile:(id)sender; | 61 - (IBAction)createProfile:(id)sender; |
59 | 62 |
60 @end | 63 @end |
61 | 64 |
62 @interface ProfileSigninConfirmationViewController (TestingAPI) | |
63 | |
64 @property(readonly, nonatomic) ui::ProfileSigninConfirmationDelegate* delegate; | |
65 @property(readonly, nonatomic) NSButton* createProfileButton; | |
66 @property(readonly, nonatomic) NSTextView* explanationField; | |
67 | |
68 @end | |
69 | |
70 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_VIEW_CON
TROLLER_H_ | 65 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_VIEW_CON
TROLLER_H_ |
OLD | NEW |