Update broken references to image assets
[chromium-blink-merge.git] / chrome / browser / extensions / updater / chromeos_extension_cache_delegate.cc
blobb53d0130cec189a9e6962cb1c32fcb288a6ee141
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"
7 #include <stddef.h>
9 #include "chrome/browser/chromeos/settings/cros_settings.h"
10 #include "chromeos/settings/cros_settings_names.h"
12 namespace extensions {
13 namespace {
15 const char kLocalCacheDir[] = "/var/cache/external_cache";
17 } // namespace
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 {
29 return cache_dir_;
32 size_t ChromeOSExtensionCacheDelegate::GetMaximumCacheSize() const {
33 size_t max_size = ExtensionCacheDelegate::GetMaximumCacheSize();
34 int policy_size = 0;
35 if (chromeos::CrosSettings::Get()->GetInteger(chromeos::kExtensionCacheSize,
36 &policy_size) &&
37 policy_size >= static_cast<int>(GetMinimumCacheSize())) {
38 max_size = policy_size;
40 return max_size;
43 } // namespace extensions