2013-04-03 20:20:59 +02:00
|
|
|
// Copyright (c) 2013 The Chromium Embedded Framework Authors. All rights
|
2012-04-03 03:34:16 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
|
2015-01-31 01:55:56 +01:00
|
|
|
#ifndef CEF_TESTS_CEFCLIENT_BROWSER_RESOURCE_UTIL_H_
|
|
|
|
#define CEF_TESTS_CEFCLIENT_BROWSER_RESOURCE_UTIL_H_
|
2012-04-03 03:34:16 +02:00
|
|
|
#pragma once
|
|
|
|
|
2013-04-03 20:20:59 +02:00
|
|
|
#include <string>
|
2016-01-19 21:09:01 +01:00
|
|
|
#include "include/cef_image.h"
|
2013-04-03 20:20:59 +02:00
|
|
|
#include "include/cef_stream.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-05-23 03:57:31 +02:00
|
|
|
#if defined(OS_WIN)
|
|
|
|
#include "include/wrapper/cef_resource_manager.h"
|
|
|
|
#endif
|
|
|
|
|
2015-01-23 20:09:34 +01:00
|
|
|
namespace client {
|
|
|
|
|
2013-04-03 20:20:59 +02:00
|
|
|
#if defined(OS_POSIX)
|
|
|
|
// Returns the directory containing resource files.
|
|
|
|
bool GetResourceDir(std::string& dir);
|
|
|
|
#endif
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2013-04-03 20:20:59 +02:00
|
|
|
// Retrieve a resource as a string.
|
2012-04-03 03:34:16 +02:00
|
|
|
bool LoadBinaryResource(const char* resource_name, std::string& resource_data);
|
|
|
|
|
2013-04-03 20:20:59 +02:00
|
|
|
// Retrieve a resource as a steam reader.
|
2012-04-12 22:21:50 +02:00
|
|
|
CefRefPtr<CefStreamReader> GetBinaryResourceReader(const char* resource_name);
|
|
|
|
|
2015-05-23 03:57:31 +02:00
|
|
|
#if defined(OS_WIN)
|
|
|
|
// Create a new provider for loading binary resources.
|
|
|
|
CefResourceManager::Provider* CreateBinaryResourceProvider(
|
|
|
|
const std::string& url_path);
|
|
|
|
#endif
|
|
|
|
|
2016-01-19 21:09:01 +01:00
|
|
|
// Load an image icon at different scale factors. The image representations are
|
|
|
|
// expected to be 16 DIP in size. For example, if |icon_name| is "image" then
|
|
|
|
// the expected file names are "image.1x.png" for the 1x scale image (16 pixels)
|
|
|
|
// and "image.2x.png" for the 2x scale image (32 pixels).
|
|
|
|
CefRefPtr<CefImage> LoadImageIcon(const char* icon_name);
|
|
|
|
|
2015-01-23 20:09:34 +01:00
|
|
|
} // namespace client
|
|
|
|
|
2015-01-31 01:55:56 +01:00
|
|
|
#endif // CEF_TESTS_CEFCLIENT_BROWSER_RESOURCE_UTIL_H_
|