• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 
5 #ifndef CEF_TESTS_SHARED_BROWSER_RESOURCE_UTIL_H_
6 #define CEF_TESTS_SHARED_BROWSER_RESOURCE_UTIL_H_
7 #pragma once
8 
9 #include <string>
10 #include "include/cef_image.h"
11 #include "include/cef_stream.h"
12 
13 #if defined(OS_WIN)
14 #include "include/wrapper/cef_resource_manager.h"
15 #endif
16 
17 namespace client {
18 
19 #if defined(OS_POSIX)
20 // Returns the directory containing resource files.
21 bool GetResourceDir(std::string& dir);
22 #endif
23 
24 // Retrieve a resource as a string.
25 bool LoadBinaryResource(const char* resource_name, std::string& resource_data);
26 
27 // Retrieve a resource as a steam reader.
28 CefRefPtr<CefStreamReader> GetBinaryResourceReader(const char* resource_name);
29 
30 #if defined(OS_WIN)
31 // Create a new provider for loading binary resources.
32 CefResourceManager::Provider* CreateBinaryResourceProvider(
33     const std::string& url_path,
34     const std::string& resource_path_prefix);
35 #endif
36 
37 }  // namespace client
38 
39 #endif  // CEF_TESTS_SHARED_BROWSER_RESOURCE_UTIL_H_
40