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