1c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch// Copyright 2014 The Chromium Authors. All rights reserved. 2868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 3868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// found in the LICENSE file. 4868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 5c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch#ifndef CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_VIEW_CONTROLLER_ 6c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch#define CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_VIEW_CONTROLLER_ 7868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 8868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#import <Cocoa/Cocoa.h> 9868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include <string> 10868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 11868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "base/callback.h" 12eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "base/mac/scoped_nsobject.h" 13868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h" 14868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 15868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)@class HyperlinkTextView; 16868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)class Browser; 17868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)class Profile; 18868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 19868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)namespace ui { 20868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)class ProfileSigninConfirmationDelegate; 21868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)} 22868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 23868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)@interface ProfileSigninConfirmationViewController 24868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) : NSViewController<NSTextViewDelegate> { 25868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) @private 26868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // The browser object for the sign-in tab. 27868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) Browser* browser_; 28868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 29868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // The GAIA username being signed in. 30868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) std::string username_; 31868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 32868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // Indicates whether the user should be given the option to 33868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // create a new profile before completing sign-in. 34868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) bool offerProfileCreation_; 35868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 36868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // Dialog button callbacks. 37868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) ui::ProfileSigninConfirmationDelegate* delegate_; 38868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) base::Closure closeDialogCallback_; 39868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 40868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // UI elements. 41eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch base::scoped_nsobject<NSBox> promptBox_; 42eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch base::scoped_nsobject<NSButton> closeButton_; 43eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch base::scoped_nsobject<NSTextField> titleField_; 44eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch base::scoped_nsobject<NSTextField> promptField_; 45eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch base::scoped_nsobject<NSTextView> explanationField_; 46eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch base::scoped_nsobject<ConstrainedWindowButton> createProfileButton_; 47eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch base::scoped_nsobject<ConstrainedWindowButton> cancelButton_; 48eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch base::scoped_nsobject<ConstrainedWindowButton> okButton_; 49868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)} 50868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 51868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)- (id)initWithBrowser:(Browser*)browser 52868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) username:(const std::string&)username 53868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) delegate:(ui::ProfileSigninConfirmationDelegate*)delegate 54868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) closeDialogCallback:(const base::Closure&)closeDialogCallback 55868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) offerProfileCreation:(bool)offer; 56868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)- (IBAction)cancel:(id)sender; 57868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)- (IBAction)ok:(id)sender; 58868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)- (IBAction)close:(id)sender; 59868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)- (IBAction)createProfile:(id)sender; 60868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 61868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)@end 62868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 63868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)@interface ProfileSigninConfirmationViewController (TestingAPI) 64868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 65868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)@property(readonly, nonatomic) ui::ProfileSigninConfirmationDelegate* delegate; 66eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch@property(readonly, nonatomic) NSButton* createProfileButton; 67868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)@property(readonly, nonatomic) NSTextView* explanationField; 68868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 69868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)@end 70868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 71c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch#endif // CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_VIEW_CONTROLLER_ 72