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

Side by Side Diff: chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog.h

Issue 12221111: Add a modal confirmation dialog to the enterprise profile sign-in flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cancel signin when user closes the tab; class comments Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 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_WEBUI_SIGNIN_PROFILE_SIGNIN_CONFIRMATION_DIALOG_H_
6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_PROFILE_SIGNIN_CONFIRMATION_DIALOG_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/string16.h"
12 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h"
13 #include "ui/base/ui_base_types.h"
14 #include "ui/web_dialogs/web_dialog_delegate.h"
15
16 class Profile;
17 class WebUIMessageHandler;
18
19 // A tab-modal dialog to allow a user signing in with a managed account
20 // to create a new Chrome profile.
21 class ProfileSigninConfirmationDialog : public ui::WebDialogDelegate {
22 public:
23 // Create and show the modal dialog. |profile| is the current Chrome
James Hawkins 2013/02/12 21:40:40 nit: Creates and shows
dconnelly 2013/02/13 09:02:27 Done.
24 // profile and |username| is the GAIA username that the user is signing
25 // in with.
26 static void ShowDialog(Profile* profile,
27 const std::string& username,
28 const base::Closure& cancel_signin,
29 const base::Closure& signin_with_new_profile,
30 const base::Closure& continue_signin);
31
32 // Programmatically lose the dialog, which will delete itself.
James Hawkins 2013/02/12 21:40:40 nit: Not sure what you mean by 'lose' here, and th
dconnelly 2013/02/13 09:02:27 Done.
33 void Close() const;
34
35 private:
36 ProfileSigninConfirmationDialog(
37 Profile* profile,
38 const std::string& username,
39 const base::Closure& cancel_signin,
40 const base::Closure& signin_with_new_profile,
41 const base::Closure& continue_signin);
42 virtual ~ProfileSigninConfirmationDialog();
43
44 // Overridden from WebDialogDelegate:
James Hawkins 2013/02/12 21:40:40 // WebDialogDelegate implementation.
dconnelly 2013/02/13 09:02:27 Done.
45 virtual ui::ModalType GetDialogModalType() const OVERRIDE;
46 virtual string16 GetDialogTitle() const OVERRIDE;
47 virtual GURL GetDialogContentURL() const OVERRIDE;
48 virtual void GetWebUIMessageHandlers(
49 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE;
50 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE;
51 virtual std::string GetDialogArgs() const OVERRIDE;
52 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE;
53 virtual void OnCloseContents(content::WebContents* source,
54 bool* out_close_dialog) OVERRIDE;
55 virtual bool ShouldShowDialogTitle() const OVERRIDE;
56
57 // Weak ptr to delegate.
58 ConstrainedWebDialogDelegate* delegate_;
59
60 std::string username_;
James Hawkins 2013/02/12 21:40:40 nit: Document member variables.
dconnelly 2013/02/13 09:02:27 Done.
61 base::Closure cancel_signin_;
62 base::Closure signin_with_new_profile_;
63 base::Closure continue_signin_;
64
65 // Cleanup bookkeeping. Labeled mutable to get around inherited const
66 // label on GetWebUIMessageHandlers.
67 mutable bool closed_by_handler_;
68
69 DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialog);
70 };
71
72 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_PROFILE_SIGNIN_CONFIRMATION_DIALOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698