| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS_H_ | 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_ | 6 #define CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h" | 10 #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h" |
| 11 #include "ui/views/controls/button/button.h" | 11 #include "ui/views/controls/button/button.h" |
| 12 #include "ui/views/controls/button/label_button.h" | |
| 13 #include "ui/views/controls/link_listener.h" | 12 #include "ui/views/controls/link_listener.h" |
| 14 #include "ui/views/controls/styled_label_listener.h" | 13 #include "ui/views/controls/styled_label_listener.h" |
| 15 #include "ui/views/window/dialog_delegate.h" | 14 #include "ui/views/window/dialog_delegate.h" |
| 16 | 15 |
| 17 class Browser; | 16 class Browser; |
| 18 class Profile; | 17 class Profile; |
| 19 | 18 |
| 20 namespace content { | |
| 21 class WebContents; | |
| 22 } | |
| 23 | |
| 24 namespace views { | |
| 25 class StyledLabel; | |
| 26 } | |
| 27 | |
| 28 // A tab-modal dialog to allow a user signing in with a managed account | 19 // A tab-modal dialog to allow a user signing in with a managed account |
| 29 // to create a new Chrome profile. | 20 // to create a new Chrome profile. |
| 30 class ProfileSigninConfirmationDialogViews : public views::DialogDelegateView, | 21 class ProfileSigninConfirmationDialogViews : public views::DialogDelegateView, |
| 31 public views::StyledLabelListener, | 22 public views::StyledLabelListener, |
| 32 public views::ButtonListener { | 23 public views::ButtonListener { |
| 33 public: | 24 public: |
| 34 // Create and show the dialog, which owns itself. | 25 // Create and show the dialog, which owns itself. |
| 35 static void ShowDialog(Browser* browser, | 26 static void ShowDialog(Browser* browser, |
| 36 Profile* profile, | 27 Profile* profile, |
| 37 const std::string& username, | 28 const std::string& username, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 64 int event_flags) override; | 55 int event_flags) override; |
| 65 | 56 |
| 66 // views::ButtonListener: | 57 // views::ButtonListener: |
| 67 void ButtonPressed(views::Button*, const ui::Event& event) override; | 58 void ButtonPressed(views::Button*, const ui::Event& event) override; |
| 68 | 59 |
| 69 // Shows the dialog and releases ownership of this object. It will | 60 // Shows the dialog and releases ownership of this object. It will |
| 70 // delete itself when the dialog is closed. If |prompt_for_new_profile| | 61 // delete itself when the dialog is closed. If |prompt_for_new_profile| |
| 71 // is true, the dialog will offer to create a new profile before signin. | 62 // is true, the dialog will offer to create a new profile before signin. |
| 72 void Show(bool prompt_for_new_profile); | 63 void Show(bool prompt_for_new_profile); |
| 73 | 64 |
| 74 // Weak ptr to label for dialog explanation text. | |
| 75 views::StyledLabel* explanation_label_; | |
| 76 | |
| 77 // Weak ptr to parent view. | 65 // Weak ptr to parent view. |
| 78 Browser* browser_; | 66 Browser* browser_; |
| 79 | 67 |
| 80 // The GAIA username being signed in. | 68 // The GAIA username being signed in. |
| 81 std::string username_; | 69 std::string username_; |
| 82 | 70 |
| 83 // Dialog button handler. | 71 // Dialog button handler. |
| 84 ui::ProfileSigninConfirmationDelegate* delegate_; | 72 ui::ProfileSigninConfirmationDelegate* delegate_; |
| 85 | 73 |
| 86 // Whether the user should be prompted to create a new profile. | 74 // Whether the user should be prompted to create a new profile. |
| 87 bool prompt_for_new_profile_; | 75 bool prompt_for_new_profile_; |
| 88 | 76 |
| 89 // The button to continue with signin, if an extra button is required. | |
| 90 views::LabelButton* continue_signin_button_; | |
| 91 | |
| 92 DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialogViews); | 77 DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationDialogViews); |
| 93 }; | 78 }; |
| 94 | 79 |
| 95 #endif // CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS
_H_ | 80 #endif // CHROME_BROWSER_UI_VIEWS_SYNC_PROFILE_SIGNIN_CONFIRMATION_DIALOG_VIEWS
_H_ |
| OLD | NEW |