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

Side by Side Diff: chrome/browser/signin/chrome_proximity_auth_client.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky Created 4 years, 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/signin/chrome_proximity_auth_client.h" 5 #include "chrome/browser/signin/chrome_proximity_auth_client.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 #endif 90 #endif
91 } 91 }
92 92
93 PrefService* ChromeProximityAuthClient::GetPrefService() { 93 PrefService* ChromeProximityAuthClient::GetPrefService() {
94 return profile_->GetPrefs(); 94 return profile_->GetPrefs();
95 } 95 }
96 96
97 std::unique_ptr<proximity_auth::SecureMessageDelegate> 97 std::unique_ptr<proximity_auth::SecureMessageDelegate>
98 ChromeProximityAuthClient::CreateSecureMessageDelegate() { 98 ChromeProximityAuthClient::CreateSecureMessageDelegate() {
99 #if defined(OS_CHROMEOS) 99 #if defined(OS_CHROMEOS)
100 return base::WrapUnique(new chromeos::SecureMessageDelegateChromeOS()); 100 return base::MakeUnique<chromeos::SecureMessageDelegateChromeOS>();
101 #else 101 #else
102 return nullptr; 102 return nullptr;
103 #endif 103 #endif
104 } 104 }
105 105
106 std::unique_ptr<proximity_auth::CryptAuthClientFactory> 106 std::unique_ptr<proximity_auth::CryptAuthClientFactory>
107 ChromeProximityAuthClient::CreateCryptAuthClientFactory() { 107 ChromeProximityAuthClient::CreateCryptAuthClientFactory() {
108 return base::WrapUnique(new proximity_auth::CryptAuthClientFactoryImpl( 108 return base::MakeUnique<proximity_auth::CryptAuthClientFactoryImpl>(
109 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_), GetAccountId(), 109 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_), GetAccountId(),
110 profile_->GetRequestContext(), GetDeviceClassifier())); 110 profile_->GetRequestContext(), GetDeviceClassifier());
111 } 111 }
112 112
113 cryptauth::DeviceClassifier ChromeProximityAuthClient::GetDeviceClassifier() { 113 cryptauth::DeviceClassifier ChromeProximityAuthClient::GetDeviceClassifier() {
114 cryptauth::DeviceClassifier device_classifier; 114 cryptauth::DeviceClassifier device_classifier;
115 115
116 #if defined(OS_CHROMEOS) 116 #if defined(OS_CHROMEOS)
117 int32_t major_version, minor_version, bugfix_version; 117 int32_t major_version, minor_version, bugfix_version;
118 // TODO(tengs): base::OperatingSystemVersionNumbers only works for ChromeOS. 118 // TODO(tengs): base::OperatingSystemVersionNumbers only works for ChromeOS.
119 // We need to get different numbers for other platforms. 119 // We need to get different numbers for other platforms.
120 base::SysInfo::OperatingSystemVersionNumbers(&major_version, &minor_version, 120 base::SysInfo::OperatingSystemVersionNumbers(&major_version, &minor_version,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 } 158 }
159 159
160 EasyUnlockServiceRegular* 160 EasyUnlockServiceRegular*
161 ChromeProximityAuthClient::GetEasyUnlockServiceRegular() { 161 ChromeProximityAuthClient::GetEasyUnlockServiceRegular() {
162 EasyUnlockService* easy_unlock_service = EasyUnlockService::Get(profile_); 162 EasyUnlockService* easy_unlock_service = EasyUnlockService::Get(profile_);
163 if (easy_unlock_service->GetType() == EasyUnlockService::TYPE_REGULAR) 163 if (easy_unlock_service->GetType() == EasyUnlockService::TYPE_REGULAR)
164 return static_cast<EasyUnlockServiceRegular*>(easy_unlock_service); 164 return static_cast<EasyUnlockServiceRegular*>(easy_unlock_service);
165 else 165 else
166 return nullptr; 166 return nullptr;
167 } 167 }
OLDNEW
« no previous file with comments | « chrome/browser/shell_integration_win.cc ('k') | chrome/browser/signin/easy_unlock_app_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698