| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/webui/signin/signin_create_profile_handler.h" | 5 #include "chrome/browser/ui/webui/signin/signin_create_profile_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 profiles::OpenBrowserWindowForProfile( | 416 profiles::OpenBrowserWindowForProfile( |
| 417 base::Bind(&SigninCreateProfileHandler::OnBrowserReadyCallback, | 417 base::Bind(&SigninCreateProfileHandler::OnBrowserReadyCallback, |
| 418 weak_ptr_factory_.GetWeakPtr()), | 418 weak_ptr_factory_.GetWeakPtr()), |
| 419 false, // Don't create a window if one already exists. | 419 false, // Don't create a window if one already exists. |
| 420 true, // Create a first run window. | 420 true, // Create a first run window. |
| 421 profile, | 421 profile, |
| 422 status); | 422 status); |
| 423 } | 423 } |
| 424 | 424 |
| 425 void SigninCreateProfileHandler::OpenSigninDialogForProfile(Profile* profile) { | 425 void SigninCreateProfileHandler::OpenSigninDialogForProfile(Profile* profile) { |
| 426 // TODO(zmin): Remove the switcher once the UserManager API is finished on Mac. | |
| 427 #if !defined(OS_MACOSX) | |
| 428 UserManager::ShowSigninDialog(web_ui()->GetWebContents()->GetBrowserContext(), | 426 UserManager::ShowSigninDialog(web_ui()->GetWebContents()->GetBrowserContext(), |
| 429 profile->GetPath()); | 427 profile->GetPath()); |
| 430 #endif | |
| 431 } | 428 } |
| 432 | 429 |
| 433 void SigninCreateProfileHandler::ShowProfileCreationError( | 430 void SigninCreateProfileHandler::ShowProfileCreationError( |
| 434 Profile* profile, | 431 Profile* profile, |
| 435 const base::string16& error) { | 432 const base::string16& error) { |
| 436 DCHECK_NE(NO_CREATION_IN_PROGRESS, profile_creation_type_); | 433 DCHECK_NE(NO_CREATION_IN_PROGRESS, profile_creation_type_); |
| 437 web_ui()->CallJavascriptFunctionUnsafe( | 434 web_ui()->CallJavascriptFunctionUnsafe( |
| 438 "cr.webUIListenerCallback", GetWebUIListenerName(PROFILE_CREATION_ERROR), | 435 "cr.webUIListenerCallback", GetWebUIListenerName(PROFILE_CREATION_ERROR), |
| 439 base::StringValue(error)); | 436 base::StringValue(error)); |
| 440 // The ProfileManager calls us back with a NULL profile in some cases. | 437 // The ProfileManager calls us back with a NULL profile in some cases. |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 | 802 |
| 806 profiles::OpenBrowserWindowForProfile( | 803 profiles::OpenBrowserWindowForProfile( |
| 807 base::Bind(&SigninCreateProfileHandler::OnBrowserReadyCallback, | 804 base::Bind(&SigninCreateProfileHandler::OnBrowserReadyCallback, |
| 808 weak_ptr_factory_.GetWeakPtr()), | 805 weak_ptr_factory_.GetWeakPtr()), |
| 809 false, // Don't create a window if one already exists. | 806 false, // Don't create a window if one already exists. |
| 810 true, // Create a first run window. | 807 true, // Create a first run window. |
| 811 profile, | 808 profile, |
| 812 Profile::CREATE_STATUS_INITIALIZED); | 809 Profile::CREATE_STATUS_INITIALIZED); |
| 813 } | 810 } |
| 814 #endif | 811 #endif |
| OLD | NEW |