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:
Marshall Greenblatt
2009-01-21 21:57:19 +00:00
parent 299030afe0
commit a18491fbd5
7 changed files with 87 additions and 148 deletions

View File

@@ -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
}

View File

@@ -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;

View File

@@ -6,6 +6,6 @@
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(OutDir)\obj\WebCore&quot;;&quot;$(OutDir)\obj\WebCore\JavaScriptHeaders&quot;;&quot;$(OutDir)\obj\WebCore\JavaScriptHeaders\JavaScriptCore&quot;;&quot;$(SolutionDir)..\webkit\pending\&quot;;&quot;$(SolutionDir)..\webkit\port\platform&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\bmp&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\gif&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\ico&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\jpeg&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\png&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\xbm&quot;;&quot;$(SolutionDir)..\webkit&quot;;&quot;$(SolutionDir)..\webkit\build&quot;;&quot;$(ProjectDir)&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\bridge&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\bridge\c&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\css&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\dom&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\editing&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\history&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\html&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader\appcache&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader\archive&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader\icon&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\page&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\page\animation&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\text&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg\graphics&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\network&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\sql&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\rendering&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\rendering\style&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\storage&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\xml&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\os-win32&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\wtf&quot;;&quot;$(SolutionDir)..\third_party\WebKit\JavaScriptCore&quot;;&quot;$(SolutionDir)..\third_party\WebKit\JavaScriptCore\wtf&quot;;&quot;$(SolutionDir)..\third_party\WebKit\JavaScriptCore\os-win32&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg\animation&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg\graphics\filters&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\plugins&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\inspector&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\chromium&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics\skia&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\network\chromium&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\animation&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics\transforms&quot;;&quot;$(SolutionDir)..\third_party\sqlite&quot;;&quot;$(SDKIncludes)&quot;;&quot;$(IntDir)\..\WebCore\DerivedSources&quot;;"
AdditionalIncludeDirectories="&quot;$(OutDir)\obj\WebCore&quot;;&quot;$(OutDir)\obj\WebCore\JavaScriptHeaders&quot;;&quot;$(OutDir)\obj\WebCore\JavaScriptHeaders\JavaScriptCore&quot;;&quot;$(SolutionDir)..\webkit\pending\&quot;;&quot;$(SolutionDir)..\webkit\port\platform&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\bmp&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\gif&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\ico&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\jpeg&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\png&quot;;&quot;$(SolutionDir)..\webkit\port\platform\image-decoders\xbm&quot;;&quot;$(SolutionDir)..\webkit&quot;;&quot;$(SolutionDir)..\webkit\build&quot;;&quot;$(ProjectDir)&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\bridge&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\bridge\c&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\css&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\dom&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\editing&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\history&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\html&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader\appcache&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader\archive&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\loader\icon&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\page&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\page\animation&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\text&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics\chromium&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg\graphics&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\network&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\sql&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\rendering&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\rendering\style&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\storage&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\xml&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\os-win32&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\wtf&quot;;&quot;$(SolutionDir)..\third_party\WebKit\JavaScriptCore&quot;;&quot;$(SolutionDir)..\third_party\WebKit\JavaScriptCore\wtf&quot;;&quot;$(SolutionDir)..\third_party\WebKit\JavaScriptCore\os-win32&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg\animation&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\svg\graphics\filters&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\plugins&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\inspector&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\chromium&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics\skia&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\network\chromium&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\animation&quot;;&quot;$(SolutionDir)..\third_party\WebKit\WebCore\platform\graphics\transforms&quot;;&quot;$(SolutionDir)..\third_party\sqlite&quot;;&quot;$(SDKIncludes)&quot;;&quot;$(IntDir)\..\WebCore\DerivedSources&quot;;"
/>
</VisualStudioPropertySheet>

View File

@@ -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;
}

View File

@@ -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.