| 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/profiles/profile_window.h" | 5 #include "chrome/browser/profiles/profile_window.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 profile, base::Bind(&LockBrowserCloseSuccess)); | 307 profile, base::Bind(&LockBrowserCloseSuccess)); |
| 308 } | 308 } |
| 309 } | 309 } |
| 310 | 310 |
| 311 bool IsLockAvailable(Profile* profile) { | 311 bool IsLockAvailable(Profile* profile) { |
| 312 DCHECK(profile); | 312 DCHECK(profile); |
| 313 const std::string& hosted_domain = profile->GetPrefs()-> | 313 const std::string& hosted_domain = profile->GetPrefs()-> |
| 314 GetString(prefs::kGoogleServicesHostedDomain); | 314 GetString(prefs::kGoogleServicesHostedDomain); |
| 315 return switches::IsNewProfileManagement() && | 315 return switches::IsNewProfileManagement() && |
| 316 (hosted_domain == Profile::kNoHostedDomainFound || | 316 (hosted_domain == Profile::kNoHostedDomainFound || |
| 317 hosted_domain == "google.com"); | 317 hosted_domain == "google.com") && |
| 318 g_browser_process->local_state()-> |
| 319 GetBoolean(prefs::kSupervisedUserExistsOrExisted); |
| 318 } | 320 } |
| 319 | 321 |
| 320 void CreateGuestProfileForUserManager( | 322 void CreateGuestProfileForUserManager( |
| 321 const base::FilePath& profile_path_to_focus, | 323 const base::FilePath& profile_path_to_focus, |
| 322 profiles::UserManagerTutorialMode tutorial_mode, | 324 profiles::UserManagerTutorialMode tutorial_mode, |
| 323 profiles::UserManagerProfileSelected profile_open_action, | 325 profiles::UserManagerProfileSelected profile_open_action, |
| 324 const base::Callback<void(Profile*, const std::string&)>& callback) { | 326 const base::Callback<void(Profile*, const std::string&)>& callback) { |
| 325 // Create the guest profile, if necessary, and open the User Manager | 327 // Create the guest profile, if necessary, and open the User Manager |
| 326 // from the guest profile. | 328 // from the guest profile. |
| 327 g_browser_process->profile_manager()->CreateProfileAsync( | 329 g_browser_process->profile_manager()->CreateProfileAsync( |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR: | 422 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR: |
| 421 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 423 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
| 422 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR; | 424 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR; |
| 423 return; | 425 return; |
| 424 default: | 426 default: |
| 425 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 427 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
| 426 } | 428 } |
| 427 } | 429 } |
| 428 | 430 |
| 429 } // namespace profiles | 431 } // namespace profiles |
| OLD | NEW |