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 "chrome/browser/chromeos/settings/cros_settings.h"
10 #include "chromeos/settings/cros_settings_names.h"
12 namespace extensions
{
15 const char kLocalCacheDir
[] = "/var/cache/external_cache";
19 ChromeOSExtensionCacheDelegate::ChromeOSExtensionCacheDelegate()
20 : cache_dir_(kLocalCacheDir
) {
23 ChromeOSExtensionCacheDelegate::ChromeOSExtensionCacheDelegate(
24 const base::FilePath
& cache_dir
)
25 : cache_dir_(cache_dir
) {
28 const base::FilePath
& ChromeOSExtensionCacheDelegate::GetCacheDir() const {
32 size_t ChromeOSExtensionCacheDelegate::GetMaximumCacheSize() const {
33 size_t max_size
= ExtensionCacheDelegate::GetMaximumCacheSize();
35 if (chromeos::CrosSettings::Get()->GetInteger(chromeos::kExtensionCacheSize
,
37 policy_size
>= static_cast<int>(GetMinimumCacheSize())) {
38 max_size
= policy_size
;
43 } // namespace extensions