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

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

Issue 24869003: cryptohome: Move stateless wrapper functions out of CryptohomeLibrary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #include "chrome/browser/chromeos/policy/device_status_collector.h" 61 #include "chrome/browser/chromeos/policy/device_status_collector.h"
62 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" 62 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
63 #include "chrome/browser/chromeos/policy/network_configuration_updater.h" 63 #include "chrome/browser/chromeos/policy/network_configuration_updater.h"
64 #include "chrome/browser/chromeos/settings/cros_settings.h" 64 #include "chrome/browser/chromeos/settings/cros_settings.h"
65 #include "chrome/browser/chromeos/settings/cros_settings_provider.h" 65 #include "chrome/browser/chromeos/settings/cros_settings_provider.h"
66 #include "chrome/browser/chromeos/settings/device_settings_service.h" 66 #include "chrome/browser/chromeos/settings/device_settings_service.h"
67 #include "chrome/browser/chromeos/system/statistics_provider.h" 67 #include "chrome/browser/chromeos/system/statistics_provider.h"
68 #include "chrome/browser/chromeos/system/timezone_settings.h" 68 #include "chrome/browser/chromeos/system/timezone_settings.h"
69 #include "chromeos/chromeos_paths.h" 69 #include "chromeos/chromeos_paths.h"
70 #include "chromeos/chromeos_switches.h" 70 #include "chromeos/chromeos_switches.h"
71 #include "chromeos/cryptohome/cryptohome_library.h" 71 #include "chromeos/cryptohome/cryptohome_library.h"
pneubeck (no reviews) 2013/09/27 08:59:25 unused after the removal below
72 #include "chromeos/dbus/cryptohome_client.h" 72 #include "chromeos/dbus/cryptohome_client.h"
73 #include "chromeos/dbus/dbus_thread_manager.h" 73 #include "chromeos/dbus/dbus_thread_manager.h"
74 #include "chromeos/network/network_handler.h" 74 #include "chromeos/network/network_handler.h"
75 #include "chromeos/network/onc/onc_certificate_importer_impl.h" 75 #include "chromeos/network/onc/onc_certificate_importer_impl.h"
76 #endif 76 #endif
77 77
78 using content::BrowserThread; 78 using content::BrowserThread;
79 79
80 namespace policy { 80 namespace policy {
81 81
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 weak_ptr_factory_(this) { 125 weak_ptr_factory_(this) {
126 // GetPolicyService() must be ready after the constructor is done. 126 // GetPolicyService() must be ready after the constructor is done.
127 // The connector is created very early during startup, when the browser 127 // The connector is created very early during startup, when the browser
128 // threads aren't running yet; initialize components that need local_state, 128 // threads aren't running yet; initialize components that need local_state,
129 // the system request context or other threads (e.g. FILE) at Init(). 129 // the system request context or other threads (e.g. FILE) at Init().
130 130
131 platform_provider_.reset(CreatePlatformProvider()); 131 platform_provider_.reset(CreatePlatformProvider());
132 132
133 #if defined(OS_CHROMEOS) 133 #if defined(OS_CHROMEOS)
134 // CryptohomeLibrary or DBusThreadManager may be uninitialized on unit tests. 134 // CryptohomeLibrary or DBusThreadManager may be uninitialized on unit tests.
135 if (chromeos::CryptohomeLibrary::IsInitialized() && 135 if (chromeos::CryptohomeLibrary::IsInitialized() &&
pneubeck (no reviews) 2013/09/27 08:59:25 this shouldn't be required anymore (update the com
satorux1 2013/10/01 05:24:03 This turned out to be necessary, as removing it wi
pneubeck (no reviews) 2013/10/01 09:05:08 ...how we love implicit dependencies...
136 chromeos::DBusThreadManager::IsInitialized()) { 136 chromeos::DBusThreadManager::IsInitialized()) {
137 chromeos::CryptohomeLibrary* cryptohome =
138 chromeos::CryptohomeLibrary::Get();
139 chromeos::CryptohomeClient* cryptohome_client = 137 chromeos::CryptohomeClient* cryptohome_client =
140 chromeos::DBusThreadManager::Get()->GetCryptohomeClient(); 138 chromeos::DBusThreadManager::Get()->GetCryptohomeClient();
141 install_attributes_.reset( 139 install_attributes_.reset(
142 new EnterpriseInstallAttributes(cryptohome, cryptohome_client)); 140 new EnterpriseInstallAttributes(cryptohome_client));
143 base::FilePath install_attrs_file; 141 base::FilePath install_attrs_file;
144 CHECK(PathService::Get(chromeos::FILE_INSTALL_ATTRIBUTES, 142 CHECK(PathService::Get(chromeos::FILE_INSTALL_ATTRIBUTES,
145 &install_attrs_file)); 143 &install_attrs_file));
146 install_attributes_->ReadCacheFile(install_attrs_file); 144 install_attributes_->ReadCacheFile(install_attrs_file);
147 145
148 scoped_ptr<DeviceCloudPolicyStoreChromeOS> device_cloud_policy_store( 146 scoped_ptr<DeviceCloudPolicyStoreChromeOS> device_cloud_policy_store(
149 new DeviceCloudPolicyStoreChromeOS( 147 new DeviceCloudPolicyStoreChromeOS(
150 chromeos::DeviceSettingsService::Get(), 148 chromeos::DeviceSettingsService::Get(),
151 install_attributes_.get())); 149 install_attributes_.get()));
152 device_cloud_policy_manager_.reset( 150 device_cloud_policy_manager_.reset(
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 return new AsyncPolicyProvider(loader.Pass()); 495 return new AsyncPolicyProvider(loader.Pass());
498 } else { 496 } else {
499 return NULL; 497 return NULL;
500 } 498 }
501 #else 499 #else
502 return NULL; 500 return NULL;
503 #endif 501 #endif
504 } 502 }
505 503
506 } // namespace policy 504 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698