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

Side by Side Diff: chrome/browser/policy/browser_policy_connector.cc

Issue 11734005: Read CrOS install attributes cache on startup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments, write test. Created 7 years, 11 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/policy/browser_policy_connector.h" 5 #include "chrome/browser/policy/browser_policy_connector.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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 if (!device_management_service_.get()) { 122 if (!device_management_service_.get()) {
123 device_management_service_.reset( 123 device_management_service_.reset(
124 new DeviceManagementService(GetDeviceManagementUrl())); 124 new DeviceManagementService(GetDeviceManagementUrl()));
125 } 125 }
126 126
127 #if defined(OS_CHROMEOS) 127 #if defined(OS_CHROMEOS)
128 chromeos::CryptohomeLibrary* cryptohome = 128 chromeos::CryptohomeLibrary* cryptohome =
129 chromeos::CrosLibrary::Get()->GetCryptohomeLibrary(); 129 chromeos::CrosLibrary::Get()->GetCryptohomeLibrary();
130 install_attributes_.reset(new EnterpriseInstallAttributes(cryptohome)); 130 install_attributes_.reset(new EnterpriseInstallAttributes(cryptohome));
131 install_attributes_->ReadCacheFile(
132 FilePath(policy::EnterpriseInstallAttributes::kCacheFilePath));
131 133
132 CommandLine* command_line = CommandLine::ForCurrentProcess(); 134 CommandLine* command_line = CommandLine::ForCurrentProcess();
133 if (!command_line->HasSwitch(switches::kDisableCloudPolicyService)) { 135 if (!command_line->HasSwitch(switches::kDisableCloudPolicyService)) {
134 scoped_ptr<DeviceCloudPolicyStoreChromeOS> device_cloud_policy_store( 136 scoped_ptr<DeviceCloudPolicyStoreChromeOS> device_cloud_policy_store(
135 new DeviceCloudPolicyStoreChromeOS( 137 new DeviceCloudPolicyStoreChromeOS(
136 chromeos::DeviceSettingsService::Get(), 138 chromeos::DeviceSettingsService::Get(),
137 install_attributes_.get())); 139 install_attributes_.get()));
138 device_cloud_policy_manager_.reset( 140 device_cloud_policy_manager_.reset(
139 new DeviceCloudPolicyManagerChromeOS( 141 new DeviceCloudPolicyManagerChromeOS(
140 device_cloud_policy_store.Pass(), 142 device_cloud_policy_store.Pass(),
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 return new AsyncPolicyProvider(loader.Pass()); 782 return new AsyncPolicyProvider(loader.Pass());
781 } else { 783 } else {
782 return NULL; 784 return NULL;
783 } 785 }
784 #else 786 #else
785 return NULL; 787 return NULL;
786 #endif 788 #endif
787 } 789 }
788 790
789 } // namespace policy 791 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698