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