Chromium Code Reviews| 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 |
| index 08bc0932e1cb4f33efa9630d24cc7bf48ffab9c1..8412b66e51a3b9a798710bd0f34ef03ee744136f 100644 |
| --- a/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog.h |
| +++ b/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog.h |
| @@ -8,35 +8,44 @@ |
| #include <string> |
| #include "base/callback.h" |
| -#include "base/memory/weak_ptr.h" |
| #include "base/string16.h" |
| #include "chrome/browser/common/cancelable_request.h" |
| #include "chrome/browser/history/history_types.h" |
| +#include "chrome/browser/ui/sync/profile_signin_confirmation_helper.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 Browser; |
| class Profile; |
| class WebUIMessageHandler; |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +namespace chrome { |
| +void ShowProfileSigninConfirmationDialog( |
|
Peter Kasting
2013/05/15 00:11:03
Why do we have this declaration both here and in b
dconnelly
2013/05/17 13:01:55
It's declared in browser_dialogs.h. It's re-decla
Peter Kasting
2013/05/17 18:45:53
The #include should not have been removed, but thi
|
| + Browser* browser, content::WebContents* web_contents, |
|
Peter Kasting
2013/05/15 00:11:03
Nit: While this wrapping style is legal, I think p
dconnelly
2013/05/17 13:01:55
Done.
|
| + Profile*, const std::string&, |
| + const base::Closure&, const base::Closure&, const base::Closure&); |
| +} |
| + |
| // 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: |
| + friend void ::chrome::ShowProfileSigninConfirmationDialog( |
|
Peter Kasting
2013/05/15 00:11:03
Nit: It seems like we could avoid the need for thi
dconnelly
2013/05/17 13:01:55
Here's the idea: there is one top-level function (
Peter Kasting
2013/05/17 18:45:53
I'm OK with this.
|
| + Browser* browser, content::WebContents* web_contents, |
| + Profile*, const std::string&, |
| + const base::Closure&, const base::Closure&, const base::Closure&); |
| + |
| ProfileSigninConfirmationDialog( |
| + content::WebContents* web_contents, |
| Profile* profile, |
| const std::string& username, |
| const base::Closure& cancel_signin, |
| @@ -47,7 +56,7 @@ class ProfileSigninConfirmationDialog : public ui::WebDialogDelegate { |
| // Shows the dialog and releases ownership of this object. It will |
| // delete itself when the dialog is closed. If |prompt_for_new_profile| |
| // is true, the dialog will offer to create a new profile before signin. |
| - void Show(bool prompt_for_new_profile); |
| + void Show(ui::DisplayCreateProfilePrompt prompt_for_new_profile); |
| // WebDialogDelegate implementation. |
| virtual ui::ModalType GetDialogModalType() const OVERRIDE; |
| @@ -62,6 +71,9 @@ class ProfileSigninConfirmationDialog : public ui::WebDialogDelegate { |
| bool* out_close_dialog) OVERRIDE; |
| virtual bool ShouldShowDialogTitle() const OVERRIDE; |
| + // The containing view. |
| + content::WebContents* web_contents_; |
| + |
| // Weak ptr to delegate. |
| ConstrainedWebDialogDelegate* delegate_; |
| @@ -69,7 +81,7 @@ class ProfileSigninConfirmationDialog : public ui::WebDialogDelegate { |
| std::string username_; |
| // Whether to show the "Create a new profile" button. |
| - bool prompt_for_new_profile_; |
| + ui::DisplayCreateProfilePrompt prompt_for_new_profile_; |
| // Dialog button callbacks. |
| base::Closure cancel_signin_; |
| @@ -83,8 +95,6 @@ class ProfileSigninConfirmationDialog : public ui::WebDialogDelegate { |
| // label on GetWebUIMessageHandlers. |
| mutable bool closed_by_handler_; |
| - base::WeakPtrFactory<ProfileSigninConfirmationDialog> weak_pointer_factory_; |
| - |
| DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialog); |
| }; |