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

Side by Side Diff: chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/policy/user_cloud_policy_manager_chromeos.h" 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // wildcard check. 75 // wildcard check.
76 user_manager::UserManager::Get()->RemoveUserFromList( 76 user_manager::UserManager::Get()->RemoveUserFromList(
77 AccountId::FromUserEmail(username)); 77 AccountId::FromUserEmail(username));
78 chrome::AttemptUserExit(); 78 chrome::AttemptUserExit();
79 } 79 }
80 } 80 }
81 81
82 } // namespace 82 } // namespace
83 83
84 UserCloudPolicyManagerChromeOS::UserCloudPolicyManagerChromeOS( 84 UserCloudPolicyManagerChromeOS::UserCloudPolicyManagerChromeOS(
85 scoped_ptr<CloudPolicyStore> store, 85 std::unique_ptr<CloudPolicyStore> store,
86 scoped_ptr<CloudExternalDataManager> external_data_manager, 86 std::unique_ptr<CloudExternalDataManager> external_data_manager,
87 const base::FilePath& component_policy_cache_path, 87 const base::FilePath& component_policy_cache_path,
88 bool wait_for_policy_fetch, 88 bool wait_for_policy_fetch,
89 base::TimeDelta initial_policy_fetch_timeout, 89 base::TimeDelta initial_policy_fetch_timeout,
90 const scoped_refptr<base::SequencedTaskRunner>& task_runner, 90 const scoped_refptr<base::SequencedTaskRunner>& task_runner,
91 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner, 91 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner,
92 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner) 92 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner)
93 : CloudPolicyManager(dm_protocol::kChromeUserPolicyType, 93 : CloudPolicyManager(dm_protocol::kChromeUserPolicyType,
94 std::string(), 94 std::string(),
95 store.get(), 95 store.get(),
96 task_runner, 96 task_runner,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 if (system_request_context.get()) { 132 if (system_request_context.get()) {
133 // |system_request_context| can be null for tests. 133 // |system_request_context| can be null for tests.
134 // Use the system request context here instead of a context derived 134 // Use the system request context here instead of a context derived
135 // from the Profile because Connect() is called before the profile is 135 // from the Profile because Connect() is called before the profile is
136 // fully initialized (required so we can perform the initial policy load). 136 // fully initialized (required so we can perform the initial policy load).
137 // TODO(atwilson): Change this to use a UserPolicyRequestContext once 137 // TODO(atwilson): Change this to use a UserPolicyRequestContext once
138 // Connect() is called after profile initialization. http://crbug.com/323591 138 // Connect() is called after profile initialization. http://crbug.com/323591
139 request_context = new SystemPolicyRequestContext( 139 request_context = new SystemPolicyRequestContext(
140 system_request_context, GetUserAgent()); 140 system_request_context, GetUserAgent());
141 } 141 }
142 scoped_ptr<CloudPolicyClient> cloud_policy_client(new CloudPolicyClient( 142 std::unique_ptr<CloudPolicyClient> cloud_policy_client(new CloudPolicyClient(
143 std::string(), std::string(), kPolicyVerificationKeyHash, 143 std::string(), std::string(), kPolicyVerificationKeyHash,
144 device_management_service, request_context)); 144 device_management_service, request_context));
145 CreateComponentCloudPolicyService(component_policy_cache_path_, 145 CreateComponentCloudPolicyService(component_policy_cache_path_,
146 request_context, cloud_policy_client.get()); 146 request_context, cloud_policy_client.get());
147 core()->Connect(std::move(cloud_policy_client)); 147 core()->Connect(std::move(cloud_policy_client));
148 client()->AddObserver(this); 148 client()->AddObserver(this);
149 149
150 external_data_manager_->Connect(request_context); 150 external_data_manager_->Connect(request_context);
151 151
152 // Determine the next step after the CloudPolicyService initializes. 152 // Determine the next step after the CloudPolicyService initializes.
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 // OnComponentCloudPolicyUpdated() once it's ready. 455 // OnComponentCloudPolicyUpdated() once it's ready.
456 return; 456 return;
457 } 457 }
458 458
459 core()->StartRefreshScheduler(); 459 core()->StartRefreshScheduler();
460 core()->TrackRefreshDelayPref(local_state_, 460 core()->TrackRefreshDelayPref(local_state_,
461 policy_prefs::kUserPolicyRefreshRate); 461 policy_prefs::kUserPolicyRefreshRate);
462 } 462 }
463 463
464 } // namespace policy 464 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698