mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update all files to use Windows CRLF (\r\n) line endings (issue #45).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@33 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -1,64 +1,64 @@
|
||||
// Copyright (c) 2008-2009 The Chromium Embedded Framework Authors.
|
||||
// Portions copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Copyright (c) 2008-2009 The Chromium Embedded Framework Authors.
|
||||
// Portions copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "precompiled_libcef.h"
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/logging.h"
|
||||
|
||||
#include "config.h"
|
||||
MSVC_PUSH_WARNING_LEVEL(0);
|
||||
#include "TextEncoding.h"
|
||||
#include "config.h"
|
||||
MSVC_PUSH_WARNING_LEVEL(0);
|
||||
#include "TextEncoding.h"
|
||||
#include "webkit/glue/webframe_impl.h"
|
||||
MSVC_POP_WARNING();
|
||||
|
||||
|
||||
#include "browser_webkit_glue.h"
|
||||
|
||||
#undef LOG
|
||||
#include "base/path_service.h"
|
||||
#include "base/resource_util.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/scoped_ptr.h"
|
||||
#include "base/string16.h"
|
||||
#include "base/win_util.h"
|
||||
#include "net/base/mime_util.h"
|
||||
#include "webkit/glue/glue_util.h"
|
||||
#include "webkit/glue/webframe.h"
|
||||
#include "webkit/glue/webkit_glue.h"
|
||||
|
||||
// Generated by GRIT
|
||||
#include "grit/webkit_resources.h"
|
||||
|
||||
namespace webkit_glue {
|
||||
|
||||
bool IsMediaPlayerAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void PrecacheUrl(const char16* url, int url_length) {}
|
||||
|
||||
void AppendToLog(const char* file, int line, const char* msg) {
|
||||
logging::LogMessage(file, line).stream() << msg;
|
||||
}
|
||||
|
||||
StringPiece GetRawDataResource(HMODULE module, int resource_id) {
|
||||
void* data_ptr;
|
||||
size_t data_size;
|
||||
return base::GetDataResourceFromModule(module, resource_id, &data_ptr,
|
||||
&data_size) ?
|
||||
StringPiece(static_cast<char*>(data_ptr), data_size) : StringPiece();
|
||||
}
|
||||
|
||||
StringPiece NetResourceProvider(int key) {
|
||||
return GetRawDataResource(::GetModuleHandle(NULL), key);
|
||||
}
|
||||
|
||||
StringPiece GetDataResource(int resource_id) {
|
||||
switch (resource_id) {
|
||||
case IDR_BROKENIMAGE: {
|
||||
// Use webkit's broken image icon (16x16)
|
||||
static unsigned char broken_image_data[] = {
|
||||
|
||||
// Generated by GRIT
|
||||
#include "grit/webkit_resources.h"
|
||||
|
||||
namespace webkit_glue {
|
||||
|
||||
bool IsMediaPlayerAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void PrecacheUrl(const char16* url, int url_length) {}
|
||||
|
||||
void AppendToLog(const char* file, int line, const char* msg) {
|
||||
logging::LogMessage(file, line).stream() << msg;
|
||||
}
|
||||
|
||||
StringPiece GetRawDataResource(HMODULE module, int resource_id) {
|
||||
void* data_ptr;
|
||||
size_t data_size;
|
||||
return base::GetDataResourceFromModule(module, resource_id, &data_ptr,
|
||||
&data_size) ?
|
||||
StringPiece(static_cast<char*>(data_ptr), data_size) : StringPiece();
|
||||
}
|
||||
|
||||
StringPiece NetResourceProvider(int key) {
|
||||
return GetRawDataResource(::GetModuleHandle(NULL), key);
|
||||
}
|
||||
|
||||
StringPiece GetDataResource(int resource_id) {
|
||||
switch (resource_id) {
|
||||
case IDR_BROKENIMAGE: {
|
||||
// Use webkit's broken image icon (16x16)
|
||||
static unsigned char broken_image_data[] = {
|
||||
0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x10, 0x00, 0x10, 0x00, 0xD5, 0x00,
|
||||
0x00, 0x20, 0x68, 0xB0, 0x70, 0x98, 0xC0, 0x28, 0x78, 0xB8, 0x20, 0x70,
|
||||
0xB8, 0x88, 0xB8, 0xD8, 0x78, 0x98, 0xC8, 0x28, 0x80, 0xC0, 0xF8, 0xF8,
|
||||
@ -88,22 +88,22 @@ StringPiece GetDataResource(int resource_id) {
|
||||
0x03, 0xA8, 0x03, 0x15, 0x0A, 0x0A, 0x15, 0xA9, 0x03, 0x07, 0x18, 0x01,
|
||||
0xA7, 0xA9, 0xAB, 0xAD, 0xAF, 0x07, 0x01, 0x0F, 0x07, 0x15, 0xBD, 0x15,
|
||||
0x00, 0xC0, 0x00, 0xBE, 0x15, 0x07, 0x0F, 0x0E, 0xBC, 0xC3, 0xC9, 0xBD,
|
||||
0x07, 0x0E, 0xC7, 0x4C, 0xCF, 0x49, 0xCD, 0xD2, 0xD3, 0xD4, 0xD2, 0x41,
|
||||
0x00, 0x3B
|
||||
};
|
||||
return StringPiece(reinterpret_cast<char*>(broken_image_data),
|
||||
static_cast<StringPiece::size_type>(
|
||||
sizeof(broken_image_data) / sizeof(unsigned char)));
|
||||
}
|
||||
case IDR_FEED_PREVIEW:
|
||||
// It is necessary to return a feed preview template that contains
|
||||
// a {{URL}} substring where the feed URL should go; see the code
|
||||
// that computes feed previews in feed_preview.cc:MakeFeedPreview.
|
||||
// This fixes issue #932714.
|
||||
return "Feed preview for {{URL}}";
|
||||
case IDR_TEXTAREA_RESIZER: {
|
||||
// Use webkit's text area resizer image.
|
||||
static unsigned char area_resizer_data[] = {
|
||||
0x07, 0x0E, 0xC7, 0x4C, 0xCF, 0x49, 0xCD, 0xD2, 0xD3, 0xD4, 0xD2, 0x41,
|
||||
0x00, 0x3B
|
||||
};
|
||||
return StringPiece(reinterpret_cast<char*>(broken_image_data),
|
||||
static_cast<StringPiece::size_type>(
|
||||
sizeof(broken_image_data) / sizeof(unsigned char)));
|
||||
}
|
||||
case IDR_FEED_PREVIEW:
|
||||
// It is necessary to return a feed preview template that contains
|
||||
// a {{URL}} substring where the feed URL should go; see the code
|
||||
// that computes feed previews in feed_preview.cc:MakeFeedPreview.
|
||||
// This fixes issue #932714.
|
||||
return "Feed preview for {{URL}}";
|
||||
case IDR_TEXTAREA_RESIZER: {
|
||||
// Use webkit's text area resizer image.
|
||||
static unsigned char area_resizer_data[] = {
|
||||
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D,
|
||||
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08,
|
||||
0x08, 0x06, 0x00, 0x00, 0x00, 0xC4, 0x0F, 0xBE, 0x8B, 0x00, 0x00, 0x00,
|
||||
@ -120,85 +120,85 @@ StringPiece GetDataResource(int resource_id) {
|
||||
0x98, 0x0E, 0x17, 0x7C, 0x1B, 0xCA, 0x36, 0x92, 0x76, 0x6A, 0x48, 0x66,
|
||||
0x37, 0x68, 0xAA, 0x05, 0x38, 0x03, 0x00, 0x40, 0x17, 0x33, 0x3D, 0x58,
|
||||
0x57, 0x6B, 0xB3, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE,
|
||||
0x42, 0x60, 0x82
|
||||
};
|
||||
return StringPiece(reinterpret_cast<char*>(area_resizer_data),
|
||||
static_cast<StringPiece::size_type>(
|
||||
sizeof(area_resizer_data) / sizeof(unsigned char)));
|
||||
}
|
||||
case IDR_SEARCH_CANCEL:
|
||||
case IDR_SEARCH_CANCEL_PRESSED:
|
||||
case IDR_SEARCH_MAGNIFIER:
|
||||
case IDR_SEARCH_MAGNIFIER_RESULTS:
|
||||
case IDR_MEDIA_PAUSE_BUTTON:
|
||||
case IDR_MEDIA_PLAY_BUTTON:
|
||||
case IDR_MEDIA_SOUND_FULL_BUTTON:
|
||||
case IDR_MEDIA_SOUND_NONE_BUTTON:
|
||||
return NetResourceProvider(resource_id);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return StringPiece();
|
||||
}
|
||||
|
||||
bool GetApplicationDirectory(std::wstring *path) {
|
||||
return PathService::Get(base::DIR_EXE, path);
|
||||
}
|
||||
|
||||
GURL GetInspectorURL() {
|
||||
return GURL("cef-resource://inspector/inspector.html");
|
||||
}
|
||||
|
||||
std::string GetUIResourceProtocol() {
|
||||
return "cef-resource";
|
||||
}
|
||||
|
||||
bool GetExeDirectory(std::wstring *path) {
|
||||
return PathService::Get(base::DIR_EXE, path);
|
||||
}
|
||||
|
||||
bool SpellCheckWord(const wchar_t* word, int word_len,
|
||||
int* misspelling_start, int* misspelling_len) {
|
||||
// Report all words being correctly spelled.
|
||||
*misspelling_start = 0;
|
||||
*misspelling_len = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsPluginRunningInRendererProcess() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetPluginFinderURL(std::string* plugin_finder_url) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsDefaultPluginEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::wstring GetWebKitLocale() {
|
||||
return L"en-US";
|
||||
}
|
||||
|
||||
void InitializeTextEncoding() {
|
||||
WebCore::UTF8Encoding();
|
||||
}
|
||||
|
||||
v8::Handle<v8::Context> GetV8Context(WebFrame* frame)
|
||||
{
|
||||
WebFrameImpl* webFrameImpl = static_cast<WebFrameImpl*>(frame);
|
||||
WebCore::Frame* core_frame = webFrameImpl->frame();
|
||||
return WebCore::V8Proxy::context(core_frame);
|
||||
}
|
||||
|
||||
void CloseIdleConnections() {
|
||||
// Used in benchmarking, Ignored for CEF.
|
||||
}
|
||||
|
||||
void SetCacheMode(bool enabled) {
|
||||
// Used in benchmarking, Ignored for CEF.
|
||||
}
|
||||
|
||||
} // namespace webkit_glue
|
||||
0x42, 0x60, 0x82
|
||||
};
|
||||
return StringPiece(reinterpret_cast<char*>(area_resizer_data),
|
||||
static_cast<StringPiece::size_type>(
|
||||
sizeof(area_resizer_data) / sizeof(unsigned char)));
|
||||
}
|
||||
case IDR_SEARCH_CANCEL:
|
||||
case IDR_SEARCH_CANCEL_PRESSED:
|
||||
case IDR_SEARCH_MAGNIFIER:
|
||||
case IDR_SEARCH_MAGNIFIER_RESULTS:
|
||||
case IDR_MEDIA_PAUSE_BUTTON:
|
||||
case IDR_MEDIA_PLAY_BUTTON:
|
||||
case IDR_MEDIA_SOUND_FULL_BUTTON:
|
||||
case IDR_MEDIA_SOUND_NONE_BUTTON:
|
||||
return NetResourceProvider(resource_id);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return StringPiece();
|
||||
}
|
||||
|
||||
bool GetApplicationDirectory(std::wstring *path) {
|
||||
return PathService::Get(base::DIR_EXE, path);
|
||||
}
|
||||
|
||||
GURL GetInspectorURL() {
|
||||
return GURL("cef-resource://inspector/inspector.html");
|
||||
}
|
||||
|
||||
std::string GetUIResourceProtocol() {
|
||||
return "cef-resource";
|
||||
}
|
||||
|
||||
bool GetExeDirectory(std::wstring *path) {
|
||||
return PathService::Get(base::DIR_EXE, path);
|
||||
}
|
||||
|
||||
bool SpellCheckWord(const wchar_t* word, int word_len,
|
||||
int* misspelling_start, int* misspelling_len) {
|
||||
// Report all words being correctly spelled.
|
||||
*misspelling_start = 0;
|
||||
*misspelling_len = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsPluginRunningInRendererProcess() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetPluginFinderURL(std::string* plugin_finder_url) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsDefaultPluginEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::wstring GetWebKitLocale() {
|
||||
return L"en-US";
|
||||
}
|
||||
|
||||
void InitializeTextEncoding() {
|
||||
WebCore::UTF8Encoding();
|
||||
}
|
||||
|
||||
v8::Handle<v8::Context> GetV8Context(WebFrame* frame)
|
||||
{
|
||||
WebFrameImpl* webFrameImpl = static_cast<WebFrameImpl*>(frame);
|
||||
WebCore::Frame* core_frame = webFrameImpl->frame();
|
||||
return WebCore::V8Proxy::context(core_frame);
|
||||
}
|
||||
|
||||
void CloseIdleConnections() {
|
||||
// Used in benchmarking, Ignored for CEF.
|
||||
}
|
||||
|
||||
void SetCacheMode(bool enabled) {
|
||||
// Used in benchmarking, Ignored for CEF.
|
||||
}
|
||||
|
||||
} // namespace webkit_glue
|
||||
|
Reference in New Issue
Block a user