• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 The Chromium Embedded Framework Authors. Portions copyright
2 // 2011 The Chromium Authors. All rights reserved. Use of this source code is
3 // governed by a BSD-style license that can be found in the LICENSE file.
4 
5 #ifndef CEF_LIBCEF_COMMON_RESOURCE_UTIL_H_
6 #define CEF_LIBCEF_COMMON_RESOURCE_UTIL_H_
7 #pragma once
8 
9 #include "include/cef_base.h"
10 
11 #include "ui/base/resource/resource_scale_factor.h"
12 
13 namespace base {
14 class CommandLine;
15 class FilePath;
16 }  // namespace base
17 
18 namespace resource_util {
19 
20 // Returns the directory that contains resource files (*.bin, *.dat, *.pak,
21 // etc).
22 base::FilePath GetResourcesDir();
23 
24 // Returns the default path for the debug.log file.
25 base::FilePath GetDefaultLogFilePath();
26 
27 // Called from MainDelegate::PreSandboxStartup.
28 void OverrideDefaultDownloadDir();
29 void OverrideUserDataDir(CefSettings* settings,
30                          const base::CommandLine* command_line);
31 
32 // Returns true if |scale_factor| is supported by this platform.
33 bool IsScaleFactorSupported(ui::ResourceScaleFactor scale_factor);
34 
35 #if BUILDFLAG(IS_LINUX)
36 // Look for binary files (*.bin, *.dat, *.pak, chrome-sandbox, libGLESv2.so,
37 // libEGL.so, locales/*.pak, swiftshader/*.so) next to libcef instead of the exe
38 // on Linux. This is already the default on Windows.
39 void OverrideAssetPath();
40 #endif
41 
42 }  // namespace resource_util
43 
44 #endif  // CEF_LIBCEF_COMMON_RESOURCE_UTIL_H_
45