diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-07 23:07:27 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-07 23:07:27 +0000 |
commit | aa20e0622a945f94958daa1940385c29779d09e4 (patch) | |
tree | 79ba5e11afb6d6edc5a9e4edef95cca4f86467de /chrome/browser/policy | |
parent | 111ca63cacf4cedb65be41fd4cabfa5ad7bb6b86 (diff) | |
download | chromium_src-aa20e0622a945f94958daa1940385c29779d09e4.zip chromium_src-aa20e0622a945f94958daa1940385c29779d09e4.tar.gz chromium_src-aa20e0622a945f94958daa1940385c29779d09e4.tar.bz2 |
Move more code from headers to implementation.
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/5624002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68534 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/policy')
6 files changed, 40 insertions, 19 deletions
diff --git a/chrome/browser/policy/configuration_policy_pref_store.cc b/chrome/browser/policy/configuration_policy_pref_store.cc index 5a060b0..3ebbf2e 100644 --- a/chrome/browser/policy/configuration_policy_pref_store.cc +++ b/chrome/browser/policy/configuration_policy_pref_store.cc @@ -324,6 +324,8 @@ ConfigurationPolicyPrefStore::ConfigurationPolicyPrefStore( use_system_proxy_(false) { } +ConfigurationPolicyPrefStore::~ConfigurationPolicyPrefStore() {} + PrefStore::PrefReadError ConfigurationPolicyPrefStore::ReadPrefs() { proxy_disabled_ = false; proxy_configuration_specified_ = false; diff --git a/chrome/browser/policy/configuration_policy_pref_store.h b/chrome/browser/policy/configuration_policy_pref_store.h index be898a8..297d57d 100644 --- a/chrome/browser/policy/configuration_policy_pref_store.h +++ b/chrome/browser/policy/configuration_policy_pref_store.h @@ -31,7 +31,7 @@ class ConfigurationPolicyPrefStore : public PrefStore, // The ConfigurationPolicyPrefStore does not take ownership of the // passed-in |provider|. explicit ConfigurationPolicyPrefStore(ConfigurationPolicyProvider* provider); - virtual ~ConfigurationPolicyPrefStore() {} + virtual ~ConfigurationPolicyPrefStore(); // PrefStore methods: virtual PrefReadError ReadPrefs(); diff --git a/chrome/browser/policy/device_management_policy_cache.cc b/chrome/browser/policy/device_management_policy_cache.cc index 81af0f4..ab5dd15 100644 --- a/chrome/browser/policy/device_management_policy_cache.cc +++ b/chrome/browser/policy/device_management_policy_cache.cc @@ -70,6 +70,8 @@ DeviceManagementPolicyCache::DeviceManagementPolicyCache( is_device_unmanaged_(false) { } +DeviceManagementPolicyCache::~DeviceManagementPolicyCache() {} + void DeviceManagementPolicyCache::LoadPolicyFromFile() { if (!file_util::PathExists(backing_file_path_) || fresh_policy_) return; diff --git a/chrome/browser/policy/device_management_policy_cache.h b/chrome/browser/policy/device_management_policy_cache.h index 86ae845..9c09a07 100644 --- a/chrome/browser/policy/device_management_policy_cache.h +++ b/chrome/browser/policy/device_management_policy_cache.h @@ -28,6 +28,7 @@ namespace em = enterprise_management; class DeviceManagementPolicyCache { public: explicit DeviceManagementPolicyCache(const FilePath& backing_file_path); + ~DeviceManagementPolicyCache(); // Loads policy information from the backing file. Non-existing or erroneous // cache files are ignored. diff --git a/chrome/browser/policy/device_token_fetcher.cc b/chrome/browser/policy/device_token_fetcher.cc index 8c9497e..ce7ee4b 100644 --- a/chrome/browser/policy/device_token_fetcher.cc +++ b/chrome/browser/policy/device_token_fetcher.cc @@ -57,6 +57,31 @@ namespace policy { namespace em = enterprise_management; +DeviceTokenFetcher::ObserverRegistrar::ObserverRegistrar() {} + +DeviceTokenFetcher::ObserverRegistrar::~ObserverRegistrar() { + RemoveAll(); +} + +void DeviceTokenFetcher::ObserverRegistrar::Init( + DeviceTokenFetcher* token_fetcher) { + token_fetcher_ = token_fetcher; +} + +void DeviceTokenFetcher::ObserverRegistrar::AddObserver( + DeviceTokenFetcher::Observer* observer) { + observers_.push_back(observer); + token_fetcher_->AddObserver(observer); +} + +void DeviceTokenFetcher::ObserverRegistrar::RemoveAll() { + for (std::vector<DeviceTokenFetcher::Observer*>::iterator it = + observers_.begin(); it != observers_.end(); ++it) { + token_fetcher_->RemoveObserver(*it); + } + observers_.clear(); +} + DeviceTokenFetcher::DeviceTokenFetcher( DeviceManagementBackend* backend, Profile* profile, @@ -88,6 +113,8 @@ DeviceTokenFetcher::DeviceTokenFetcher( #endif } +DeviceTokenFetcher::~DeviceTokenFetcher() {} + void DeviceTokenFetcher::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { diff --git a/chrome/browser/policy/device_token_fetcher.h b/chrome/browser/policy/device_token_fetcher.h index 9b991de..c36af5b 100644 --- a/chrome/browser/policy/device_token_fetcher.h +++ b/chrome/browser/policy/device_token_fetcher.h @@ -43,23 +43,12 @@ class DeviceTokenFetcher class ObserverRegistrar { public: - void Init(DeviceTokenFetcher* token_fetcher) { - token_fetcher_ = token_fetcher; - } - ~ObserverRegistrar() { - RemoveAll(); - } - void AddObserver(DeviceTokenFetcher::Observer* observer) { - observers_.push_back(observer); - token_fetcher_->AddObserver(observer); - } - void RemoveAll() { - for (std::vector<DeviceTokenFetcher::Observer*>::iterator it = - observers_.begin(); it != observers_.end(); ++it) { - token_fetcher_->RemoveObserver(*it); - } - observers_.clear(); - } + ObserverRegistrar(); + ~ObserverRegistrar(); + + void Init(DeviceTokenFetcher* token_fetcher); + void AddObserver(DeviceTokenFetcher::Observer* observer); + void RemoveAll(); private: DeviceTokenFetcher* token_fetcher_; std::vector<DeviceTokenFetcher::Observer*> observers_; @@ -71,7 +60,7 @@ class DeviceTokenFetcher DeviceTokenFetcher(DeviceManagementBackend* backend, Profile* profile, const FilePath& token_path); - virtual ~DeviceTokenFetcher() {} + virtual ~DeviceTokenFetcher(); // NotificationObserver method overrides: virtual void Observe(NotificationType type, |