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

Side by Side Diff: chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.h

Issue 14846020: Add Views implementation of ProfileSigninConfirmationDialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no ifdef on function proto Created 7 years, 7 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 unified diff | Download patch
OLDNEW
(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/browser_dialogs.h"
tfarina 2013/05/07 18:16:18 rm this include, if necessary, include in the sour
dconnelly 2013/05/13 14:45:21 Done.
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 Profile;
16
17 namespace content {
tfarina 2013/05/07 18:16:18 also unused, remove.
dconnelly 2013/05/13 14:45:21 Done.
18 class WebContents;
19 }
20
21 namespace views {
22 class TreeView;
tfarina 2013/05/07 18:16:18 remove these unused forward declarations
dconnelly 2013/05/13 14:45:21 Done.
23 class Widget;
24 }
25
26 // A tab-modal dialog to allow a user signing in with a managed account
27 // to create a new Chrome profile.
28 class ProfileSigninConfirmationDialogViews : public views::DialogDelegateView,
29 public views::LinkListener,
30 public views::StyledLabelListener {
31 public:
32 // views::DialogDelegate:
tfarina 2013/05/07 18:16:18 can all these overriddes be private?
Andrew T Wilson (Slow) 2013/05/08 14:23:48 No objection to moving these, but wanted to note f
dconnelly 2013/05/13 14:45:21 If I'm doing that, is there any reason to not just
33 virtual string16 GetWindowTitle() const OVERRIDE;
34 virtual int GetDialogButtons() const OVERRIDE;
35 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE;
36 virtual views::View* CreateExtraView() OVERRIDE;
37 virtual void DeleteDelegate() OVERRIDE;
38 virtual bool Accept() OVERRIDE;
39 virtual bool Cancel() OVERRIDE;
40 virtual void OnClose() OVERRIDE;
41 virtual ui::ModalType GetModalType() const OVERRIDE;
42
43 // views::LinkListener:
44 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
45
46 // views::StyledLabelListener:
47 virtual void StyledLabelLinkClicked(const ui::Range& range,
48 int event_flags) OVERRIDE;
49
50 private:
51 friend void chrome::ShowProfileSigninConfirmationDialog(
52 Profile*, const std::string&,
53 const base::Closure&, const base::Closure&, const base::Closure&);
54
55 ProfileSigninConfirmationDialogViews(
56 Profile* profile,
57 const std::string& username,
58 const base::Closure& cancel_signin,
59 const base::Closure& signin_with_new_profile,
60 const base::Closure& continue_signin);
61 virtual ~ProfileSigninConfirmationDialogViews();
62
63 // Shows the dialog and releases ownership of this object. It will
64 // delete itself when the dialog is closed. If |prompt_for_new_profile|
65 // is true, the dialog will offer to create a new profile before signin.
66 void Show(bool prompt_for_new_profile);
67
68 // Weak ptr to parent view.
69 gfx::NativeWindow window_;
70
71 // The profile being signed in.
72 Profile* profile_;
73
74 // The GAIA username being signed in.
75 std::string username_;
76
77 // Whether to show the "Create a new profile" button.
78 bool prompt_for_new_profile_;
79
80 // Dialog button callbacks.
81 bool responded;
tfarina 2013/05/07 18:16:18 s/responded/responded_ Could you name it better t
dconnelly 2013/05/13 14:45:21 Removed.
82 base::Closure cancel_signin_;
83 base::Closure signin_with_new_profile_;
84 base::Closure continue_signin_;
85
86 // The link to create a new profile.
87 views::Link* link_;
88
89 DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialogViews);
90 };
91
92 #endif // CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698