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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 } | 284 } |
285 | 285 |
286 void LockProfile(Profile* profile) { | 286 void LockProfile(Profile* profile) { |
287 DCHECK(profile); | 287 DCHECK(profile); |
288 if (profile) { | 288 if (profile) { |
289 BrowserList::CloseAllBrowsersWithProfile( | 289 BrowserList::CloseAllBrowsersWithProfile( |
290 profile, base::Bind(&LockBrowserCloseSuccess)); | 290 profile, base::Bind(&LockBrowserCloseSuccess)); |
291 } | 291 } |
292 } | 292 } |
293 | 293 |
294 bool IsLockAvailable(Profile* profile) { | |
295 DCHECK(profile); | |
296 const std::string& hosted_domain = profile->GetPrefs()-> | |
297 GetString(prefs::kGoogleServicesHostedDomain); | |
298 return hosted_domain == Profile::kNoHostedDomainFound || | |
299 hosted_domain == "google.com"; | |
msw
2014/09/19 21:47:40
You CL description describes "google.com" and "gma
Mike Lerman
2014/09/21 00:19:36
gmail.com is not considered a hosted domain. Hoste
msw
2014/09/22 19:58:09
Acknowledged.
| |
300 } | |
301 | |
294 void CreateGuestProfileForUserManager( | 302 void CreateGuestProfileForUserManager( |
295 const base::FilePath& profile_path_to_focus, | 303 const base::FilePath& profile_path_to_focus, |
296 profiles::UserManagerTutorialMode tutorial_mode, | 304 profiles::UserManagerTutorialMode tutorial_mode, |
297 const base::Callback<void(Profile*, const std::string&)>& callback) { | 305 const base::Callback<void(Profile*, const std::string&)>& callback) { |
298 // Create the guest profile, if necessary, and open the User Manager | 306 // Create the guest profile, if necessary, and open the User Manager |
299 // from the guest profile. | 307 // from the guest profile. |
300 g_browser_process->profile_manager()->CreateProfileAsync( | 308 g_browser_process->profile_manager()->CreateProfileAsync( |
301 ProfileManager::GetGuestProfilePath(), | 309 ProfileManager::GetGuestProfilePath(), |
302 base::Bind(&OnUserManagerGuestProfileCreated, | 310 base::Bind(&OnUserManagerGuestProfileCreated, |
303 profile_path_to_focus, | 311 profile_path_to_focus, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
386 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR: | 394 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR: |
387 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 395 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
388 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR; | 396 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR; |
389 return; | 397 return; |
390 default: | 398 default: |
391 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 399 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
392 } | 400 } |
393 } | 401 } |
394 | 402 |
395 } // namespace profiles | 403 } // namespace profiles |
OLD | NEW |