Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: chrome/browser/profiles/profile_window.cc

Issue 566933005: Do not display lock for hosted domains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ChromeOS test - part deux Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/profiles/profile_window.h ('k') | chrome/browser/profiles/profiles_state.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 switches::IsNewProfileManagement() &&
299 (hosted_domain == Profile::kNoHostedDomainFound ||
300 hosted_domain == "google.com");
301 }
302
294 void CreateGuestProfileForUserManager( 303 void CreateGuestProfileForUserManager(
295 const base::FilePath& profile_path_to_focus, 304 const base::FilePath& profile_path_to_focus,
296 profiles::UserManagerTutorialMode tutorial_mode, 305 profiles::UserManagerTutorialMode tutorial_mode,
297 const base::Callback<void(Profile*, const std::string&)>& callback) { 306 const base::Callback<void(Profile*, const std::string&)>& callback) {
298 // Create the guest profile, if necessary, and open the User Manager 307 // Create the guest profile, if necessary, and open the User Manager
299 // from the guest profile. 308 // from the guest profile.
300 g_browser_process->profile_manager()->CreateProfileAsync( 309 g_browser_process->profile_manager()->CreateProfileAsync(
301 ProfileManager::GetGuestProfilePath(), 310 ProfileManager::GetGuestProfilePath(),
302 base::Bind(&OnUserManagerGuestProfileCreated, 311 base::Bind(&OnUserManagerGuestProfileCreated,
303 profile_path_to_focus, 312 profile_path_to_focus,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR: 395 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR:
387 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; 396 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER;
388 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR; 397 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR;
389 return; 398 return;
390 default: 399 default:
391 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; 400 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER;
392 } 401 }
393 } 402 }
394 403
395 } // namespace profiles 404 } // namespace profiles
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_window.h ('k') | chrome/browser/profiles/profiles_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698