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

Side by Side Diff: trunk/src/chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.cc

Issue 192283002: Revert 255858 "Simplify the user agent code some more since afte..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
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/device_cloud_policy_manager_chromeos.h" 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h" 12 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h"
13 #include "chrome/browser/chromeos/login/startup_utils.h" 13 #include "chrome/browser/chromeos/login/startup_utils.h"
14 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" 14 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h"
15 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h" 15 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h"
16 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" 16 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
17 #include "chrome/common/chrome_content_client.h"
18 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
19 #include "chromeos/chromeos_constants.h" 18 #include "chromeos/chromeos_constants.h"
20 #include "chromeos/system/statistics_provider.h" 19 #include "chromeos/system/statistics_provider.h"
21 #include "components/policy/core/common/cloud/cloud_policy_constants.h" 20 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
22 #include "components/policy/core/common/cloud/cloud_policy_store.h" 21 #include "components/policy/core/common/cloud/cloud_policy_store.h"
23 #include "components/policy/core/common/cloud/device_management_service.h" 22 #include "components/policy/core/common/cloud/device_management_service.h"
24 #include "components/policy/core/common/cloud/system_policy_request_context.h" 23 #include "components/policy/core/common/cloud/system_policy_request_context.h"
25 #include "content/public/browser/browser_thread.h" 24 #include "content/public/browser/browser_thread.h"
25 #include "content/public/common/content_client.h"
26 #include "policy/proto/device_management_backend.pb.h" 26 #include "policy/proto/device_management_backend.pb.h"
27 #include "url/gurl.h" 27 #include "url/gurl.h"
28 28
29 using content::BrowserThread; 29 using content::BrowserThread;
30 30
31 namespace em = enterprise_management; 31 namespace em = enterprise_management;
32 32
33 namespace policy { 33 namespace policy {
34 34
35 namespace { 35 namespace {
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } 243 }
244 244
245 // static 245 // static
246 std::string DeviceCloudPolicyManagerChromeOS::GetMachineModel() { 246 std::string DeviceCloudPolicyManagerChromeOS::GetMachineModel() {
247 return GetMachineStatistic(kMachineInfoSystemHwqual); 247 return GetMachineStatistic(kMachineInfoSystemHwqual);
248 } 248 }
249 249
250 scoped_ptr<CloudPolicyClient> DeviceCloudPolicyManagerChromeOS::CreateClient() { 250 scoped_ptr<CloudPolicyClient> DeviceCloudPolicyManagerChromeOS::CreateClient() {
251 scoped_refptr<net::URLRequestContextGetter> request_context = 251 scoped_refptr<net::URLRequestContextGetter> request_context =
252 new SystemPolicyRequestContext( 252 new SystemPolicyRequestContext(
253 g_browser_process->system_request_context(), GetUserAgent()); 253 g_browser_process->system_request_context(),
254 content::GetUserAgent(GURL(
255 device_management_service_->GetServerUrl())));
254 256
255 return make_scoped_ptr( 257 return make_scoped_ptr(
256 new CloudPolicyClient(GetMachineID(), GetMachineModel(), 258 new CloudPolicyClient(GetMachineID(), GetMachineModel(),
257 kPolicyVerificationKeyHash, 259 kPolicyVerificationKeyHash,
258 USER_AFFILIATION_NONE, 260 USER_AFFILIATION_NONE,
259 device_status_provider_.get(), 261 device_status_provider_.get(),
260 device_management_service_, 262 device_management_service_,
261 request_context)); 263 request_context));
262 } 264 }
263 265
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 local_state_->SetBoolean( 322 local_state_->SetBoolean(
321 prefs::kDeviceEnrollmentCanExit, 323 prefs::kDeviceEnrollmentCanExit,
322 GetMachineFlag(chromeos::system::kOemCanExitEnterpriseEnrollmentKey, 324 GetMachineFlag(chromeos::system::kOemCanExitEnterpriseEnrollmentKey,
323 false)); 325 false));
324 } 326 }
325 } 327 }
326 } 328 }
327 } 329 }
328 330
329 } // namespace policy 331 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698