mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
libcef: Update due to underlying chromium changes.
- Glue now depends on WebCore_prebuild (and not WebCore). - WebCore depends on WebCore_prebuild. - libxml_config and libxslt_config projects are gone. - Initialize the global CommandLine object in ThreadHandlerUI(). - Changes to WebPluginDelegate. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@8 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "request_impl.h"
|
||||
|
||||
#include "base/file_util.h"
|
||||
#include "base/gfx/gdi_util.h"
|
||||
#include "base/gfx/point.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/string_util.h"
|
||||
@@ -501,10 +502,30 @@ void BrowserWebViewDelegate::Blur(WebWidget* webwidget) {
|
||||
void BrowserWebViewDelegate::DidMove(WebWidget* webwidget,
|
||||
const WebPluginGeometry& move) {
|
||||
#if defined(OS_WIN)
|
||||
// TODO(port): add me once plugins work.
|
||||
WebPluginDelegateImpl::MoveWindow(
|
||||
move.window, move.window_rect, move.clip_rect, move.cutout_rects,
|
||||
move.visible);
|
||||
HRGN hrgn = ::CreateRectRgn(move.clip_rect.x(),
|
||||
move.clip_rect.y(),
|
||||
move.clip_rect.right(),
|
||||
move.clip_rect.bottom());
|
||||
gfx::SubtractRectanglesFromRegion(hrgn, move.cutout_rects);
|
||||
|
||||
// Note: System will own the hrgn after we call SetWindowRgn,
|
||||
// so we don't need to call DeleteObject(hrgn)
|
||||
::SetWindowRgn(move.window, hrgn, FALSE);
|
||||
|
||||
unsigned long flags = 0;
|
||||
if (move.visible)
|
||||
flags |= SWP_SHOWWINDOW;
|
||||
else
|
||||
flags |= SWP_HIDEWINDOW;
|
||||
|
||||
::SetWindowPos(move.window,
|
||||
NULL,
|
||||
move.window_rect.x(),
|
||||
move.window_rect.y(),
|
||||
move.window_rect.width(),
|
||||
move.window_rect.height(),
|
||||
flags);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include "plugins/browser_plugin_list.h"
|
||||
|
||||
#include "base/at_exit.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/icu_util.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/rand_util.h"
|
||||
@@ -128,7 +129,10 @@ DWORD WINAPI ThreadHandlerUI(LPVOID lpParam)
|
||||
DCHECK(SUCCEEDED(res));
|
||||
|
||||
// Instantiate the AtExitManager to avoid asserts and possible memory leaks.
|
||||
base::AtExitManager at_exit_manager;
|
||||
base::AtExitManager at_exit_manager;
|
||||
|
||||
// Initialize the global CommandLine object.
|
||||
CommandLine::Init(0, NULL);
|
||||
|
||||
// Instantiate the message loop for this thread.
|
||||
MessageLoopForUI main_message_loop;
|
||||
|
@@ -6,6 +6,6 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""$(OutDir)\obj\WebCore";"$(OutDir)\obj\WebCore\JavaScriptHeaders";"$(OutDir)\obj\WebCore\JavaScriptHeaders\JavaScriptCore";"$(SolutionDir)..\webkit\pending\";"$(SolutionDir)..\webkit\port\platform";"$(SolutionDir)..\webkit\port\platform\image-decoders";"$(SolutionDir)..\webkit\port\platform\image-decoders\bmp";"$(SolutionDir)..\webkit\port\platform\image-decoders\gif";"$(SolutionDir)..\webkit\port\platform\image-decoders\ico";"$(SolutionDir)..\webkit\port\platform\image-decoders\jpeg";"$(SolutionDir)..\webkit\port\platform\image-decoders\png";"$(SolutionDir)..\webkit\port\platform\image-decoders\xbm";"$(SolutionDir)..\webkit";"$(SolutionDir)..\webkit\build";"$(ProjectDir)";"$(SolutionDir)..\third_party\WebKit\WebCore\";"$(SolutionDir)..\third_party\WebKit\WebCore\bridge";"$(SolutionDir)..\third_party\WebKit\WebCore\bridge\c";"$(SolutionDir)..\third_party\WebKit\WebCore\css";"$(SolutionDir)..\third_party\WebKit\WebCore\dom";"$(SolutionDir)..\third_party\WebKit\WebCore\editing";"$(SolutionDir)..\third_party\WebKit\WebCore\history";"$(SolutionDir)..\third_party\WebKit\WebCore\html";"$(SolutionDir)..\third_party\WebKit\WebCore\loader";"$(SolutionDir)..\third_party\WebKit\WebCore\loader\appcache";"$(SolutionDir)..\third_party\WebKit\WebCore\loader\archive";"$(SolutionDir)..\third_party\WebKit\WebCore\loader\icon";"$(SolutionDir)..\third_party\WebKit\WebCore\page";"$(SolutionDir)..\third_party\WebKit\WebCore\platform";"$(SolutionDir)..\third_party\WebKit\WebCore\page\animation";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\text";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics";"$(SolutionDir)..\third_party\WebKit\WebCore\svg\graphics";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\network";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\sql";"$(SolutionDir)..\third_party\WebKit\WebCore\rendering";"$(SolutionDir)..\third_party\WebKit\WebCore\rendering\style";"$(SolutionDir)..\third_party\WebKit\WebCore\storage";"$(SolutionDir)..\third_party\WebKit\WebCore\xml";"$(SolutionDir)..\third_party\WebKit\WebCore";"$(SolutionDir)..\third_party\WebKit\WebCore\os-win32";"$(SolutionDir)..\third_party\WebKit\WebCore\wtf";"$(SolutionDir)..\third_party\WebKit\JavaScriptCore";"$(SolutionDir)..\third_party\WebKit\JavaScriptCore\wtf";"$(SolutionDir)..\third_party\WebKit\JavaScriptCore\os-win32";"$(SolutionDir)..\third_party\WebKit\WebCore\svg";"$(SolutionDir)..\third_party\WebKit\WebCore\svg\animation";"$(SolutionDir)..\third_party\WebKit\WebCore\svg\graphics\filters";"$(SolutionDir)..\third_party\WebKit\WebCore\plugins";"$(SolutionDir)..\third_party\WebKit\WebCore\inspector";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\chromium";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics\skia";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\network\chromium";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\animation";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics\transforms";"$(SolutionDir)..\third_party\sqlite";"$(SDKIncludes)";"$(IntDir)\..\WebCore\DerivedSources";"
|
||||
AdditionalIncludeDirectories=""$(OutDir)\obj\WebCore";"$(OutDir)\obj\WebCore\JavaScriptHeaders";"$(OutDir)\obj\WebCore\JavaScriptHeaders\JavaScriptCore";"$(SolutionDir)..\webkit\pending\";"$(SolutionDir)..\webkit\port\platform";"$(SolutionDir)..\webkit\port\platform\image-decoders";"$(SolutionDir)..\webkit\port\platform\image-decoders\bmp";"$(SolutionDir)..\webkit\port\platform\image-decoders\gif";"$(SolutionDir)..\webkit\port\platform\image-decoders\ico";"$(SolutionDir)..\webkit\port\platform\image-decoders\jpeg";"$(SolutionDir)..\webkit\port\platform\image-decoders\png";"$(SolutionDir)..\webkit\port\platform\image-decoders\xbm";"$(SolutionDir)..\webkit";"$(SolutionDir)..\webkit\build";"$(ProjectDir)";"$(SolutionDir)..\third_party\WebKit\WebCore\";"$(SolutionDir)..\third_party\WebKit\WebCore\bridge";"$(SolutionDir)..\third_party\WebKit\WebCore\bridge\c";"$(SolutionDir)..\third_party\WebKit\WebCore\css";"$(SolutionDir)..\third_party\WebKit\WebCore\dom";"$(SolutionDir)..\third_party\WebKit\WebCore\editing";"$(SolutionDir)..\third_party\WebKit\WebCore\history";"$(SolutionDir)..\third_party\WebKit\WebCore\html";"$(SolutionDir)..\third_party\WebKit\WebCore\loader";"$(SolutionDir)..\third_party\WebKit\WebCore\loader\appcache";"$(SolutionDir)..\third_party\WebKit\WebCore\loader\archive";"$(SolutionDir)..\third_party\WebKit\WebCore\loader\icon";"$(SolutionDir)..\third_party\WebKit\WebCore\page";"$(SolutionDir)..\third_party\WebKit\WebCore\platform";"$(SolutionDir)..\third_party\WebKit\WebCore\page\animation";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\text";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics\chromium";"$(SolutionDir)..\third_party\WebKit\WebCore\svg\graphics";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\network";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\sql";"$(SolutionDir)..\third_party\WebKit\WebCore\rendering";"$(SolutionDir)..\third_party\WebKit\WebCore\rendering\style";"$(SolutionDir)..\third_party\WebKit\WebCore\storage";"$(SolutionDir)..\third_party\WebKit\WebCore\xml";"$(SolutionDir)..\third_party\WebKit\WebCore";"$(SolutionDir)..\third_party\WebKit\WebCore\os-win32";"$(SolutionDir)..\third_party\WebKit\WebCore\wtf";"$(SolutionDir)..\third_party\WebKit\JavaScriptCore";"$(SolutionDir)..\third_party\WebKit\JavaScriptCore\wtf";"$(SolutionDir)..\third_party\WebKit\JavaScriptCore\os-win32";"$(SolutionDir)..\third_party\WebKit\WebCore\svg";"$(SolutionDir)..\third_party\WebKit\WebCore\svg\animation";"$(SolutionDir)..\third_party\WebKit\WebCore\svg\graphics\filters";"$(SolutionDir)..\third_party\WebKit\WebCore\plugins";"$(SolutionDir)..\third_party\WebKit\WebCore\inspector";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\chromium";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics\skia";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\network\chromium";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\animation";"$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics\transforms";"$(SolutionDir)..\third_party\sqlite";"$(SDKIncludes)";"$(IntDir)\..\WebCore\DerivedSources";"
|
||||
/>
|
||||
</VisualStudioPropertySheet>
|
||||
|
@@ -16,8 +16,6 @@
|
||||
|
||||
#include "base/file_util.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/gfx/gdi_util.h"
|
||||
#include "base/gfx/point.h"
|
||||
#include "base/stats_counters.h"
|
||||
#include "base/string_util.h"
|
||||
#include "webkit/default_plugin/plugin_impl.h"
|
||||
@@ -137,7 +135,6 @@ BrowserWebPluginDelegateImpl::BrowserWebPluginDelegateImpl(
|
||||
plugin_wnd_proc_(NULL),
|
||||
last_message_(0),
|
||||
is_calling_wndproc(false),
|
||||
initial_plugin_resize_done_(false),
|
||||
dummy_window_for_activation_(NULL),
|
||||
handle_event_message_filter_hook_(NULL),
|
||||
handle_event_pump_messages_event_(NULL),
|
||||
@@ -287,13 +284,11 @@ void BrowserWebPluginDelegateImpl::DestroyInstance() {
|
||||
|
||||
void BrowserWebPluginDelegateImpl::UpdateGeometry(
|
||||
const gfx::Rect& window_rect,
|
||||
const gfx::Rect& clip_rect,
|
||||
const std::vector<gfx::Rect>& cutout_rects,
|
||||
bool visible) {
|
||||
const gfx::Rect& clip_rect) {
|
||||
if (windowless_) {
|
||||
WindowlessUpdateGeometry(window_rect, clip_rect);
|
||||
} else {
|
||||
WindowedUpdateGeometry(window_rect, clip_rect, cutout_rects, visible);
|
||||
WindowedUpdateGeometry(window_rect, clip_rect);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,6 +337,13 @@ void BrowserWebPluginDelegateImpl::SendJavaScriptStream(const std::string& url,
|
||||
void BrowserWebPluginDelegateImpl::DidReceiveManualResponse(
|
||||
const std::string& url, const std::string& mime_type,
|
||||
const std::string& headers, uint32 expected_length, uint32 last_modified) {
|
||||
|
||||
if (!windowless_) {
|
||||
// Calling NPP_WriteReady before NPP_SetWindow causes movies to not load in
|
||||
// Flash. See http://b/issue?id=892174.
|
||||
DCHECK(windowed_did_set_window_);
|
||||
}
|
||||
|
||||
instance()->DidReceiveManualResponse(url, mime_type, headers,
|
||||
expected_length, last_modified);
|
||||
}
|
||||
@@ -373,10 +375,8 @@ void BrowserWebPluginDelegateImpl::InstallMissingPlugin() {
|
||||
|
||||
void BrowserWebPluginDelegateImpl::WindowedUpdateGeometry(
|
||||
const gfx::Rect& window_rect,
|
||||
const gfx::Rect& clip_rect,
|
||||
const std::vector<gfx::Rect>& cutout_rects,
|
||||
bool visible) {
|
||||
if (WindowedReposition(window_rect, clip_rect, cutout_rects, visible) ||
|
||||
const gfx::Rect& clip_rect) {
|
||||
if (WindowedReposition(window_rect, clip_rect) ||
|
||||
!windowed_did_set_window_) {
|
||||
// Let the plugin know that it has been moved
|
||||
WindowedSetWindow();
|
||||
@@ -625,69 +625,33 @@ bool BrowserWebPluginDelegateImpl::CreateDummyWindowForActivation() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void BrowserWebPluginDelegateImpl::MoveWindow(
|
||||
HWND window,
|
||||
const gfx::Rect& window_rect,
|
||||
const gfx::Rect& clip_rect,
|
||||
const std::vector<gfx::Rect>& cutout_rects,
|
||||
bool visible) {
|
||||
HRGN hrgn = ::CreateRectRgn(clip_rect.x(),
|
||||
clip_rect.y(),
|
||||
clip_rect.right(),
|
||||
clip_rect.bottom());
|
||||
gfx::SubtractRectanglesFromRegion(hrgn, cutout_rects);
|
||||
|
||||
// Note: System will own the hrgn after we call SetWindowRgn,
|
||||
// so we don't need to call DeleteObject(hrgn)
|
||||
::SetWindowRgn(window, hrgn, FALSE);
|
||||
|
||||
unsigned long flags = 0;
|
||||
if (visible)
|
||||
flags |= SWP_SHOWWINDOW;
|
||||
else
|
||||
flags |= SWP_HIDEWINDOW;
|
||||
|
||||
::SetWindowPos(window,
|
||||
NULL,
|
||||
window_rect.x(),
|
||||
window_rect.y(),
|
||||
window_rect.width(),
|
||||
window_rect.height(),
|
||||
flags);
|
||||
}
|
||||
|
||||
bool BrowserWebPluginDelegateImpl::WindowedReposition(
|
||||
const gfx::Rect& window_rect,
|
||||
const gfx::Rect& clip_rect,
|
||||
const std::vector<gfx::Rect>& cutout_rects,
|
||||
bool visible) {
|
||||
const gfx::Rect& clip_rect) {
|
||||
if (!windowed_handle_) {
|
||||
NOTREACHED();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (window_rect_ == window_rect && clip_rect_ == clip_rect &&
|
||||
cutout_rects == cutout_rects_ &&
|
||||
initial_plugin_resize_done_)
|
||||
if (window_rect_ == window_rect && clip_rect_ == clip_rect)
|
||||
return false;
|
||||
|
||||
// Clipping is handled by WebPlugin.
|
||||
if (window_rect.size() != window_rect_.size()) {
|
||||
::SetWindowPos(windowed_handle_,
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
window_rect.width(),
|
||||
window_rect.height(),
|
||||
SWP_SHOWWINDOW);
|
||||
}
|
||||
|
||||
window_rect_ = window_rect;
|
||||
clip_rect_ = clip_rect;
|
||||
cutout_rects_ = cutout_rects;
|
||||
|
||||
if (!initial_plugin_resize_done_) {
|
||||
// We need to ensure that the plugin process continues to reposition
|
||||
// the plugin window until we receive an indication that it is now visible.
|
||||
// Subsequent repositions will be done by the browser.
|
||||
if (visible)
|
||||
initial_plugin_resize_done_ = true;
|
||||
// We created the window with 0 width and height since we didn't know it
|
||||
// at the time. Now that we know the geometry, we we can update its size
|
||||
// since the browser only calls SetWindowPos when scrolling occurs.
|
||||
MoveWindow(windowed_handle_, window_rect, clip_rect, cutout_rects, visible);
|
||||
// Ensure that the entire window gets repainted.
|
||||
::InvalidateRect(windowed_handle_, NULL, FALSE);
|
||||
}
|
||||
|
||||
// Ensure that the entire window gets repainted.
|
||||
::InvalidateRect(windowed_handle_, NULL, FALSE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -47,14 +47,12 @@ class BrowserWebPluginDelegateImpl : public WebPluginDelegate {
|
||||
WebPlugin* plugin,
|
||||
bool load_manually);
|
||||
virtual void UpdateGeometry(const gfx::Rect& window_rect,
|
||||
const gfx::Rect& clip_rect,
|
||||
const std::vector<gfx::Rect>& cutout_rects,
|
||||
bool visible);
|
||||
const gfx::Rect& clip_rect);
|
||||
virtual void Paint(HDC hdc, const gfx::Rect& rect);
|
||||
virtual void Print(HDC hdc);
|
||||
virtual void SetFocus(); // only called when windowless
|
||||
// only called when windowless
|
||||
virtual bool HandleEvent(NPEvent* event,
|
||||
virtual bool HandleEvent(NPEvent* event,
|
||||
WebCursor* cursor);
|
||||
virtual NPObject* GetPluginScriptableObject();
|
||||
virtual void DidFinishLoadWithReason(NPReason reason);
|
||||
@@ -62,9 +60,9 @@ class BrowserWebPluginDelegateImpl : public WebPluginDelegate {
|
||||
|
||||
virtual void FlushGeometryUpdates() {
|
||||
}
|
||||
virtual void SendJavaScriptStream(const std::string& url,
|
||||
const std::wstring& result,
|
||||
bool success, bool notify_needed,
|
||||
virtual void SendJavaScriptStream(const std::string& url,
|
||||
const std::wstring& result,
|
||||
bool success, bool notify_needed,
|
||||
int notify_data);
|
||||
virtual void DidReceiveManualResponse(const std::string& url,
|
||||
const std::string& mime_type,
|
||||
@@ -97,16 +95,11 @@ class BrowserWebPluginDelegateImpl : public WebPluginDelegate {
|
||||
PLUGIN_QUIRK_DIE_AFTER_UNLOAD = 32,
|
||||
PLUGIN_QUIRK_PATCH_TRACKPOPUP_MENU = 64,
|
||||
PLUGIN_QUIRK_PATCH_SETCURSOR = 128,
|
||||
PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS = 256,
|
||||
};
|
||||
|
||||
int quirks() { return quirks_; }
|
||||
|
||||
static void MoveWindow(HWND window,
|
||||
const gfx::Rect& window_rect,
|
||||
const gfx::Rect& clip_rect,
|
||||
const std::vector<gfx::Rect>& cutout_rects,
|
||||
bool visible);
|
||||
|
||||
private:
|
||||
BrowserWebPluginDelegateImpl(gfx::NativeView containing_view,
|
||||
NPAPI::BrowserPluginInstance *instance);
|
||||
@@ -115,9 +108,7 @@ class BrowserWebPluginDelegateImpl : public WebPluginDelegate {
|
||||
//--------------------------
|
||||
// used for windowed plugins
|
||||
void WindowedUpdateGeometry(const gfx::Rect& window_rect,
|
||||
const gfx::Rect& clip_rect,
|
||||
const std::vector<gfx::Rect>& cutout_rects,
|
||||
bool visible);
|
||||
const gfx::Rect& clip_rect);
|
||||
// Create the native window.
|
||||
// Returns true if the window is created (or already exists).
|
||||
// Returns false if unable to create the window.
|
||||
@@ -129,9 +120,7 @@ class BrowserWebPluginDelegateImpl : public WebPluginDelegate {
|
||||
// Reposition the native window to be in sync with the given geometry.
|
||||
// Returns true if the native window has moved or been clipped differently.
|
||||
bool WindowedReposition(const gfx::Rect& window_rect,
|
||||
const gfx::Rect& clip_rect,
|
||||
const std::vector<gfx::Rect>& cutout_rects,
|
||||
bool visible);
|
||||
const gfx::Rect& clip_rect);
|
||||
|
||||
// Tells the plugin about the current state of the window.
|
||||
// See NPAPI NPP_SetWindow for more information.
|
||||
@@ -204,11 +193,6 @@ class BrowserWebPluginDelegateImpl : public WebPluginDelegate {
|
||||
std::vector<gfx::Rect> cutout_rects_;
|
||||
int quirks_;
|
||||
|
||||
// We only move/size the plugin window once after its creation. The
|
||||
// rest of the moves are controlled by the browser. This flag controls
|
||||
// this behaviour.
|
||||
bool initial_plugin_resize_done_;
|
||||
|
||||
// Windowless plugins don't have keyboard focus causing issues with the
|
||||
// plugin not receiving keyboard events if the plugin enters a modal
|
||||
// loop like TrackPopupMenuEx or MessageBox, etc.
|
||||
|
Reference in New Issue
Block a user