Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: chrome/browser/ui/cocoa/one_click_signin_view_controller.h

Issue 13845022: Mac: Display a native bubble (instead of the JS one) after the web signin flow. (branched from http… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ntpBubble
Patch Set: Ditto Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_ONE_CLICK_SIGNIN_VIEW_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_ONE_CLICK_SIGNIN_VIEW_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_ONE_CLICK_SIGNIN_VIEW_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_COCOA_ONE_CLICK_SIGNIN_VIEW_CONTROLLER_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/memory/scoped_nsobject.h" 11 #include "base/memory/scoped_nsobject.h"
12 #include "chrome/browser/ui/browser_window.h" 12 #include "chrome/browser/ui/browser_window.h"
13 13
14 @class BrowserWindowController; 14 @class BrowserWindowController;
15 namespace content { 15 namespace content {
16 class WebContents; 16 class WebContents;
17 } 17 }
18 @class HyperlinkTextView; 18 @class HyperlinkTextView;
19 19
20 // View controller for the one-click signin confirmation UI. 20 // View controller for the one-click signin confirmation UI.
21 @interface OneClickSigninViewController : NSViewController<NSTextViewDelegate> { 21 @interface OneClickSigninViewController : NSViewController<NSTextViewDelegate> {
22 @private 22 @private
23 IBOutlet NSTextField* messageTextField_; 23 IBOutlet NSTextField* messageTextField_;
24 IBOutlet NSTextField* informativePlaceholderTextField_; 24 IBOutlet NSTextField* informativePlaceholderTextField_;
25 IBOutlet NSButton* advancedLink_; 25 IBOutlet NSButton* advancedLink_;
26 IBOutlet NSButton* closeButton_; 26 IBOutlet NSButton* closeButton_;
27 27
28 // This is YES if this is the modal sync confirmation dialog. 28 // This is YES if this is the modal sync confirmation dialog.
29 BOOL isModalDialog_; 29 BOOL isSyncDialog_;
30 30
31 // This is YES if the user clicked the Learn More link before another action. 31 // This is YES if the user clicked the Learn More link before another action.
32 BOOL clickedLearnMore_; 32 BOOL clickedLearnMore_;
33 33
34 scoped_nsobject<NSString> errorMessage_;
35
34 // Text fields don't work as well with embedded links as text views, but 36 // Text fields don't work as well with embedded links as text views, but
35 // text views cannot conveniently be created in IB. The xib file contains 37 // text views cannot conveniently be created in IB. The xib file contains
36 // a text field |informativePlaceholderTextField_| that's replaced by this 38 // a text field |informativePlaceholderTextField_| that's replaced by this
37 // text view |promo_| in -awakeFromNib. 39 // text view |promo_| in -awakeFromNib.
38 scoped_nsobject<HyperlinkTextView> informativeTextView_; 40 scoped_nsobject<HyperlinkTextView> informativeTextView_;
39 BrowserWindow::StartSyncCallback startSyncCallback_; 41 BrowserWindow::StartSyncCallback startSyncCallback_;
40 base::Closure closeCallback_; 42 base::Closure closeCallback_;
41 content::WebContents* webContents_; 43 content::WebContents* webContents_;
42 } 44 }
43 45
44 // Initializes the controller from a xib file. 46 // Initializes the controller from a nib file, with an alternate |errorMessage|
45 // |syncCallback| is used to start sync, |webContents| is used to 47 // that can be displayed in the case of an authentication error,
46 // display the Learn More page, and |closeCallback| is called 48 // |syncCallback| is called to start sync if |isSyncDialog| is YES,
47 // when the view closes. 49 // |webContents| is used to open the Learn More and Advanced links and
50 // |callback| is called when the view is closing.
48 - (id)initWithNibName:(NSString*)nibName 51 - (id)initWithNibName:(NSString*)nibName
49 webContents:(content::WebContents*)webContents 52 webContents:(content::WebContents*)webContents
50 syncCallback:(const BrowserWindow::StartSyncCallback&)syncCallback 53 syncCallback:(const BrowserWindow::StartSyncCallback&)syncCallback
51 closeCallback:(const base::Closure&)callback 54 closeCallback:(const base::Closure&)callback
52 isModalDialog:(BOOL)isModalDialog; 55 isSyncDialog:(BOOL)isSyncDialog
56 errorMessage:(NSString*)errorMessage;
53 57
54 // Called before the view is closed. 58 // Called before the view is closed.
55 - (void)viewWillClose; 59 - (void)viewWillClose;
56 60
57 // Starts sync and closes the bubble. 61 // Starts sync and closes the bubble.
58 - (IBAction)ok:(id)sender; 62 - (IBAction)ok:(id)sender;
59 63
60 // Starts sync and closes the bubble. 64 // Starts sync and closes the bubble.
61 - (IBAction)onClickClose:(id)sender; 65 - (IBAction)onClickClose:(id)sender;
62 66
63 // Does not start sync and closes the bubble. 67 // Does not start sync and closes the bubble.
64 - (IBAction)onClickUndo:(id)sender; 68 - (IBAction)onClickUndo:(id)sender;
65 69
66 // Calls |advancedCallback_|. 70 // Calls |advancedCallback_|.
67 - (IBAction)onClickAdvancedLink:(id)sender; 71 - (IBAction)onClickAdvancedLink:(id)sender;
68 72
69 @end 73 @end
70 74
71 #endif // CHROME_BROWSER_UI_COCOA_ONE_CLICK_SIGNIN_VIEW_CONTROLLER_H_ 75 #endif // CHROME_BROWSER_UI_COCOA_ONE_CLICK_SIGNIN_VIEW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698