1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/extensions/updater/chromeos_extension_cache_delegate.h"
9 #include "base/path_service.h"
10 #include "chrome/browser/chromeos/settings/cros_settings.h"
11 #include "chromeos/chromeos_paths.h"
12 #include "chromeos/settings/cros_settings_names.h"
14 namespace extensions
{
16 ChromeOSExtensionCacheDelegate::ChromeOSExtensionCacheDelegate() {
17 CHECK(PathService::Get(chromeos::DIR_DEVICE_EXTENSION_LOCAL_CACHE
,
21 ChromeOSExtensionCacheDelegate::ChromeOSExtensionCacheDelegate(
22 const base::FilePath
& cache_dir
)
23 : cache_dir_(cache_dir
) {
26 const base::FilePath
& ChromeOSExtensionCacheDelegate::GetCacheDir() const {
30 size_t ChromeOSExtensionCacheDelegate::GetMaximumCacheSize() const {
31 size_t max_size
= ExtensionCacheDelegate::GetMaximumCacheSize();
33 if (chromeos::CrosSettings::Get()->GetInteger(chromeos::kExtensionCacheSize
,
35 policy_size
>= static_cast<int>(GetMinimumCacheSize())) {
36 max_size
= policy_size
;
41 } // namespace extensions