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

Side by Side Diff: chrome/browser/supervised_user/supervised_user_service.cc

Issue 787803002: Cleanup: remove SupervisedUserService::IsChildAccount. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/supervised_user/supervised_user_service.h" 5 #include "chrome/browser/supervised_user/supervised_user_service.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/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 bool SupervisedUserService::AccessRequestsEnabled() { 687 bool SupervisedUserService::AccessRequestsEnabled() {
688 return FindEnabledPermissionRequestCreator(0) < permissions_creators_.size(); 688 return FindEnabledPermissionRequestCreator(0) < permissions_creators_.size();
689 } 689 }
690 690
691 void SupervisedUserService::AddAccessRequest(const GURL& url, 691 void SupervisedUserService::AddAccessRequest(const GURL& url,
692 const SuccessCallback& callback) { 692 const SuccessCallback& callback) {
693 AddAccessRequestInternal(SupervisedUserURLFilter::Normalize(url), callback, 693 AddAccessRequestInternal(SupervisedUserURLFilter::Normalize(url), callback,
694 0); 694 0);
695 } 695 }
696 696
697 bool SupervisedUserService::IsChildAccount() const {
698 return delegate_ && delegate_->IsChildAccount();
699 }
700
701 void SupervisedUserService::InitSync(const std::string& refresh_token) { 697 void SupervisedUserService::InitSync(const std::string& refresh_token) {
702 StartSetupSync(); 698 StartSetupSync();
703 699
704 ProfileOAuth2TokenService* token_service = 700 ProfileOAuth2TokenService* token_service =
705 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); 701 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_);
706 token_service->UpdateCredentials(supervised_users::kSupervisedUserPseudoEmail, 702 token_service->UpdateCredentials(supervised_users::kSupervisedUserPseudoEmail,
707 refresh_token); 703 refresh_token);
708 704
709 FinishSetupSyncWhenReady(); 705 FinishSetupSyncWhenReady();
710 } 706 }
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 // The active user can be NULL in unit tests. 990 // The active user can be NULL in unit tests.
995 if (user_manager::UserManager::Get()->GetActiveUser()) { 991 if (user_manager::UserManager::Get()->GetActiveUser()) {
996 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName( 992 return UTF16ToUTF8(user_manager::UserManager::Get()->GetUserDisplayName(
997 user_manager::UserManager::Get()->GetActiveUser()->GetUserID())); 993 user_manager::UserManager::Get()->GetActiveUser()->GetUserID()));
998 } 994 }
999 return std::string(); 995 return std::string();
1000 #else 996 #else
1001 return profile_->GetPrefs()->GetString(prefs::kProfileName); 997 return profile_->GetPrefs()->GetString(prefs::kProfileName);
1002 #endif 998 #endif
1003 } 999 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698