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 #include "chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.
h" | 5 #include "chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.
h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 Profile* profile, | 52 Profile* profile, |
53 const std::string& username, | 53 const std::string& username, |
54 ui::ProfileSigninConfirmationDelegate* delegate) { | 54 ui::ProfileSigninConfirmationDelegate* delegate) { |
55 // Hides the new avatar bubble if it is currently shown. The new avatar bubble | 55 // Hides the new avatar bubble if it is currently shown. The new avatar bubble |
56 // should be automatically closed when it loses focus. However on windows the | 56 // should be automatically closed when it loses focus. However on windows the |
57 // profile signin confirmation dialog is not modal yet thus it does not take | 57 // profile signin confirmation dialog is not modal yet thus it does not take |
58 // away focus, thus as a temporary workaround we need to manually close the | 58 // away focus, thus as a temporary workaround we need to manually close the |
59 // bubble. | 59 // bubble. |
60 // TODO(guohui): removes the workaround once the profile confirmation dialog | 60 // TODO(guohui): removes the workaround once the profile confirmation dialog |
61 // is fixed. | 61 // is fixed. |
62 if (switches::IsNewAvatarMenu() && ProfileChooserView::IsShowing()) | 62 ProfileChooserView::Hide(); |
63 ProfileChooserView::Hide(); | |
64 | 63 |
65 ProfileSigninConfirmationDialogViews* dialog = | 64 ProfileSigninConfirmationDialogViews* dialog = |
66 new ProfileSigninConfirmationDialogViews( | 65 new ProfileSigninConfirmationDialogViews( |
67 browser, username, delegate); | 66 browser, username, delegate); |
68 ui::CheckShouldPromptForNewProfile( | 67 ui::CheckShouldPromptForNewProfile( |
69 profile, | 68 profile, |
70 // This callback is guaranteed to be invoked, and once it is, the dialog | 69 // This callback is guaranteed to be invoked, and once it is, the dialog |
71 // owns itself. | 70 // owns itself. |
72 base::Bind(&ProfileSigninConfirmationDialogViews::Show, | 71 base::Bind(&ProfileSigninConfirmationDialogViews::Show, |
73 base::Unretained(dialog))); | 72 base::Unretained(dialog))); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 views::Button* sender, | 246 views::Button* sender, |
248 const ui::Event& event) { | 247 const ui::Event& event) { |
249 DCHECK(prompt_for_new_profile_); | 248 DCHECK(prompt_for_new_profile_); |
250 DCHECK_EQ(continue_signin_button_, sender); | 249 DCHECK_EQ(continue_signin_button_, sender); |
251 if (delegate_) { | 250 if (delegate_) { |
252 delegate_->OnContinueSignin(); | 251 delegate_->OnContinueSignin(); |
253 delegate_ = NULL; | 252 delegate_ = NULL; |
254 } | 253 } |
255 GetWidget()->Close(); | 254 GetWidget()->Close(); |
256 } | 255 } |
OLD | NEW |