2012-01-10 00:46:23 +01:00
|
|
|
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
|
2010-10-03 23:04:50 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#ifndef CEF_LIBCEF_BROWSER_WEBKIT_GLUE_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_WEBKIT_GLUE_H_
|
|
|
|
#pragma once
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
#include <string>
|
|
|
|
|
2012-02-18 01:19:52 +01:00
|
|
|
#include "include/internal/cef_types.h"
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#include "base/compiler_specific.h"
|
2012-02-18 01:19:52 +01:00
|
|
|
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsContext3D.h"
|
2010-10-03 23:04:50 +02:00
|
|
|
#include "v8/include/v8.h"
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#if defined(OS_WIN)
|
|
|
|
#include <windows.h> // NOLINT(build/include_order)
|
|
|
|
#endif
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
namespace WebKit {
|
|
|
|
class WebFrame;
|
|
|
|
class WebView;
|
|
|
|
}
|
2011-09-23 02:16:03 +02:00
|
|
|
namespace webkit {
|
|
|
|
struct WebPluginInfo;
|
|
|
|
}
|
2010-10-03 23:04:50 +02:00
|
|
|
|
|
|
|
namespace webkit_glue {
|
|
|
|
|
|
|
|
#if defined(OS_WIN)
|
|
|
|
// Capture a bitmap of the web view.
|
|
|
|
void CaptureWebViewBitmap(HWND mainWnd, WebKit::WebView* webview,
|
|
|
|
HBITMAP& bitmap, SIZE& size);
|
|
|
|
|
|
|
|
// Save a bitmap image to file, providing optional alternative data in |lpBits|
|
|
|
|
BOOL SaveBitmapToFile(HBITMAP hBmp, HDC hDC, LPCTSTR file, LPBYTE lpBits);
|
|
|
|
#endif
|
2012-01-10 00:46:23 +01:00
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
// Text encoding objects must be initialized on the main thread.
|
|
|
|
void InitializeTextEncoding();
|
|
|
|
|
|
|
|
// Retrieve the V8 context associated with the frame.
|
|
|
|
v8::Handle<v8::Context> GetV8Context(WebKit::WebFrame* frame);
|
|
|
|
|
|
|
|
// Clear all cached data.
|
|
|
|
void ClearCache();
|
|
|
|
|
2011-01-06 20:26:45 +01:00
|
|
|
// Returns true if the request represents a download based on
|
|
|
|
// the supplied Content-Type and Content-Disposition headers.
|
|
|
|
bool ShouldDownload(const std::string& content_disposition,
|
|
|
|
const std::string& mime_type);
|
2010-10-16 21:10:11 +02:00
|
|
|
|
2011-09-23 02:16:03 +02:00
|
|
|
// Checks whether a plugin is enabled either by the user or by policy.
|
|
|
|
bool IsPluginEnabled(const webkit::WebPluginInfo& plugin);
|
|
|
|
|
2012-02-18 01:19:52 +01:00
|
|
|
// Create a new WebGraphicsContext3D object.
|
|
|
|
WebKit::WebGraphicsContext3D* CreateGraphicsContext3D(
|
|
|
|
cef_graphics_implementation_t graphics_implementation,
|
|
|
|
const WebKit::WebGraphicsContext3D::Attributes& attributes,
|
2012-04-05 00:32:24 +02:00
|
|
|
WebKit::WebView* web_view,
|
2012-02-18 01:19:52 +01:00
|
|
|
bool renderDirectlyToWebView);
|
|
|
|
|
2010-10-03 23:04:50 +02:00
|
|
|
} // namespace webkit_glue
|
2012-01-10 00:46:23 +01:00
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_BROWSER_WEBKIT_GLUE_H_
|