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

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: Review comments Created 7 years, 8 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 BOOL isSyncDialog_;
29 NSString* errorMessage_;
30
28 // Text fields don't work as well with embedded links as text views, but 31 // Text fields don't work as well with embedded links as text views, but
29 // text views cannot conveniently be created in IB. The xib file contains 32 // text views cannot conveniently be created in IB. The xib file contains
30 // a text field |informativePlaceholderTextField_| that's replaced by this 33 // a text field |informativePlaceholderTextField_| that's replaced by this
31 // text view |promo_| in -awakeFromNib. 34 // text view |promo_| in -awakeFromNib.
32 scoped_nsobject<HyperlinkTextView> informativeTextView_; 35 scoped_nsobject<HyperlinkTextView> informativeTextView_;
33 BrowserWindow::StartSyncCallback startSyncCallback_; 36 BrowserWindow::StartSyncCallback startSyncCallback_;
34 base::Closure closeCallback_; 37 base::Closure closeCallback_;
35 content::WebContents* webContents_; 38 content::WebContents* webContents_;
36 } 39 }
37 40
41 // |errorMessage| is an alternate message that will be displayed in the
Alexei Svitkine (slow) 2013/04/22 18:16:51 Add a sentence to describe the overall method.
42 // case of an authentication error, |syncCallback| is called to start sync if
43 // |isSyncDialog| is YES. |webContents| is used to open the Learn More and
44 // Advanced links and |callback| is called when the view is closing
Alexei Svitkine (slow) 2013/04/22 18:16:51 Close the sentence - i.e. you need a period.
noms (inactive) 2013/04/23 18:52:48 Done.
38 - (id)initWithNibName:(NSString*)nibName 45 - (id)initWithNibName:(NSString*)nibName
39 webContents:(content::WebContents*)webContents 46 webContents:(content::WebContents*)webContents
40 syncCallback:(const BrowserWindow::StartSyncCallback&)syncCallback 47 syncCallback:(const BrowserWindow::StartSyncCallback&)syncCallback
41 closeCallback:(const base::Closure&)callback; 48 closeCallback:(const base::Closure&)callback
49 isSyncDialog:(BOOL)isSyncDialog
50 errorMessage:(NSString*)errorMessage;
42 51
43 // Called before the view is closed. 52 // Called before the view is closed.
44 - (void)viewWillClose; 53 - (void)viewWillClose;
45 54
46 // Starts sync and closes the bubble. 55 // Starts sync and closes the bubble.
47 - (IBAction)ok:(id)sender; 56 - (IBAction)ok:(id)sender;
48 57
49 - (IBAction)onClickUndo:(id)sender; 58 - (IBAction)onClickUndo:(id)sender;
50 59
51 // Calls |advancedCallback_|. 60 // Calls |advancedCallback_|.
52 - (IBAction)onClickAdvancedLink:(id)sender; 61 - (IBAction)onClickAdvancedLink:(id)sender;
53 62
54 @end 63 @end
55 64
56 #endif // CHROME_BROWSER_UI_COCOA_ONE_CLICK_SIGNIN_VIEW_CONTROLLER_H_ 65 #endif // CHROME_BROWSER_UI_COCOA_ONE_CLICK_SIGNIN_VIEW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698