| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/browser/ui/browser_dialogs.h" |
| 13 #include "chrome/browser/ui/browser_navigator.h" | 14 #include "chrome/browser/ui/browser_navigator.h" |
| 14 #include "chrome/browser/ui/browser_navigator_params.h" | 15 #include "chrome/browser/ui/browser_navigator_params.h" |
| 15 #include "chrome/browser/ui/browser_window.h" | 16 #include "chrome/browser/ui/browser_window.h" |
| 16 #include "chrome/grit/chromium_strings.h" | 17 #include "chrome/grit/chromium_strings.h" |
| 17 #include "chrome/grit/generated_resources.h" | 18 #include "chrome/grit/generated_resources.h" |
| 18 #include "components/constrained_window/constrained_window_views.h" | 19 #include "components/constrained_window/constrained_window_views.h" |
| 19 #include "components/signin/core/common/profile_management_switches.h" | 20 #include "components/signin/core/common/profile_management_switches.h" |
| 20 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 21 #include "google_apis/gaia/gaia_auth_util.h" | 22 #include "google_apis/gaia/gaia_auth_util.h" |
| 22 #include "third_party/skia/include/core/SkColor.h" | 23 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 41 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 42 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
| 42 #endif | 43 #endif |
| 43 | 44 |
| 44 ProfileSigninConfirmationDialogViews::ProfileSigninConfirmationDialogViews( | 45 ProfileSigninConfirmationDialogViews::ProfileSigninConfirmationDialogViews( |
| 45 Browser* browser, | 46 Browser* browser, |
| 46 const std::string& username, | 47 const std::string& username, |
| 47 std::unique_ptr<ui::ProfileSigninConfirmationDelegate> delegate) | 48 std::unique_ptr<ui::ProfileSigninConfirmationDelegate> delegate) |
| 48 : browser_(browser), | 49 : browser_(browser), |
| 49 username_(username), | 50 username_(username), |
| 50 delegate_(std::move(delegate)), | 51 delegate_(std::move(delegate)), |
| 51 prompt_for_new_profile_(true) {} | 52 prompt_for_new_profile_(true) { |
| 53 chrome::RecordDialogCreation( |
| 54 chrome::DialogIdentifier::PROFILE_SIGNIN_CONFIRMATION); |
| 55 } |
| 52 | 56 |
| 53 ProfileSigninConfirmationDialogViews::~ProfileSigninConfirmationDialogViews() {} | 57 ProfileSigninConfirmationDialogViews::~ProfileSigninConfirmationDialogViews() {} |
| 54 | 58 |
| 55 // static | 59 // static |
| 56 void ProfileSigninConfirmationDialogViews::ShowDialog( | 60 void ProfileSigninConfirmationDialogViews::ShowDialog( |
| 57 Browser* browser, | 61 Browser* browser, |
| 58 Profile* profile, | 62 Profile* profile, |
| 59 const std::string& username, | 63 const std::string& username, |
| 60 std::unique_ptr<ui::ProfileSigninConfirmationDelegate> delegate) { | 64 std::unique_ptr<ui::ProfileSigninConfirmationDelegate> delegate) { |
| 61 #if !defined(OS_MACOSX) || BUILDFLAG(MAC_VIEWS_BROWSER) | 65 #if !defined(OS_MACOSX) || BUILDFLAG(MAC_VIEWS_BROWSER) |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 void ProfileSigninConfirmationDialogViews::ButtonPressed( | 260 void ProfileSigninConfirmationDialogViews::ButtonPressed( |
| 257 views::Button* sender, | 261 views::Button* sender, |
| 258 const ui::Event& event) { | 262 const ui::Event& event) { |
| 259 DCHECK(prompt_for_new_profile_); | 263 DCHECK(prompt_for_new_profile_); |
| 260 if (delegate_) { | 264 if (delegate_) { |
| 261 delegate_->OnContinueSignin(); | 265 delegate_->OnContinueSignin(); |
| 262 delegate_ = nullptr; | 266 delegate_ = nullptr; |
| 263 } | 267 } |
| 264 GetWidget()->Close(); | 268 GetWidget()->Close(); |
| 265 } | 269 } |
| OLD | NEW |