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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog.h
diff --git a/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog.h b/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog.h
new file mode 100644
index 0000000000000000000000000000000000000000..1ad50a21f48a3b208d80931c8ee9f1487d1d1f1f
--- /dev/null
+++ b/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
Andrew T Wilson (Slow) 2013/02/10 20:47:26 2012->2013
dconnelly 2013/02/11 09:35:16 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_WEBUI_SIGNIN_PROFILE_SIGNIN_CONFIRMATION_DIALOG_H_
+#define CHROME_BROWSER_UI_WEBUI_SIGNIN_PROFILE_SIGNIN_CONFIRMATION_DIALOG_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "base/string16.h"
+#include "chrome/browser/ui/webui/constrained_web_dialog_ui.h"
+#include "chrome/browser/ui/webui/signin/profile_signin_confirmation_handler.h"
Andrew T Wilson (Slow) 2013/02/10 20:47:26 Can you use a forward decl (i.e. "class ProfileSig
dconnelly 2013/02/11 09:35:16 Done.
+#include "content/public/browser/web_ui_message_handler.h"
+#include "ui/base/ui_base_types.h"
+#include "ui/web_dialogs/web_dialog_delegate.h"
+
+// Deletes itself when the dialog is closed.
+class ProfileSigninConfirmationDialog : public ui::WebDialogDelegate {
+ public:
+ static void ShowDialog(const std::string& username,
+ const base::Closure& cancel_signin,
+ const base::Closure& signin_with_new_profile,
+ const base::Closure& continue_signin);
+ void Close();
+
+ private:
+ explicit ProfileSigninConfirmationDialog(
Andrew T Wilson (Slow) 2013/02/10 20:47:26 nit: remove explicit (only use if the constructor
dconnelly 2013/02/11 09:35:16 Done.
+ const std::string& username,
+ const base::Closure& cancel_signin,
+ const base::Closure& signin_with_new_profile,
+ const base::Closure& continue_signin);
+ virtual ~ProfileSigninConfirmationDialog();
+
+ // Overridden from WebDialogDelegate:
+ virtual ui::ModalType GetDialogModalType() const OVERRIDE;
+ virtual string16 GetDialogTitle() const OVERRIDE;
+ virtual GURL GetDialogContentURL() const OVERRIDE;
+ virtual void GetWebUIMessageHandlers(
+ std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE;
+ virtual void GetDialogSize(gfx::Size* size) const OVERRIDE;
+ virtual std::string GetDialogArgs() const OVERRIDE;
+ virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE;
+ virtual void OnCloseContents(content::WebContents* source,
+ bool* out_close_dialog) OVERRIDE;
+ virtual bool ShouldShowDialogTitle() const OVERRIDE;
+
+ // Deletes itself.
+ ConstrainedWebDialogDelegate* delegate_;
+
+ std::string username_;
+ mutable scoped_ptr<ProfileSigninConfirmationHandler> handler_;
Andrew T Wilson (Slow) 2013/02/10 20:47:26 One thing to consider is to do one of the followin
dconnelly 2013/02/11 09:59:21 There needs to be two distinct objects, because bo
+
+ DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialog);
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_PROFILE_SIGNIN_CONFIRMATION_DIALOG_H_

Powered by Google App Engine
This is Rietveld 408576698