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

Unified Diff: chrome/browser/supervised_user/supervised_user_service.cc

Issue 2767893002: Remove ScopedVector from chrome/browser/. (Closed)
Patch Set: Address comments from zea@ Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/supervised_user/supervised_user_service.cc
diff --git a/chrome/browser/supervised_user/supervised_user_service.cc b/chrome/browser/supervised_user/supervised_user_service.cc
index be5f9a2f43a854d59c8eff410c006ef1217f11f6..73f3e80ac745087ab526159a55f21b8274dbaa4d 100644
--- a/chrome/browser/supervised_user/supervised_user_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_service.cc
@@ -10,6 +10,7 @@
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/path_service.h"
#include "base/strings/stringprintf.h"
@@ -415,7 +416,7 @@ void SupervisedUserService::RemoveObserver(
void SupervisedUserService::AddPermissionRequestCreator(
std::unique_ptr<PermissionRequestCreator> creator) {
- permissions_creators_.push_back(creator.release());
+ permissions_creators_.push_back(std::move(creator));
}
void SupervisedUserService::SetSafeSearchURLReporter(
@@ -569,13 +570,14 @@ void SupervisedUserService::SetActive(bool active) {
token_service->LoadCredentials(
supervised_users::kSupervisedUserPseudoEmail);
- permissions_creators_.push_back(new PermissionRequestCreatorSync(
- GetSettingsService(),
- SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext(
- profile_),
- ProfileSyncServiceFactory::GetForProfile(profile_),
- GetSupervisedUserName(),
- profile_->GetPrefs()->GetString(prefs::kSupervisedUserId)));
+ permissions_creators_.push_back(
+ base::MakeUnique<PermissionRequestCreatorSync>(
+ GetSettingsService(),
+ SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext(
+ profile_),
+ ProfileSyncServiceFactory::GetForProfile(profile_),
+ GetSupervisedUserName(),
+ profile_->GetPrefs()->GetString(prefs::kSupervisedUserId)));
SetupSync();
#else
@@ -786,10 +788,10 @@ void SupervisedUserService::AddPermissionRequestInternal(
}
create_request.Run(
- permissions_creators_[next_index],
+ permissions_creators_[next_index].get(),
base::Bind(&SupervisedUserService::OnPermissionRequestIssued,
- weak_ptr_factory_.GetWeakPtr(), create_request,
- callback, next_index));
+ weak_ptr_factory_.GetWeakPtr(), create_request, callback,
+ next_index));
}
void SupervisedUserService::OnPermissionRequestIssued(
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_service.h ('k') | chrome/browser/sync/test/integration/apps_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698