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

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: forgot to git add a few 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..20c997e7d5401bcad8452daab4fd9544de8246d5
--- /dev/null
+++ b/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog.h
@@ -0,0 +1,75 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// 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 "ui/base/ui_base_types.h"
+#include "ui/web_dialogs/web_dialog_delegate.h"
+
+class Profile;
+class WebUIMessageHandler;
+
+// A tab-modal dialog to allow a user signing in with a managed account
+// to create a new Chrome profile.
+class ProfileSigninConfirmationDialog : public ui::WebDialogDelegate {
+ public:
+ // Creates and shows the modal dialog. |profile| is the current Chrome
+ // profile and |username| is the GAIA username that the user is signing
+ // in with.
+ static void ShowDialog(Profile* profile,
+ const std::string& username,
+ const base::Closure& cancel_signin,
+ const base::Closure& signin_with_new_profile,
+ const base::Closure& continue_signin);
+
+ // Closes the dialog, which will delete itself.
+ void Close() const;
+
+ private:
+ ProfileSigninConfirmationDialog(
+ Profile* profile,
+ const std::string& username,
+ const base::Closure& cancel_signin,
+ const base::Closure& signin_with_new_profile,
+ const base::Closure& continue_signin);
+ virtual ~ProfileSigninConfirmationDialog();
+
+ // WebDialogDelegate implementation.
+ 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;
+
+ // Weak ptr to delegate.
+ ConstrainedWebDialogDelegate* delegate_;
+
+ // The GAIA username being signed in.
+ std::string username_;
+
+ // Dialog button callbacks.
+ base::Closure cancel_signin_;
+ base::Closure signin_with_new_profile_;
+ base::Closure continue_signin_;
+
+ // Cleanup bookkeeping. Labeled mutable to get around inherited const
+ // label on GetWebUIMessageHandlers.
+ mutable bool closed_by_handler_;
+
+ 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