Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // 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.
| |
| 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 "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.
| |
| 14 #include "content/public/browser/web_ui_message_handler.h" | |
| 15 #include "ui/base/ui_base_types.h" | |
| 16 #include "ui/web_dialogs/web_dialog_delegate.h" | |
| 17 | |
| 18 // Deletes itself when the dialog is closed. | |
| 19 class ProfileSigninConfirmationDialog : public ui::WebDialogDelegate { | |
| 20 public: | |
| 21 static void ShowDialog(const std::string& username, | |
| 22 const base::Closure& cancel_signin, | |
| 23 const base::Closure& signin_with_new_profile, | |
| 24 const base::Closure& continue_signin); | |
| 25 void Close(); | |
| 26 | |
| 27 private: | |
| 28 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.
| |
| 29 const std::string& username, | |
| 30 const base::Closure& cancel_signin, | |
| 31 const base::Closure& signin_with_new_profile, | |
| 32 const base::Closure& continue_signin); | |
| 33 virtual ~ProfileSigninConfirmationDialog(); | |
| 34 | |
| 35 // Overridden from WebDialogDelegate: | |
| 36 virtual ui::ModalType GetDialogModalType() const OVERRIDE; | |
| 37 virtual string16 GetDialogTitle() const OVERRIDE; | |
| 38 virtual GURL GetDialogContentURL() const OVERRIDE; | |
| 39 virtual void GetWebUIMessageHandlers( | |
| 40 std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; | |
| 41 virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; | |
| 42 virtual std::string GetDialogArgs() const OVERRIDE; | |
| 43 virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; | |
| 44 virtual void OnCloseContents(content::WebContents* source, | |
| 45 bool* out_close_dialog) OVERRIDE; | |
| 46 virtual bool ShouldShowDialogTitle() const OVERRIDE; | |
| 47 | |
| 48 // Deletes itself. | |
| 49 ConstrainedWebDialogDelegate* delegate_; | |
| 50 | |
| 51 std::string username_; | |
| 52 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
| |
| 53 | |
| 54 DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialog); | |
| 55 }; | |
| 56 | |
| 57 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_PROFILE_SIGNIN_CONFIRMATION_DIALOG_H_ | |
| OLD | NEW |