Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h" | |
| 11 #include "ui/views/controls/link_listener.h" | |
| 12 #include "ui/views/controls/styled_label_listener.h" | |
| 13 #include "ui/views/window/dialog_delegate.h" | |
| 14 | |
| 15 class Browser; | |
| 16 class Profile; | |
| 17 | |
| 18 namespace content { | |
| 19 class WebContents; | |
| 20 } | |
| 21 | |
| 22 namespace views { | |
| 23 class StyledLabel; | |
| 24 } | |
| 25 | |
| 26 namespace chrome { | |
| 27 void ShowProfileSigninConfirmationDialog( | |
|
Peter Kasting
2013/05/15 00:11:03
See comments in non-views .h file.
dconnelly
2013/05/17 13:01:55
Responded there.
| |
| 28 Browser* browser, content::WebContents* web_contents, | |
| 29 Profile*, const std::string&, | |
| 30 const base::Closure&, const base::Closure&, const base::Closure&); | |
| 31 } | |
| 32 | |
| 33 // A tab-modal dialog to allow a user signing in with a managed account | |
| 34 // to create a new Chrome profile. | |
| 35 class ProfileSigninConfirmationDialogViews : public views::DialogDelegateView, | |
| 36 public views::LinkListener, | |
| 37 public views::StyledLabelListener { | |
| 38 public: | |
| 39 // views::DialogDelegate: | |
|
Peter Kasting
2013/05/15 00:11:03
Nit: Do these functions all need to be public? In
dconnelly
2013/05/17 13:01:55
Done.
| |
| 40 virtual string16 GetWindowTitle() const OVERRIDE; | |
| 41 virtual int GetDialogButtons() const OVERRIDE; | |
| 42 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; | |
| 43 virtual views::View* CreateExtraView() OVERRIDE; | |
| 44 virtual void DeleteDelegate() OVERRIDE; | |
| 45 virtual bool Accept() OVERRIDE; | |
| 46 virtual bool Cancel() OVERRIDE; | |
| 47 virtual void OnClose() OVERRIDE; | |
| 48 virtual ui::ModalType GetModalType() const OVERRIDE; | |
| 49 | |
| 50 // views::LinkListener: | |
| 51 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | |
| 52 | |
| 53 // views::StyledLabelListener: | |
| 54 virtual void StyledLabelLinkClicked(const ui::Range& range, | |
| 55 int event_flags) OVERRIDE; | |
| 56 | |
| 57 private: | |
| 58 friend void ::chrome::ShowProfileSigninConfirmationDialog( | |
|
Peter Kasting
2013/05/15 00:11:03
See comments in non-views .h file.
dconnelly
2013/05/17 13:01:55
Responded there.
| |
| 59 Browser* browser, content::WebContents* web_contents, | |
| 60 Profile*, const std::string&, | |
| 61 const base::Closure&, const base::Closure&, const base::Closure&); | |
| 62 | |
| 63 ProfileSigninConfirmationDialogViews( | |
| 64 Browser* browser, | |
| 65 Profile* profile, | |
| 66 const std::string& username, | |
| 67 const base::Closure& cancel_signin, | |
| 68 const base::Closure& signin_with_new_profile, | |
| 69 const base::Closure& continue_signin); | |
| 70 virtual ~ProfileSigninConfirmationDialogViews(); | |
| 71 | |
| 72 // Update the text of the dialog explanation label. | |
| 73 void UpdateExplanationLabel( | |
| 74 ui::DisplayCreateProfilePrompt prompt_for_new_profile); | |
| 75 | |
| 76 // Update the link to create a new profile. | |
| 77 void UpdateCreateProfileLink( | |
| 78 ui::DisplayCreateProfilePrompt prompt_for_new_profile); | |
| 79 | |
| 80 // Shows the dialog and releases ownership of this object. It will | |
| 81 // delete itself when the dialog is closed. If |prompt_for_new_profile| | |
| 82 // is true, the dialog will offer to create a new profile before signin. | |
| 83 void Show(ui::DisplayCreateProfilePrompt prompt_for_new_profile); | |
| 84 | |
| 85 // Resets all the user response handling callbacks. | |
| 86 void ResetCallbacks(); | |
| 87 | |
| 88 // Weak ptr to label for dialog explanation text. | |
| 89 views::StyledLabel* explanation_label_; | |
| 90 | |
| 91 // Weak ptr to parent view. | |
| 92 Browser* browser_; | |
| 93 | |
| 94 // The profile being signed in. | |
| 95 Profile* profile_; | |
| 96 | |
| 97 // The GAIA username being signed in. | |
| 98 std::string username_; | |
| 99 | |
| 100 // Dialog button callbacks. | |
| 101 base::Closure cancel_signin_; | |
| 102 base::Closure signin_with_new_profile_; | |
| 103 base::Closure continue_signin_; | |
| 104 | |
| 105 // The link to create a new profile. | |
| 106 views::Link* link_; | |
| 107 | |
| 108 DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialogViews); | |
| 109 }; | |
| 110 | |
| 111 #endif // CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS _H_ | |
| OLD | NEW |