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

Side by Side Diff: chrome/browser/ui/webui/signin/profile_signin_confirmation_handler.cc

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: more cleanup 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) 2012 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 #include "chrome/browser/ui/webui/signin/profile_signin_confirmation_handler.h"
6
7 #include "base/bind.h"
8 #include "chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog.h"
9 #include "content/public/browser/web_ui.h"
10 #include "ui/base/ui_base_types.h"
11
12 ProfileSigninConfirmationHandler::ProfileSigninConfirmationHandler(
13 ProfileSigninConfirmationDialog* dialog,
14 const base::Closure& cancel_signin,
15 const base::Closure& signin_with_new_profile,
16 const base::Closure& continue_signin)
17 : dialog_(dialog),
18 cancel_signin_(cancel_signin),
19 signin_with_new_profile_(signin_with_new_profile),
20 continue_signin_(continue_signin) {
21 }
22
23 ProfileSigninConfirmationHandler::~ProfileSigninConfirmationHandler() {
24 }
25
26 void ProfileSigninConfirmationHandler::RegisterMessages() {
27 web_ui()->RegisterMessageCallback("cancel",
28 base::Bind(&ProfileSigninConfirmationHandler::OnCancelButtonClicked,
Andrew T Wilson (Slow) 2013/02/10 20:47:26 See my earlier point - if you roll this into the D
29 base::Unretained(this)));
Andrew T Wilson (Slow) 2013/02/10 20:47:26 Are we guaranteed that we'll outlive the web_ui? I
30 web_ui()->RegisterMessageCallback("createNewProfile",
31 base::Bind(&ProfileSigninConfirmationHandler::OnCreateProfileClicked,
32 base::Unretained(this)));
33 web_ui()->RegisterMessageCallback("continue",
34 base::Bind(&ProfileSigninConfirmationHandler::OnContinueButtonClicked,
35 base::Unretained(this)));
36 }
37
38 void ProfileSigninConfirmationHandler::OnCancelButtonClicked(
39 const base::ListValue* args) {
40 // TODO(dconnelly): redirect back to NTP?
Andrew T Wilson (Slow) 2013/02/10 20:47:26 Yeah, I'm not sure about what to do about redirect
41 cancel_signin_.Run();
42 dialog_->Close();
43 }
44
45 void ProfileSigninConfirmationHandler::OnCreateProfileClicked(
46 const base::ListValue* args) {
47 signin_with_new_profile_.Run();
48 dialog_->Close();
49 }
50
51 void ProfileSigninConfirmationHandler::OnContinueButtonClicked(
52 const base::ListValue* args) {
53 continue_signin_.Run();
54 dialog_->Close();
55 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698