mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add the ability to (issue #236):
1. Disable pack file loading via CefSettings.pack_loading_disabled. 2. Customize pack file load paths via CefSettings.pack_file_path and CefSettings.locales_dir_path. 3. Provide custom resource bundle handling via CefResourceBundleHandler. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@501 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -16,18 +16,11 @@ MSVC_PUSH_WARNING_LEVEL(0);
|
||||
MSVC_POP_WARNING();
|
||||
#undef LOG
|
||||
|
||||
#include "libcef/cef_context.h"
|
||||
|
||||
#include "base/file_util.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/string_util.h"
|
||||
#include "base/string16.h"
|
||||
#include "net/base/mime_util.h"
|
||||
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
|
||||
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
#include "webkit/glue/user_agent.h"
|
||||
#include "webkit/glue/webkit_glue.h"
|
||||
#include "webkit/plugins/npapi/plugin_list.h"
|
||||
@@ -39,33 +32,6 @@ using WebKit::WebFrameImpl;
|
||||
|
||||
namespace webkit_glue {
|
||||
|
||||
void InitializeResourceBundle(const std::string& locale) {
|
||||
// Load chrome.pak (on Mac) and the appropiate locale pack.
|
||||
const std::string loaded_locale =
|
||||
ResourceBundle::InitSharedInstance(locale);
|
||||
CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Explicitly load chrome.pak on Windows. Use the module (libcef.dll)
|
||||
// directory to match the location of the locale folder.
|
||||
FilePath chrome_pack_path;
|
||||
PathService::Get(base::DIR_MODULE, &chrome_pack_path);
|
||||
chrome_pack_path = chrome_pack_path.AppendASCII("chrome.pak");
|
||||
if (file_util::PathExists(chrome_pack_path))
|
||||
ResourceBundle::AddDataPackToSharedInstance(chrome_pack_path);
|
||||
else
|
||||
NOTREACHED() << "Could not load chrome.pak";
|
||||
#endif
|
||||
}
|
||||
|
||||
void CleanupResourceBundle() {
|
||||
ResourceBundle::CleanupSharedInstance();
|
||||
}
|
||||
|
||||
string16 GetLocalizedString(int message_id) {
|
||||
return ResourceBundle::GetSharedInstance().GetLocalizedString(message_id);
|
||||
}
|
||||
|
||||
bool IsMediaPlayerAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user