Commit c62ce3e9 authored by darin@chromium.org's avatar darin@chromium.org

Chromium changes to use new WebKit, WebKitClient, and WebClipboard interfaces.

A new WebKitClientImpl class is added to webkit/glue that consumers can use to
help implement WebKitClient.  In the future, consumers will likely subclass
WebKitClientImpl.  For now, that is not necessary.

Since a WebImage may not hold a SkBitmap, I needed to modify
ScopedClipboardWriterGlue to not deal in SkBitmaps.  So, I just added a
WriteBitmapFromPixels method in place of the WriteBitmap method.  That method
is actually named the same as the one from the base class, which is perhaps
kind of nice since the purpose of ScopedClipboardWriterGlue is to override the
default way of sending an image to the clipboard!

R=dglazkov

Review URL: http://codereview.chromium.org/28119

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10416 0039d316-1c4b-4281-b951-d872f2087c98
parent bb095ea4
...@@ -240,6 +240,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "perf_tests", "test\perf\per ...@@ -240,6 +240,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "perf_tests", "test\perf\per
{57823D8C-A317-4713-9125-2C91FDFD12D6} = {57823D8C-A317-4713-9125-2C91FDFD12D6} {57823D8C-A317-4713-9125-2C91FDFD12D6} = {57823D8C-A317-4713-9125-2C91FDFD12D6}
{5916D37D-8C97-424F-A904-74E52594C2D6} = {5916D37D-8C97-424F-A904-74E52594C2D6} {5916D37D-8C97-424F-A904-74E52594C2D6} = {5916D37D-8C97-424F-A904-74E52594C2D6}
{5BF908A7-68FB-4A4B-99E3-8C749F1FE4EA} = {5BF908A7-68FB-4A4B-99E3-8C749F1FE4EA} {5BF908A7-68FB-4A4B-99E3-8C749F1FE4EA} = {5BF908A7-68FB-4A4B-99E3-8C749F1FE4EA}
{5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} = {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65}
{625A8F11-2B4E-45B4-BD99-C6D629C606C0} = {625A8F11-2B4E-45B4-BD99-C6D629C606C0} {625A8F11-2B4E-45B4-BD99-C6D629C606C0} = {625A8F11-2B4E-45B4-BD99-C6D629C606C0}
{6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9} = {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9} {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9} = {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9}
{6F9258E5-294F-47B2-919D-17FFE7A8B751} = {6F9258E5-294F-47B2-919D-17FFE7A8B751} {6F9258E5-294F-47B2-919D-17FFE7A8B751} = {6F9258E5-294F-47B2-919D-17FFE7A8B751}
...@@ -431,10 +432,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "generate_profile", "tools\p ...@@ -431,10 +432,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "generate_profile", "tools\p
{2A70CBF0-847E-4E3A-B926-542A656DC7FE} = {2A70CBF0-847E-4E3A-B926-542A656DC7FE} {2A70CBF0-847E-4E3A-B926-542A656DC7FE} = {2A70CBF0-847E-4E3A-B926-542A656DC7FE}
{326E9795-E760-410A-B69A-3F79DB3F5243} = {326E9795-E760-410A-B69A-3F79DB3F5243} {326E9795-E760-410A-B69A-3F79DB3F5243} = {326E9795-E760-410A-B69A-3F79DB3F5243}
{49909552-0B0C-4C14-8CF6-DB8A2ADE0934} = {49909552-0B0C-4C14-8CF6-DB8A2ADE0934} {49909552-0B0C-4C14-8CF6-DB8A2ADE0934} = {49909552-0B0C-4C14-8CF6-DB8A2ADE0934}
{5597AD47-3494-4750-A235-4F9C2F864700} = {5597AD47-3494-4750-A235-4F9C2F864700}
{57823D8C-A317-4713-9125-2C91FDFD12D6} = {57823D8C-A317-4713-9125-2C91FDFD12D6} {57823D8C-A317-4713-9125-2C91FDFD12D6} = {57823D8C-A317-4713-9125-2C91FDFD12D6}
{5916D37D-8C97-424F-A904-74E52594C2D6} = {5916D37D-8C97-424F-A904-74E52594C2D6} {5916D37D-8C97-424F-A904-74E52594C2D6} = {5916D37D-8C97-424F-A904-74E52594C2D6}
{5BF908A7-68FB-4A4B-99E3-8C749F1FE4EA} = {5BF908A7-68FB-4A4B-99E3-8C749F1FE4EA} {5BF908A7-68FB-4A4B-99E3-8C749F1FE4EA} = {5BF908A7-68FB-4A4B-99E3-8C749F1FE4EA}
{5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} = {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65}
{625A8F11-2B4E-45B4-BD99-C6D629C606C0} = {625A8F11-2B4E-45B4-BD99-C6D629C606C0} {625A8F11-2B4E-45B4-BD99-C6D629C606C0} = {625A8F11-2B4E-45B4-BD99-C6D629C606C0}
{6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9} = {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9} {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9} = {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9}
{6F9258E5-294F-47B2-919D-17FFE7A8B751} = {6F9258E5-294F-47B2-919D-17FFE7A8B751} {6F9258E5-294F-47B2-919D-17FFE7A8B751} = {6F9258E5-294F-47B2-919D-17FFE7A8B751}
...@@ -641,6 +642,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "interactive_ui_tests", "tes ...@@ -641,6 +642,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "interactive_ui_tests", "tes
{57823D8C-A317-4713-9125-2C91FDFD12D6} = {57823D8C-A317-4713-9125-2C91FDFD12D6} {57823D8C-A317-4713-9125-2C91FDFD12D6} = {57823D8C-A317-4713-9125-2C91FDFD12D6}
{5916D37D-8C97-424F-A904-74E52594C2D6} = {5916D37D-8C97-424F-A904-74E52594C2D6} {5916D37D-8C97-424F-A904-74E52594C2D6} = {5916D37D-8C97-424F-A904-74E52594C2D6}
{5BF908A7-68FB-4A4B-99E3-8C749F1FE4EA} = {5BF908A7-68FB-4A4B-99E3-8C749F1FE4EA} {5BF908A7-68FB-4A4B-99E3-8C749F1FE4EA} = {5BF908A7-68FB-4A4B-99E3-8C749F1FE4EA}
{5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65} = {5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65}
{625A8F11-2B4E-45B4-BD99-C6D629C606C0} = {625A8F11-2B4E-45B4-BD99-C6D629C606C0} {625A8F11-2B4E-45B4-BD99-C6D629C606C0} = {625A8F11-2B4E-45B4-BD99-C6D629C606C0}
{6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9} = {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9} {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9} = {6EAD4A4B-2BBC-4974-8E45-BB5C16CC2AC9}
{6F9258E5-294F-47B2-919D-17FFE7A8B751} = {6F9258E5-294F-47B2-919D-17FFE7A8B751} {6F9258E5-294F-47B2-919D-17FFE7A8B751} = {6F9258E5-294F-47B2-919D-17FFE7A8B751}
......
This diff is collapsed.
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
#include "chrome/renderer/user_script_slave.h" #include "chrome/renderer/user_script_slave.h"
#include "chrome/renderer/visitedlink_slave.h" #include "chrome/renderer/visitedlink_slave.h"
#include "webkit/glue/cache_manager.h" #include "webkit/glue/cache_manager.h"
#include "webkit/glue/webkit_client_impl.h"
#include "WebKit.h"
static const unsigned int kCacheStatsDelayMS = 2000 /* milliseconds */; static const unsigned int kCacheStatsDelayMS = 2000 /* milliseconds */;
...@@ -99,6 +101,9 @@ void RenderThread::Init() { ...@@ -99,6 +101,9 @@ void RenderThread::Init() {
CoInitialize(0); CoInitialize(0);
#endif #endif
webkit_client_impl_.reset(new webkit_glue::WebKitClientImpl);
WebKit::initialize(webkit_client_impl_.get());
visited_link_slave_ = new VisitedLinkSlave(); visited_link_slave_ = new VisitedLinkSlave();
user_script_slave_ = new UserScriptSlave(); user_script_slave_ = new UserScriptSlave();
render_dns_master_.reset(new RenderDnsMaster()); render_dns_master_.reset(new RenderDnsMaster());
......
...@@ -24,6 +24,10 @@ class VisitedLinkSlave; ...@@ -24,6 +24,10 @@ class VisitedLinkSlave;
struct ModalDialogEvent; struct ModalDialogEvent;
struct WebPreferences; struct WebPreferences;
namespace webkit_glue {
class WebKitClientImpl;
}
// The RenderThreadBase is the minimal interface that a RenderView/Widget // The RenderThreadBase is the minimal interface that a RenderView/Widget
// expects from a render thread. The interface basically abstracts a way to send // expects from a render thread. The interface basically abstracts a way to send
// and receive messages. // and receive messages.
...@@ -138,6 +142,8 @@ class RenderThread : public RenderThreadBase, ...@@ -138,6 +142,8 @@ class RenderThread : public RenderThreadBase,
scoped_ptr<NotificationService> notification_service_; scoped_ptr<NotificationService> notification_service_;
scoped_ptr<webkit_glue::WebKitClientImpl> webkit_client_impl_;
DISALLOW_COPY_AND_ASSIGN(RenderThread); DISALLOW_COPY_AND_ASSIGN(RenderThread);
}; };
......
...@@ -16,8 +16,12 @@ env.SConscript([ ...@@ -16,8 +16,12 @@ env.SConscript([
], {'env':env}) ], {'env':env})
env.Prepend( env.Prepend(
CPPDEFINES = [
'WEBKIT_USING_SKIA'
],
CPPPATH = [ CPPPATH = [
'$CHROME_SRC_DIR', '$CHROME_SRC_DIR',
'$THIRD_PARTY_WEBKIT_DIR/WebKit/chromium/public',
], ],
) )
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<Configuration <Configuration
Name="Debug|Win32" Name="Debug|Win32"
ConfigurationType="4" ConfigurationType="4"
InheritedPropertySheets=".\renderer.vsprops;$(SolutionDir)..\build\debug.vsprops;..\tools\build\win\precompiled_wtl.vsprops" InheritedPropertySheets=".\renderer.vsprops;$(SolutionDir)..\build\debug.vsprops;..\tools\build\win\precompiled_wtl.vsprops;..\..\webkit\build\WebKit\using_WebKit.vsprops"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
ConfigurationType="4" ConfigurationType="4"
InheritedPropertySheets=".\renderer.vsprops;$(SolutionDir)..\build\release.vsprops" InheritedPropertySheets=".\renderer.vsprops;$(SolutionDir)..\build\release.vsprops;..\..\webkit\build\WebKit\using_WebKit.vsprops"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
......
...@@ -84,15 +84,15 @@ class ResizableStackArray { ...@@ -84,15 +84,15 @@ class ResizableStackArray {
}; };
#if defined(OS_WIN) #if defined(OS_WIN)
// This definition of WriteBitmap uses shared memory to communicate across // This definition of WriteBitmapFromPixels uses shared memory to communicate
// processes. // across processes.
void ScopedClipboardWriterGlue::WriteBitmap(const SkBitmap& bitmap) { void ScopedClipboardWriterGlue::WriteBitmapFromPixels(const void* pixels,
// do not try to write a bitmap more than once const gfx::Size& size) {
// Do not try to write a bitmap more than once
if (shared_buf_) if (shared_buf_)
return; return;
size_t buf_size = bitmap.getSize(); size_t buf_size = 4 * size.width() * size.height();
gfx::Size size(bitmap.width(), bitmap.height());
// Allocate a shared memory buffer to hold the bitmap bits // Allocate a shared memory buffer to hold the bitmap bits
shared_buf_ = new base::SharedMemory; shared_buf_ = new base::SharedMemory;
...@@ -104,8 +104,7 @@ void ScopedClipboardWriterGlue::WriteBitmap(const SkBitmap& bitmap) { ...@@ -104,8 +104,7 @@ void ScopedClipboardWriterGlue::WriteBitmap(const SkBitmap& bitmap) {
} }
// Copy the bits into shared memory // Copy the bits into shared memory
SkAutoLockPixels bitmap_lock(bitmap); memcpy(shared_buf_->memory(), pixels, buf_size);
memcpy(shared_buf_->memory(), bitmap.getPixels(), buf_size);
shared_buf_->Unmap(); shared_buf_->Unmap();
Clipboard::ObjectMapParam param1, param2; Clipboard::ObjectMapParam param1, param2;
......
...@@ -8,7 +8,8 @@ env = env.Clone() ...@@ -8,7 +8,8 @@ env = env.Clone()
env.Append( env.Append(
CPPDEFINES = [ CPPDEFINES = [
'WEBKIT_IMPLEMENTATION' 'WEBKIT_IMPLEMENTATION',
'WEBKIT_USING_SKIA'
], ],
CPPPATH = [ CPPPATH = [
'$WEBKIT_DIR/build/WebCore', '$WEBKIT_DIR/build/WebCore',
...@@ -17,7 +18,12 @@ env.Append( ...@@ -17,7 +18,12 @@ env.Append(
) )
input_files = [ input_files = [
'$THIRD_PARTY_WEBKIT_DIR/WebKit/chromium/src/ChromiumBridge.cpp',
'$THIRD_PARTY_WEBKIT_DIR/WebKit/chromium/src/WebCString.cpp',
'$THIRD_PARTY_WEBKIT_DIR/WebKit/chromium/src/WebImageSkia.cpp',
'$THIRD_PARTY_WEBKIT_DIR/WebKit/chromium/src/WebKit.cpp',
'$THIRD_PARTY_WEBKIT_DIR/WebKit/chromium/src/WebString.cpp', '$THIRD_PARTY_WEBKIT_DIR/WebKit/chromium/src/WebString.cpp',
'$THIRD_PARTY_WEBKIT_DIR/WebKit/chromium/src/WebURL.cpp',
] ]
env.ChromeLibrary('WebKit', input_files) env.ChromeLibrary('WebKit', input_files)
...@@ -127,22 +127,82 @@ ...@@ -127,22 +127,82 @@
<Filter <Filter
Name="public" Name="public"
> >
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebClipboard.h"
>
</File>
<File <File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebCommon.h" RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebCommon.h"
> >
</File> </File>
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebCString.h"
>
</File>
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebImage.h"
>
</File>
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebKit.h"
>
</File>
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebKitClient.h"
>
</File>
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebPoint.h"
>
</File>
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebRect.h"
>
</File>
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebSize.h"
>
</File>
<File <File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebString.h" RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebString.h"
> >
</File> </File>
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\public\WebURL.h"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="src" Name="src"
> >
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\src\ChromiumBridge.cpp"
>
</File>
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\src\WebCString.cpp"
>
</File>
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\src\WebImageSkia.cpp"
>
</File>
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\src\WebKit.cpp"
>
</File>
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\src\WebKitPrivate.h"
>
</File>
<File <File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\src\WebString.cpp" RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\src\WebString.cpp"
> >
</File> </File>
<File
RelativePath="..\..\..\third_party\WebKit\WebKit\chromium\src\WebURL.cpp"
>
</File>
</Filter> </Filter>
</Filter> </Filter>
</Files> </Files>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories="$(SolutionDir)..\third_party\WebKit\WebKit\chromium\public" AdditionalIncludeDirectories="$(SolutionDir)..\third_party\WebKit\WebKit\chromium\public"
PreprocessorDefinitions="WEBKIT_IMPLEMENTATION;_SCL_SECURE_NO_DEPRECATE;_HAS_EXCEPTIONS=1" PreprocessorDefinitions="WEBKIT_IMPLEMENTATION;WEBKIT_USING_SKIA=1;_SCL_SECURE_NO_DEPRECATE;_HAS_EXCEPTIONS=1"
WarnAsError="true" WarnAsError="true"
/> />
</VisualStudioPropertySheet> </VisualStudioPropertySheet>
...@@ -7,8 +7,12 @@ Import('env') ...@@ -7,8 +7,12 @@ Import('env')
env = env.Clone() env = env.Clone()
env.Append( env.Append(
CPPDEFINES = [
'WEBKIT_USING_SKIA'
],
CPPPATH = [ CPPPATH = [
'$WEBKIT_DIR/build/WebCore', '$WEBKIT_DIR/build/WebCore',
'$THIRD_PARTY_WEBKIT_DIR/WebKit/chromium/public',
], ],
LIBS = [ LIBS = [
'port', 'port',
...@@ -75,6 +79,7 @@ input_files = [ ...@@ -75,6 +79,7 @@ input_files = [
'resource_loader_bridge.cc', 'resource_loader_bridge.cc',
'searchable_form_data.cc', 'searchable_form_data.cc',
'stacking_order_iterator.cc', 'stacking_order_iterator.cc',
'webclipboard_impl.cc',
'webcursor.cc', 'webcursor.cc',
'webdatasource_impl.cc', 'webdatasource_impl.cc',
'webdocumentloader_impl.cc', 'webdocumentloader_impl.cc',
...@@ -82,6 +87,7 @@ input_files = [ ...@@ -82,6 +87,7 @@ input_files = [
'webframe_impl.cc', 'webframe_impl.cc',
'webframeloaderclient_impl.cc', 'webframeloaderclient_impl.cc',
'webhistoryitem_impl.cc', 'webhistoryitem_impl.cc',
'webkit_client_impl.cc',
'webkit_glue.cc', 'webkit_glue.cc',
'webmediaplayer_impl.cc', 'webmediaplayer_impl.cc',
'webplugin_delegate.cc', 'webplugin_delegate.cc',
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "ChromiumBridge.h" #include "ChromiumBridge.h"
#include "BitmapImage.h" #include "BitmapImage.h"
#include "ClipboardUtilitiesChromium.h"
#include "Cursor.h" #include "Cursor.h"
#include "Frame.h" #include "Frame.h"
#include "FrameView.h" #include "FrameView.h"
...@@ -27,7 +26,6 @@ ...@@ -27,7 +26,6 @@
#include <wtf/CurrentTime.h> #include <wtf/CurrentTime.h>
#undef LOG #undef LOG
#include "base/clipboard.h"
#include "base/file_util.h" #include "base/file_util.h"
#include "base/message_loop.h" #include "base/message_loop.h"
#include "base/stats_counters.h" #include "base/stats_counters.h"
...@@ -45,7 +43,6 @@ ...@@ -45,7 +43,6 @@
#include "webkit/glue/chrome_client_impl.h" #include "webkit/glue/chrome_client_impl.h"
#include "webkit/glue/glue_util.h" #include "webkit/glue/glue_util.h"
#include "webkit/glue/plugins/plugin_instance.h" #include "webkit/glue/plugins/plugin_instance.h"
#include "webkit/glue/scoped_clipboard_writer_glue.h"
#include "webkit/glue/webcursor.h" #include "webkit/glue/webcursor.h"
#include "webkit/glue/webkit_glue.h" #include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webplugin_impl.h" #include "webkit/glue/webplugin_impl.h"
...@@ -93,122 +90,10 @@ ChromeClientImpl* ToChromeClient(WebCore::Widget* widget) { ...@@ -93,122 +90,10 @@ ChromeClientImpl* ToChromeClient(WebCore::Widget* widget) {
return static_cast<ChromeClientImpl*>(page->chrome()->client()); return static_cast<ChromeClientImpl*>(page->chrome()->client());
} }
std::wstring UrlToImageMarkup(const WebCore::KURL& url,
const WebCore::String& alt_str) {
std::wstring markup(L"<img src=\"");
markup.append(webkit_glue::StringToStdWString(url.string()));
markup.append(L"\"");
if (!alt_str.isEmpty()) {
markup.append(L" alt=\"");
std::wstring alt_stdstr = webkit_glue::StringToStdWString(alt_str);
ReplaceSubstringsAfterOffset(&alt_stdstr, 0, L"\"", L"&quot;");
markup.append(alt_stdstr);
markup.append(L"\"");
}
markup.append(L"/>");
return markup;
}
} // namespace } // namespace
namespace WebCore { namespace WebCore {
bool ChromiumBridge::clipboardIsFormatAvailable(
PasteboardPrivate::ClipboardFormat format) {
switch (format) {
case PasteboardPrivate::HTMLFormat:
return webkit_glue::ClipboardIsFormatAvailable(
::Clipboard::GetHtmlFormatType());
case PasteboardPrivate::WebSmartPasteFormat:
return webkit_glue::ClipboardIsFormatAvailable(
::Clipboard::GetWebKitSmartPasteFormatType());
case PasteboardPrivate::BookmarkFormat:
#if defined(OS_WIN) || defined(OS_MACOSX)
return webkit_glue::ClipboardIsFormatAvailable(
::Clipboard::GetUrlWFormatType());
#endif
default:
NOTREACHED();
return false;
}
}
String ChromiumBridge::clipboardReadPlainText() {
if (webkit_glue::ClipboardIsFormatAvailable(
::Clipboard::GetPlainTextWFormatType())) {
std::wstring text;
webkit_glue::ClipboardReadText(&text);
if (!text.empty())
return webkit_glue::StdWStringToString(text);
}
if (webkit_glue::ClipboardIsFormatAvailable(
::Clipboard::GetPlainTextFormatType())) {
std::string text;
webkit_glue::ClipboardReadAsciiText(&text);
if (!text.empty())
return webkit_glue::StdStringToString(text);
}
return String();
}
void ChromiumBridge::clipboardReadHTML(String* html, KURL* url) {
std::wstring html_stdstr;
GURL gurl;
webkit_glue::ClipboardReadHTML(&html_stdstr, &gurl);
*html = webkit_glue::StdWStringToString(html_stdstr);
*url = webkit_glue::GURLToKURL(gurl);
}
void ChromiumBridge::clipboardWriteSelection(const String& html,
const KURL& url,
const String& plain_text,
bool can_smart_copy_or_delete) {
ScopedClipboardWriterGlue scw(webkit_glue::ClipboardGetClipboard());
scw.WriteHTML(webkit_glue::StringToStdWString(html),
#if USE(GOOGLEURL)
webkit_glue::CStringToStdString(url.utf8String()));
#else
webkit_glue::StringToStdString(url.string()));
#endif
scw.WriteText(webkit_glue::StringToStdWString(plain_text));
if (can_smart_copy_or_delete)
scw.WriteWebSmartPaste();
}
void ChromiumBridge::clipboardWriteURL(const KURL& url, const String& title) {
ScopedClipboardWriterGlue scw(webkit_glue::ClipboardGetClipboard());
GURL gurl = webkit_glue::KURLToGURL(url);
scw.WriteBookmark(webkit_glue::StringToStdWString(title), gurl.spec());
std::wstring link(webkit_glue::StringToStdWString(urlToMarkup(url, title)));
scw.WriteHTML(link, "");
scw.WriteText(ASCIIToWide(gurl.spec()));
}
void ChromiumBridge::clipboardWriteImage(const NativeImageSkia* bitmap,
const KURL& url, const String& title) {
ScopedClipboardWriterGlue scw(webkit_glue::ClipboardGetClipboard());
#if defined(OS_WIN)
if (bitmap)
scw.WriteBitmap(*bitmap);
#endif
if (!url.isEmpty()) {
GURL gurl = webkit_glue::KURLToGURL(url);
scw.WriteBookmark(webkit_glue::StringToStdWString(title), gurl.spec());
scw.WriteHTML(UrlToImageMarkup(url, title), "");
scw.WriteText(ASCIIToWide(gurl.spec()));
}
}
// Cookies -------------------------------------------------------------------- // Cookies --------------------------------------------------------------------
void ChromiumBridge::setCookies( void ChromiumBridge::setCookies(
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<Configuration <Configuration
Name="Debug|Win32" Name="Debug|Win32"
ConfigurationType="4" ConfigurationType="4"
InheritedPropertySheets="$(SolutionDir)..\build\debug.vsprops;.\glue.vsprops" InheritedPropertySheets="$(SolutionDir)..\build\debug.vsprops;.\glue.vsprops;..\build\WebKit\using_WebKit.vsprops"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
ConfigurationType="4" ConfigurationType="4"
InheritedPropertySheets="$(SolutionDir)..\build\release.vsprops;.\glue.vsprops" InheritedPropertySheets="$(SolutionDir)..\build\release.vsprops;.\glue.vsprops;..\build\WebKit\using_WebKit.vsprops"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
...@@ -532,6 +532,14 @@ ...@@ -532,6 +532,14 @@
RelativePath=".\stacking_order_iterator.h" RelativePath=".\stacking_order_iterator.h"
> >
</File> </File>
<File
RelativePath=".\webclipboard_impl.cc"
>
</File>
<File
RelativePath=".\webclipboard_impl.h"
>
</File>
<File <File
RelativePath=".\webcursor.cc" RelativePath=".\webcursor.cc"
> >
...@@ -604,6 +612,14 @@ ...@@ -604,6 +612,14 @@
RelativePath=".\webinputevent_win.cc" RelativePath=".\webinputevent_win.cc"
> >
</File> </File>
<File
RelativePath=".\webkit_client_impl.cc"
>
</File>
<File
RelativePath=".\webkit_client_impl.h"
>
</File>
<File <File
RelativePath=".\webkit_glue.cc" RelativePath=".\webkit_glue.cc"
> >
......
...@@ -23,7 +23,7 @@ class ScopedClipboardWriterGlue : public ScopedClipboardWriter { ...@@ -23,7 +23,7 @@ class ScopedClipboardWriterGlue : public ScopedClipboardWriter {
~ScopedClipboardWriterGlue(); ~ScopedClipboardWriterGlue();
#if defined(OS_WIN) #if defined(OS_WIN)
void ScopedClipboardWriterGlue::WriteBitmap(const SkBitmap& bitmap); void WriteBitmapFromPixels(const void* pixels, const gfx::Size& size);
#endif #endif
private: private:
......
...@@ -15,14 +15,10 @@ ...@@ -15,14 +15,10 @@
// Clipboard glue // Clipboard glue
#if defined(OS_WIN) void ScopedClipboardWriterGlue::WriteBitmapFromPixels(
// The call is being made within the current process. const void* pixels, const gfx::Size& size) {
void ScopedClipboardWriterGlue::WriteBitmap(const SkBitmap& bitmap) { ScopedClipboardWriter::WriteBitmapFromPixels(pixels, size);
SkAutoLockPixels bitmap_lock(bitmap);
WriteBitmapFromPixels(bitmap.getPixels(), gfx::Size(bitmap.width(),
bitmap.height()));
} }
#endif // defined(OS_WIN)
ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() { ScopedClipboardWriterGlue::~ScopedClipboardWriterGlue() {
} }
......
// Copyright (c) 2009 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 "webkit/glue/webclipboard_impl.h"
#include "WebImage.h"
#include "WebString.h"
#include "WebURL.h"
#include "base/clipboard.h"
#include "base/logging.h"
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
#include "net/base/escape.h"
#include "webkit/glue/scoped_clipboard_writer_glue.h"
#include "webkit/glue/webkit_glue.h"
using WebKit::WebClipboard;
using WebKit::WebImage;
using WebKit::WebString;
using WebKit::WebURL;
namespace webkit_glue {
static std::string URLToMarkup(const WebURL& url, const WebString& title) {
std::string markup("<a href=\"");
markup.append(url.spec());
markup.append("\">");
// TODO(darin): HTML escape this
markup.append(EscapeForHTML(UTF16ToUTF8(title)));
markup.append("</a>");
return markup;
}
static std::string URLToImageMarkup(const WebURL& url,
const WebString& title) {
std::string markup("<img src=\"");
markup.append(url.spec());
markup.append("\"");
if (!title.isEmpty()) {
markup.append(" alt=\"");
markup.append(EscapeForHTML(UTF16ToUTF8(title)));
markup.append("\"");
}
markup.append("/>");
return markup;
}
bool WebClipboardImpl::isFormatAvailable(Format format) {
Clipboard::FormatType format_type;
switch (format) {
case FormatHTML:
format_type = Clipboard::GetHtmlFormatType();
break;
case FormatSmartPaste:
format_type = Clipboard::GetWebKitSmartPasteFormatType();
break;
case FormatBookmark:
#if defined(OS_WIN) || defined(OS_MACOSX)
format_type = Clipboard::GetUrlWFormatType();
break;
#endif
default:
NOTREACHED();
return false;
}
return ClipboardIsFormatAvailable(format_type);
}
WebString WebClipboardImpl::readPlainText() {
if (ClipboardIsFormatAvailable(Clipboard::GetPlainTextWFormatType())) {
std::wstring text;
ClipboardReadText(&text);
if (!text.empty())
return WideToUTF16(text);
}
if (ClipboardIsFormatAvailable(Clipboard::GetPlainTextFormatType())) {
std::string text;
ClipboardReadAsciiText(&text);
if (!text.empty())
return UTF8ToUTF16(text);
}
return WebString();
}
WebString WebClipboardImpl::readHTML(WebURL* source_url) {
std::wstring html_stdstr;
GURL gurl;
ClipboardReadHTML(&html_stdstr, &gurl);
*source_url = gurl;
return WideToUTF16(html_stdstr);
}
void WebClipboardImpl::writeHTML(
const WebString& html_text, const WebURL& source_url,
const WebString& plain_text, bool write_smart_paste) {
ScopedClipboardWriterGlue scw(ClipboardGetClipboard());
scw.WriteHTML(UTF16ToWide(html_text), source_url.spec());
scw.WriteText(UTF16ToWide(plain_text));
if (write_smart_paste)
scw.WriteWebSmartPaste();
}
void WebClipboardImpl::writeURL(const WebURL& url, const WebString& title) {
ScopedClipboardWriterGlue scw(ClipboardGetClipboard());
scw.WriteBookmark(UTF16ToWide(title), url.spec());
scw.WriteHTML(UTF8ToWide(URLToMarkup(url, title)), "");
scw.WriteText(UTF8ToWide(url.spec()));
}
void WebClipboardImpl::writeImage(
const WebImage& image, const WebURL& url, const WebString& title) {
ScopedClipboardWriterGlue scw(ClipboardGetClipboard());
#if defined(OS_WIN)
if (!image.isNull())
scw.WriteBitmapFromPixels(image.pixels(), image.size());
#endif
if (!url.isEmpty()) {
scw.WriteBookmark(UTF16ToWide(title), url.spec());
scw.WriteHTML(UTF8ToWide(URLToImageMarkup(url, title)), "");
scw.WriteText(UTF8ToWide(url.spec()));
}
}
} // namespace webkit_glue
// Copyright (c) 2009 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.
#ifndef WEBCLIPBOARD_IMPL_H_
#define WEBCLIPBOARD_IMPL_H_
#include "WebClipboard.h"
namespace webkit_glue {
class WebClipboardImpl : public WebKit::WebClipboard {
public:
// WebClipboard methods:
virtual bool isFormatAvailable(WebKit::WebClipboard::Format);
virtual WebKit::WebString readPlainText();
virtual WebKit::WebString readHTML(WebKit::WebURL* source_url);
virtual void writeHTML(
const WebKit::WebString& html_text,
const WebKit::WebURL& source_url,
const WebKit::WebString& plain_text,
bool write_smart_paste);
virtual void writeURL(
const WebKit::WebURL&,
const WebKit::WebString& title);
virtual void writeImage(
const WebKit::WebImage&,
const WebKit::WebURL& source_url,
const WebKit::WebString& title);
};
} // namespace webkit_glue
#endif // WEBCLIPBOARD_IMPL_H_
// Copyright (c) 2009 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 "webkit/glue/webkit_client_impl.h"
namespace webkit_glue {
WebKit::WebClipboard* WebKitClientImpl::clipboard() {
if (!clipboard_.get())
clipboard_.reset(new WebClipboardImpl());
return clipboard_.get();
}
} // namespace webkit_glue
// Copyright (c) 2009 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.
#ifndef WEBKIT_CLIENT_IMPL_H_
#define WEBKIT_CLIENT_IMPL_H_
#include "WebKitClient.h"
#include "base/scoped_ptr.h"
#include "webkit/glue/webclipboard_impl.h"
namespace webkit_glue {
class WebKitClientImpl : public WebKit::WebKitClient {
public:
// WebKitClient methods:
virtual WebKit::WebClipboard* clipboard();
private:
scoped_ptr<WebClipboardImpl> clipboard_;
};
} // namespace webkit_glue
#endif // WEBKIT_CLIENT_IMPL_H_
...@@ -82,10 +82,12 @@ ...@@ -82,10 +82,12 @@
82F39D400E7EFD9300785E15 /* libxml.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B82056C0E770291008F45CF /* libxml.a */; }; 82F39D400E7EFD9300785E15 /* libxml.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B82056C0E770291008F45CF /* libxml.a */; };
82F39D490E7EFDAA00785E15 /* libjscre.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B82059A0E770291008F45CF /* libjscre.a */; }; 82F39D490E7EFDAA00785E15 /* libjscre.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B82059A0E770291008F45CF /* libjscre.a */; };
82F39D4A0E7EFDAA00785E15 /* libv8.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B82059C0E770291008F45CF /* libv8.a */; }; 82F39D4A0E7EFDAA00785E15 /* libv8.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B82059C0E770291008F45CF /* libv8.a */; };
93336F0B0F55FBE50062E3BA /* libwebkit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 937DE8840F5347B400D0D638 /* libwebkit.a */; };
93AF4F340EFAFE2C0073C62D /* BMPImageDecoder_unittest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4F300EFAFE2C0073C62D /* BMPImageDecoder_unittest.cpp */; }; 93AF4F340EFAFE2C0073C62D /* BMPImageDecoder_unittest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4F300EFAFE2C0073C62D /* BMPImageDecoder_unittest.cpp */; };
93AF4F350EFAFE2C0073C62D /* GKURL_unittest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4F310EFAFE2C0073C62D /* GKURL_unittest.cpp */; }; 93AF4F350EFAFE2C0073C62D /* GKURL_unittest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4F310EFAFE2C0073C62D /* GKURL_unittest.cpp */; };
93AF4F360EFAFE2C0073C62D /* ICOImageDecoder_unittest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4F320EFAFE2C0073C62D /* ICOImageDecoder_unittest.cpp */; }; 93AF4F360EFAFE2C0073C62D /* ICOImageDecoder_unittest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4F320EFAFE2C0073C62D /* ICOImageDecoder_unittest.cpp */; };
93AF4F370EFAFE2C0073C62D /* XBMImageDecoder_unittest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4F330EFAFE2C0073C62D /* XBMImageDecoder_unittest.cpp */; }; 93AF4F370EFAFE2C0073C62D /* XBMImageDecoder_unittest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4F330EFAFE2C0073C62D /* XBMImageDecoder_unittest.cpp */; };
93FB428B0F55E8DD00AA1185 /* libwebkit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 937DE8840F5347B400D0D638 /* libwebkit.a */; };
AB19AC150F1BBBD000673E20 /* test_shell_main.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB19AC140F1BBBD000673E20 /* test_shell_main.cc */; }; AB19AC150F1BBBD000673E20 /* test_shell_main.cc in Sources */ = {isa = PBXBuildFile; fileRef = AB19AC140F1BBBD000673E20 /* test_shell_main.cc */; };
AB19AC290F1BD6C900673E20 /* test_shell_platform_delegate_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB19AC280F1BD6C900673E20 /* test_shell_platform_delegate_mac.mm */; }; AB19AC290F1BD6C900673E20 /* test_shell_platform_delegate_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = AB19AC280F1BD6C900673E20 /* test_shell_platform_delegate_mac.mm */; };
AB19AD380F1D0AF200673E20 /* test_shell_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABA9CAE90DBC521D00CB1EFB /* test_shell_mac.mm */; }; AB19AD380F1D0AF200673E20 /* test_shell_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABA9CAE90DBC521D00CB1EFB /* test_shell_mac.mm */; };
...@@ -874,6 +876,7 @@ ...@@ -874,6 +876,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
93336F0B0F55FBE50062E3BA /* libwebkit.a in Frameworks */,
E45069C40EF016C6003BE099 /* AppKit.framework in Frameworks */, E45069C40EF016C6003BE099 /* AppKit.framework in Frameworks */,
E45069C50EF016C6003BE099 /* ApplicationServices.framework in Frameworks */, E45069C50EF016C6003BE099 /* ApplicationServices.framework in Frameworks */,
E45069C60EF016C6003BE099 /* Carbon.framework in Frameworks */, E45069C60EF016C6003BE099 /* Carbon.framework in Frameworks */,
...@@ -916,6 +919,7 @@ ...@@ -916,6 +919,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
93FB428B0F55E8DD00AA1185 /* libwebkit.a in Frameworks */,
E45629300E26B4FE005E4685 /* AppKit.framework in Frameworks */, E45629300E26B4FE005E4685 /* AppKit.framework in Frameworks */,
E45629270E26B4FE005E4685 /* ApplicationServices.framework in Frameworks */, E45629270E26B4FE005E4685 /* ApplicationServices.framework in Frameworks */,
E456292C0E26B4FE005E4685 /* Carbon.framework in Frameworks */, E456292C0E26B4FE005E4685 /* Carbon.framework in Frameworks */,
...@@ -2285,6 +2289,7 @@ ...@@ -2285,6 +2289,7 @@
../../../../third_party/WebKit/WebCore/rendering, ../../../../third_party/WebKit/WebCore/rendering,
../../../../third_party/WebKit/WebCore/rendering/style, ../../../../third_party/WebKit/WebCore/rendering/style,
../../../../third_party/WebKit/WebCore/svg, ../../../../third_party/WebKit/WebCore/svg,
../../../../third_party/WebKit/WebKit/chromium/public,
../../../../third_party/WebKit/WebKit/mac/WebCoreSupport, ../../../../third_party/WebKit/WebKit/mac/WebCoreSupport,
../../../../v8/include, ../../../../v8/include,
../../../../webkit/port/platform, ../../../../webkit/port/platform,
...@@ -2351,6 +2356,7 @@ ...@@ -2351,6 +2356,7 @@
../../../../third_party/WebKit/WebCore/rendering, ../../../../third_party/WebKit/WebCore/rendering,
../../../../third_party/WebKit/WebCore/rendering/style, ../../../../third_party/WebKit/WebCore/rendering/style,
../../../../third_party/WebKit/WebCore/svg, ../../../../third_party/WebKit/WebCore/svg,
../../../../third_party/WebKit/WebKit/chromium/public,
../../../../third_party/WebKit/WebKit/mac/WebCoreSupport, ../../../../third_party/WebKit/WebKit/mac/WebCoreSupport,
../../../../v8/include, ../../../../v8/include,
../../../../webkit/port/platform, ../../../../webkit/port/platform,
...@@ -2412,6 +2418,7 @@ ...@@ -2412,6 +2418,7 @@
../../../../third_party/WebKit/WebCore/dom, ../../../../third_party/WebKit/WebCore/dom,
../../../../third_party/WebKit/WebCore/page, ../../../../third_party/WebKit/WebCore/page,
../../../../third_party/WebKit/WebCore, ../../../../third_party/WebKit/WebCore,
../../../../third_party/WebKit/WebKit/chromium/public,
../../../../third_party/WebKit/WebKit/mac/WebCoreSupport, ../../../../third_party/WebKit/WebKit/mac/WebCoreSupport,
"$(SYMROOT)/webkit.build/$(CONFIGURATION)/generated/WebCore/v8", "$(SYMROOT)/webkit.build/$(CONFIGURATION)/generated/WebCore/v8",
"$(SYMROOT)/webkit.build/$(CONFIGURATION)/generated/grit", "$(SYMROOT)/webkit.build/$(CONFIGURATION)/generated/grit",
...@@ -2455,6 +2462,7 @@ ...@@ -2455,6 +2462,7 @@
../../../../third_party/WebKit/WebCore/dom, ../../../../third_party/WebKit/WebCore/dom,
../../../../third_party/WebKit/WebCore/page, ../../../../third_party/WebKit/WebCore/page,
../../../../third_party/WebKit/WebCore, ../../../../third_party/WebKit/WebCore,
../../../../third_party/WebKit/WebKit/chromium/public,
../../../../third_party/WebKit/WebKit/mac/WebCoreSupport, ../../../../third_party/WebKit/WebKit/mac/WebCoreSupport,
"$(SYMROOT)/webkit.build/$(CONFIGURATION)/generated/WebCore/v8", "$(SYMROOT)/webkit.build/$(CONFIGURATION)/generated/WebCore/v8",
"$(SYMROOT)/webkit.build/$(CONFIGURATION)/generated/grit", "$(SYMROOT)/webkit.build/$(CONFIGURATION)/generated/grit",
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<Configuration <Configuration
Name="Debug|Win32" Name="Debug|Win32"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(SolutionDir)..\build\debug.vsprops;.\test_shell.vsprops;$(SolutionDir)..\testing\using_gtest.vsprops" InheritedPropertySheets="$(SolutionDir)..\build\debug.vsprops;.\test_shell.vsprops;$(SolutionDir)..\testing\using_gtest.vsprops;..\..\build\WebKit\using_WebKit.vsprops"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(SolutionDir)..\build\release.vsprops;.\test_shell.vsprops;$(SolutionDir)..\testing\using_gtest.vsprops" InheritedPropertySheets="$(SolutionDir)..\build\release.vsprops;.\test_shell.vsprops;$(SolutionDir)..\testing\using_gtest.vsprops;..\..\build\WebKit\using_WebKit.vsprops"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "net/http/http_cache.h" #include "net/http/http_cache.h"
#include "net/base/ssl_test_util.h" #include "net/base/ssl_test_util.h"
#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context.h"
#include "webkit/glue/webkit_client_impl.h"
#include "webkit/glue/webkit_glue.h" #include "webkit/glue/webkit_glue.h"
#include "webkit/glue/window_open_disposition.h" #include "webkit/glue/window_open_disposition.h"
#include "webkit/tools/test_shell/simple_resource_loader_bridge.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
...@@ -33,6 +34,8 @@ ...@@ -33,6 +34,8 @@
#include "webkit/tools/test_shell/test_shell_request_context.h" #include "webkit/tools/test_shell/test_shell_request_context.h"
#include "webkit/tools/test_shell/test_shell_switches.h" #include "webkit/tools/test_shell/test_shell_switches.h"
#include "WebKit.h"
#include <iostream> #include <iostream>
using namespace std; using namespace std;
...@@ -85,6 +88,9 @@ int main(int argc, char* argv[]) { ...@@ -85,6 +88,9 @@ int main(int argc, char* argv[]) {
layout_test_mode, layout_test_mode,
enable_gp_fault_error_box); enable_gp_fault_error_box);
webkit_glue::WebKitClientImpl webkit_client_impl;
WebKit::initialize(&webkit_client_impl);
// Set this early before we start using WebCore. // Set this early before we start using WebCore.
webkit_glue::SetLayoutTestMode(layout_test_mode); webkit_glue::SetLayoutTestMode(layout_test_mode);
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<Configuration <Configuration
Name="Debug|Win32" Name="Debug|Win32"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(SolutionDir)..\build\debug.vsprops;.\test_shell_tests.vsprops;$(SolutionDir)..\testing\using_gtest.vsprops" InheritedPropertySheets="$(SolutionDir)..\build\debug.vsprops;.\test_shell_tests.vsprops;$(SolutionDir)..\testing\using_gtest.vsprops;..\..\build\WebKit\using_WebKit.vsprops"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="$(SolutionDir)..\build\release.vsprops;.\test_shell_tests.vsprops;$(SolutionDir)..\testing\using_gtest.vsprops" InheritedPropertySheets="$(SolutionDir)..\build\release.vsprops;.\test_shell_tests.vsprops;$(SolutionDir)..\testing\using_gtest.vsprops;..\..\build\WebKit\using_WebKit.vsprops"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
...@@ -194,10 +194,10 @@ ...@@ -194,10 +194,10 @@
RelativePath=".\run_all_tests.cc" RelativePath=".\run_all_tests.cc"
> >
</File> </File>
<File <File
RelativePath="..\..\glue\simple_clipboard_impl.cc" RelativePath="..\..\glue\simple_clipboard_impl.cc"
> >
</File> </File>
<File <File
RelativePath=".\simple_resource_loader_bridge.cc" RelativePath=".\simple_resource_loader_bridge.cc"
> >
...@@ -230,14 +230,14 @@ ...@@ -230,14 +230,14 @@
RelativePath=".\resources\test_shell.rc" RelativePath=".\resources\test_shell.rc"
> >
</File> </File>
<File <File
RelativePath=".\test_shell_platform_delegate.h" RelativePath=".\test_shell_platform_delegate.h"
> >
</File> </File>
<File <File
RelativePath=".\test_shell_platform_delegate_win.cc" RelativePath=".\test_shell_platform_delegate_win.cc"
> >
</File> </File>
<File <File
RelativePath=".\test_shell_request_context.cc" RelativePath=".\test_shell_request_context.cc"
> >
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment