| Index: chrome/browser/ui/views/user_manager_view.cc
|
| diff --git a/chrome/browser/ui/views/user_manager_view.cc b/chrome/browser/ui/views/user_manager_view.cc
|
| index bf72bbbac3fa997cc194919cdf673747573bc2e0..4a4f52382737a71cf6e5c6193fab865151e9f01d 100644
|
| --- a/chrome/browser/ui/views/user_manager_view.cc
|
| +++ b/chrome/browser/ui/views/user_manager_view.cc
|
| @@ -4,16 +4,15 @@
|
|
|
| #include "chrome/browser/ui/views/user_manager_view.h"
|
|
|
| -#include "base/strings/string_number_conversions.h"
|
| #include "chrome/browser/browser_process.h"
|
| #include "chrome/browser/lifetime/application_lifetime.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| #include "chrome/browser/profiles/profile_metrics.h"
|
| +#include "chrome/browser/profiles/profile_window.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/browser/ui/browser_dialogs.h"
|
| #include "chrome/browser/ui/browser_window.h"
|
| #include "chrome/browser/ui/views/auto_keep_alive.h"
|
| -#include "chrome/common/url_constants.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "content/public/browser/web_contents_view.h"
|
| #include "grit/generated_resources.h"
|
| @@ -46,7 +45,8 @@ namespace chrome {
|
|
|
| // Declared in browser_dialogs.h so others don't have to depend on this header.
|
| void ShowUserManager(const base::FilePath& profile_path_to_focus) {
|
| - UserManagerView::Show(profile_path_to_focus);
|
| + UserManagerView::Show(
|
| + profile_path_to_focus, profiles::USER_MANAGER_NO_TUTORIAL);
|
| }
|
|
|
| void HideUserManager() {
|
| @@ -68,7 +68,8 @@ UserManagerView::~UserManagerView() {
|
| }
|
|
|
| // static
|
| -void UserManagerView::Show(const base::FilePath& profile_path_to_focus) {
|
| +void UserManagerView::Show(const base::FilePath& profile_path_to_focus,
|
| + profiles::UserManagerTutorialMode tutorial_mode) {
|
| ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::OPEN_USER_MANAGER);
|
| if (instance_) {
|
| // If there's a user manager window open already, just activate it.
|
| @@ -78,14 +79,10 @@ void UserManagerView::Show(const base::FilePath& profile_path_to_focus) {
|
|
|
| // Create the guest profile, if necessary, and open the user manager
|
| // from the guest profile.
|
| - ProfileManager* profile_manager = g_browser_process->profile_manager();
|
| - profile_manager->CreateProfileAsync(
|
| - ProfileManager::GetGuestProfilePath(),
|
| - base::Bind(&UserManagerView::OnGuestProfileCreated,
|
| - profile_path_to_focus),
|
| - base::string16(),
|
| - base::string16(),
|
| - std::string());
|
| + profiles::CreateGuestProfileForUserManager(
|
| + profile_path_to_focus,
|
| + tutorial_mode,
|
| + base::Bind(&UserManagerView::OnGuestProfileCreated));
|
| }
|
|
|
| // static
|
| @@ -99,13 +96,9 @@ bool UserManagerView::IsShowing() {
|
| return instance_ ? instance_->GetWidget()->IsActive() : false;
|
| }
|
|
|
| -void UserManagerView::OnGuestProfileCreated(
|
| - const base::FilePath& profile_path_to_focus,
|
| - Profile* guest_profile,
|
| - Profile::CreateStatus status) {
|
| - if (status != Profile::CREATE_STATUS_INITIALIZED)
|
| - return;
|
| -
|
| +// static
|
| +void UserManagerView::OnGuestProfileCreated(Profile* guest_profile,
|
| + const std::string& url) {
|
| instance_ = new UserManagerView(guest_profile);
|
| DialogDelegate::CreateDialogWidget(instance_, NULL, NULL);
|
|
|
| @@ -121,19 +114,6 @@ void UserManagerView::OnGuestProfileCreated(
|
| #endif
|
| instance_->GetWidget()->Show();
|
|
|
| - // Tell the webui which user pod should be focused.
|
| - std::string page = chrome::kChromeUIUserManagerURL;
|
| -
|
| - if (!profile_path_to_focus.empty()) {
|
| - ProfileInfoCache& cache =
|
| - g_browser_process->profile_manager()->GetProfileInfoCache();
|
| - size_t index = cache.GetIndexOfProfileWithPath(profile_path_to_focus);
|
| - if (index != std::string::npos) {
|
| - page += "#";
|
| - page += base::IntToString(index);
|
| - }
|
| - }
|
| -
|
| instance_->web_view_->LoadInitialURL(GURL(page));
|
| instance_->web_view_->RequestFocus();
|
| }
|
|
|