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 3// found in the LICENSE file. 4 5#ifndef CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_DIALOG_COCOA_ 6#define CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_DIALOG_COCOA_ 7 8#import <Cocoa/Cocoa.h> 9 10#include <string> 11 12#include "base/callback.h" 13#include "base/compiler_specific.h" 14#include "base/mac/scoped_nsobject.h" 15#include "base/memory/scoped_ptr.h" 16#include "base/memory/weak_ptr.h" 17#include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" 18#include "chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_view_controller.h" 19 20class Browser; 21class Profile; 22 23namespace content { 24class WebContents; 25} 26 27namespace ui { 28class ProfileSigninConfirmationDelegate; 29} 30 31// A constrained dialog that confirms Chrome sign-in for enterprise users. 32class ProfileSigninConfirmationDialogCocoa : ConstrainedWindowMacDelegate { 33 public: 34 // Creates and shows the dialog, which owns itself. 35 ProfileSigninConfirmationDialogCocoa( 36 Browser* browser, 37 content::WebContents* web_contents, 38 Profile* profile, 39 const std::string& username, 40 ui::ProfileSigninConfirmationDelegate* delegate, 41 bool offer_profile_creation); 42 virtual ~ProfileSigninConfirmationDialogCocoa(); 43 44 // Closes the dialog, which deletes itself. 45 void Close(); 46 47 private: 48 // ConstrainedWindowMacDelegate: 49 virtual void OnConstrainedWindowClosed(ConstrainedWindowMac* window) OVERRIDE; 50 51 // Controller for the dialog view. 52 base::scoped_nsobject<ProfileSigninConfirmationViewController> controller_; 53 54 // The constrained window that contains the dialog view. 55 scoped_ptr<ConstrainedWindowMac> window_; 56 57 DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialogCocoa); 58}; 59 60#endif // CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_DIALOG_COCOA_ 61