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

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

Issue 191093002: Simplify the user agent code some more since after r255534 it's not affected by the site's URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: patchset 15 which works 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"
17 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
18 #include "chromeos/chromeos_constants.h" 19 #include "chromeos/chromeos_constants.h"
19 #include "chromeos/system/statistics_provider.h" 20 #include "chromeos/system/statistics_provider.h"
20 #include "components/policy/core/common/cloud/cloud_policy_constants.h" 21 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
21 #include "components/policy/core/common/cloud/cloud_policy_store.h" 22 #include "components/policy/core/common/cloud/cloud_policy_store.h"
22 #include "components/policy/core/common/cloud/device_management_service.h" 23 #include "components/policy/core/common/cloud/device_management_service.h"
23 #include "components/policy/core/common/cloud/system_policy_request_context.h" 24 #include "components/policy/core/common/cloud/system_policy_request_context.h"
24 #include "content/public/browser/browser_thread.h" 25 #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(), 253 g_browser_process->system_request_context(), GetUserAgent());
254 content::GetUserAgent(GURL(
255 device_management_service_->GetServerUrl())));
256 254
257 return make_scoped_ptr( 255 return make_scoped_ptr(
258 new CloudPolicyClient(GetMachineID(), GetMachineModel(), 256 new CloudPolicyClient(GetMachineID(), GetMachineModel(),
259 kPolicyVerificationKeyHash, 257 kPolicyVerificationKeyHash,
260 USER_AFFILIATION_NONE, 258 USER_AFFILIATION_NONE,
261 device_status_provider_.get(), 259 device_status_provider_.get(),
262 device_management_service_, 260 device_management_service_,
263 request_context)); 261 request_context));
264 } 262 }
265 263
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 local_state_->SetBoolean( 320 local_state_->SetBoolean(
323 prefs::kDeviceEnrollmentCanExit, 321 prefs::kDeviceEnrollmentCanExit,
324 GetMachineFlag(chromeos::system::kOemCanExitEnterpriseEnrollmentKey, 322 GetMachineFlag(chromeos::system::kOemCanExitEnterpriseEnrollmentKey,
325 false)); 323 false));
326 } 324 }
327 } 325 }
328 } 326 }
329 } 327 }
330 328
331 } // namespace policy 329 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698