Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / profiles / profile_signin_confirmation_dialog_cocoa.h
blob47160ae1ef73ce86a150299ab2b5e0927f89657d
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.
5 #ifndef CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_DIALOG_COCOA_
6 #define CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_DIALOG_COCOA_
8 #import <Cocoa/Cocoa.h>
10 #include <string>
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"
20 class Browser;
21 class Profile;
23 namespace content {
24 class WebContents;
27 namespace ui {
28 class ProfileSigninConfirmationDelegate;
31 // A constrained dialog that confirms Chrome sign-in for enterprise users.
32 class 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();
44 // Shows the dialog if needed.
45 static void Show(Browser* browser,
46 content::WebContents* web_contents,
47 Profile* profile,
48 const std::string& username,
49 ui::ProfileSigninConfirmationDelegate* delegate);
51 // Closes the dialog, which deletes itself.
52 void Close();
54 private:
55 // ConstrainedWindowMacDelegate:
56 void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override;
58 // Controller for the dialog view.
59 base::scoped_nsobject<ProfileSigninConfirmationViewController> controller_;
61 // The constrained window that contains the dialog view.
62 scoped_ptr<ConstrainedWindowMac> window_;
64 DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialogCocoa);
67 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_SIGNIN_CONFIRMATION_DIALOG_COCOA_