mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
libcef: Update due to underlying chromium changes.
- Fix problem displaying select lists due to ordering of focus events in WebWidgetHost::MouseEvent() (issue #17). - Add new BrowserWebKitInit class and related webkit_glue changes. - Add webkit_glue::InitializeTextEncoding() function called from the main thread in CefContext::Initialize() to avoid an assert in third_party\WebKit\WebCore\platform\text\TextEncodingRegistry.cpp buildBaseTextCodecMaps(). - V8NPObject::v8_object member renamed to V8NPObject::v8Object. - Add WebKit project dependency. libcef_dll: - Fix crash when creating a popup window due to not duplicating the m_windowName member in cpptoc\handler_cpptoc.cc handler_handle_before_created(). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@17 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -167,6 +167,7 @@ void CefBrowserImpl::ExecuteJavaScript(const std::wstring& jsCode,
|
||||
bool CefBrowserImpl::AddJSHandler(const std::wstring& classname,
|
||||
CefRefPtr<CefJSHandler> handler)
|
||||
{
|
||||
DCHECK(handler.get());
|
||||
bool rv = false;
|
||||
|
||||
Lock();
|
||||
|
@@ -46,6 +46,7 @@
|
||||
#include "net/base/io_buffer.h"
|
||||
#include "net/base/net_util.h"
|
||||
#include "net/base/upload_data.h"
|
||||
#include "net/http/http_response_headers.h"
|
||||
#include "net/proxy/proxy_service.h"
|
||||
#include "net/url_request/url_request.h"
|
||||
#include "webkit/glue/resource_loader_bridge.h"
|
||||
@@ -601,36 +602,6 @@ ResourceLoaderBridge* ResourceLoaderBridge::Create(
|
||||
method, url, policy_url, referrer, headers, load_flags);
|
||||
}
|
||||
|
||||
void SetCookie(const GURL& url, const GURL& policy_url,
|
||||
const std::string& cookie) {
|
||||
// Proxy to IO thread to synchronize w/ network loading.
|
||||
|
||||
if (!EnsureIOThread()) {
|
||||
NOTREACHED();
|
||||
return;
|
||||
}
|
||||
|
||||
scoped_refptr<CookieSetter> cookie_setter = new CookieSetter();
|
||||
io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
|
||||
cookie_setter.get(), &CookieSetter::Set, url, cookie));
|
||||
}
|
||||
|
||||
std::string GetCookies(const GURL& url, const GURL& policy_url) {
|
||||
// Proxy to IO thread to synchronize w/ network loading
|
||||
|
||||
if (!EnsureIOThread()) {
|
||||
NOTREACHED();
|
||||
return std::string();
|
||||
}
|
||||
|
||||
scoped_refptr<CookieGetter> getter = new CookieGetter();
|
||||
|
||||
io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
|
||||
getter.get(), &CookieGetter::Get, url));
|
||||
|
||||
return getter->GetResult();
|
||||
}
|
||||
|
||||
// Issue the proxy resolve request on the io thread, and wait
|
||||
// for the result.
|
||||
bool FindProxyForUrl(const GURL& url, std::string* proxy_list) {
|
||||
@@ -643,12 +614,21 @@ bool FindProxyForUrl(const GURL& url, std::string* proxy_list) {
|
||||
net::ProxyInfo proxy_info;
|
||||
int rv = sync_proxy_service->ResolveProxy(url, &proxy_info);
|
||||
if (rv == net::OK) {
|
||||
*proxy_list = proxy_info.GetAnnotatedProxyList();
|
||||
*proxy_list = proxy_info.ToPacString();
|
||||
}
|
||||
|
||||
return rv == net::OK;
|
||||
}
|
||||
|
||||
void SetCookie(const GURL& url, const GURL& policy_url,
|
||||
const std::string& cookie) {
|
||||
BrowserResourceLoaderBridge::SetCookie(url, policy_url, cookie);
|
||||
}
|
||||
|
||||
std::string GetCookies(const GURL& url, const GURL& policy_url) {
|
||||
return BrowserResourceLoaderBridge::GetCookies(url, policy_url);
|
||||
}
|
||||
|
||||
} // namespace webkit_glue
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -676,3 +656,34 @@ void BrowserResourceLoaderBridge::Shutdown() {
|
||||
DCHECK(!request_context) << "should have been nulled by thread dtor";
|
||||
}
|
||||
}
|
||||
|
||||
void BrowserResourceLoaderBridge::SetCookie(
|
||||
const GURL& url, const GURL& policy_url, const std::string& cookie) {
|
||||
// Proxy to IO thread to synchronize w/ network loading.
|
||||
|
||||
if (!EnsureIOThread()) {
|
||||
NOTREACHED();
|
||||
return;
|
||||
}
|
||||
|
||||
scoped_refptr<CookieSetter> cookie_setter = new CookieSetter();
|
||||
io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
|
||||
cookie_setter.get(), &CookieSetter::Set, url, cookie));
|
||||
}
|
||||
|
||||
std::string BrowserResourceLoaderBridge::GetCookies(
|
||||
const GURL& url, const GURL& policy_url) {
|
||||
// Proxy to IO thread to synchronize w/ network loading
|
||||
|
||||
if (!EnsureIOThread()) {
|
||||
NOTREACHED();
|
||||
return std::string();
|
||||
}
|
||||
|
||||
scoped_refptr<CookieGetter> getter = new CookieGetter();
|
||||
|
||||
io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
|
||||
getter.get(), &CookieGetter::Get, url));
|
||||
|
||||
return getter->GetResult();
|
||||
}
|
||||
|
@@ -6,8 +6,9 @@
|
||||
#ifndef _BROWSER_RESOURCE_LOADER_BRIDGE_H
|
||||
#define _BROWSER_RESOURCE_LOADER_BRIDGE_H
|
||||
|
||||
#include "base/ref_counted.h"
|
||||
#include <string>
|
||||
|
||||
class GURL;
|
||||
class URLRequestContext;
|
||||
|
||||
class BrowserResourceLoaderBridge {
|
||||
@@ -26,6 +27,12 @@ class BrowserResourceLoaderBridge {
|
||||
|
||||
// Call this function to shutdown the simple resource loader bridge.
|
||||
static void Shutdown();
|
||||
|
||||
// May only be called after Init.
|
||||
static void SetCookie(
|
||||
const GURL& url, const GURL& policy_url, const std::string& cookie);
|
||||
static std::string GetCookies(
|
||||
const GURL& url, const GURL& policy_url);
|
||||
};
|
||||
|
||||
#endif // _BROWSER_RESOURCE_LOADER_BRIDGE_H
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#include "webkit_version.h"
|
||||
MSVC_PUSH_WARNING_LEVEL(0);
|
||||
#include "Markup.h"
|
||||
#include "TextEncoding.h"
|
||||
#include "webkit/glue/webframe_impl.h"
|
||||
MSVC_POP_WARNING();
|
||||
|
||||
@@ -22,11 +23,12 @@ MSVC_POP_WARNING();
|
||||
#include "base/win_util.h"
|
||||
#include "net/base/mime_util.h"
|
||||
#include "webkit/glue/glue_util.h"
|
||||
#include "webkit/glue/screen_info.h"
|
||||
#include "webkit/glue/webframe.h"
|
||||
#include "webkit/glue/webkit_glue.h"
|
||||
|
||||
// Generated by GRIT
|
||||
#include "webkit_resources.h"
|
||||
#include "grit/webkit_resources.h"
|
||||
|
||||
namespace webkit_glue {
|
||||
|
||||
@@ -34,28 +36,12 @@ bool IsMediaPlayerAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void PrefetchDns(const std::string& hostname) {}
|
||||
|
||||
void PrecacheUrl(const char16* url, int url_length) {}
|
||||
|
||||
void AppendToLog(const char* file, int line, const char* msg) {
|
||||
logging::LogMessage(file, line).stream() << msg;
|
||||
}
|
||||
|
||||
bool GetMimeTypeFromExtension(const std::wstring &ext, std::string *mime_type) {
|
||||
return net::GetMimeTypeFromExtension(ext, mime_type);
|
||||
}
|
||||
|
||||
bool GetMimeTypeFromFile(const std::wstring &file_path,
|
||||
std::string *mime_type) {
|
||||
return net::GetMimeTypeFromFile(file_path, mime_type);
|
||||
}
|
||||
|
||||
bool GetPreferredExtensionForMimeType(const std::string& mime_type,
|
||||
std::wstring* ext) {
|
||||
return net::GetPreferredExtensionForMimeType(mime_type, ext);
|
||||
}
|
||||
|
||||
std::string GetDataResource(int resource_id) {
|
||||
if (resource_id == IDR_BROKENIMAGE) {
|
||||
// Use webkit's broken image icon (16x16)
|
||||
@@ -176,4 +162,8 @@ ScreenInfo GetScreenInfo(gfx::NativeViewId window) {
|
||||
return GetScreenInfoHelper(gfx::NativeViewFromId(window));
|
||||
}
|
||||
|
||||
void InitializeTextEncoding() {
|
||||
WebCore::UTF8Encoding();
|
||||
}
|
||||
|
||||
} // namespace webkit_glue
|
||||
|
@@ -21,4 +21,7 @@ void CaptureWebViewBitmap(HWND mainWnd, WebView* webview, HBITMAP& bitmap,
|
||||
BOOL SaveBitmapToFile(HBITMAP hBmp, HDC hDC, LPCTSTR file, LPBYTE lpBits);
|
||||
#endif
|
||||
|
||||
// Text encoding objects must be initialized on the main thread.
|
||||
void InitializeTextEncoding();
|
||||
|
||||
} // namespace webkit_glue
|
||||
|
58
libcef/browser_webkit_init.h
Normal file
58
libcef/browser_webkit_init.h
Normal file
@@ -0,0 +1,58 @@
|
||||
// Copyright (c) 2009 The Chromium Embedded Framework Authors.
|
||||
// Portions 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 _BROWSER_WEBKIT_INIT_H
|
||||
#define _BROWSER_WEBKIT_INIT_H
|
||||
|
||||
#include "base/string_util.h"
|
||||
#include "webkit/glue/simple_webmimeregistry_impl.h"
|
||||
#include "webkit/glue/webkit_glue.h"
|
||||
#include "webkit/glue/webkitclient_impl.h"
|
||||
#include "browser_resource_loader_bridge.h"
|
||||
|
||||
#include "WebKit.h"
|
||||
#include "WebString.h"
|
||||
#include "WebURL.h"
|
||||
|
||||
class BrowserWebKitInit : public webkit_glue::WebKitClientImpl {
|
||||
public:
|
||||
BrowserWebKitInit() {
|
||||
WebKit::initialize(this);
|
||||
WebKit::setLayoutTestMode(false);
|
||||
WebKit::registerURLSchemeAsLocal(
|
||||
ASCIIToUTF16(webkit_glue::GetUIResourceProtocol()));
|
||||
}
|
||||
|
||||
~BrowserWebKitInit() {
|
||||
WebKit::shutdown();
|
||||
}
|
||||
|
||||
virtual WebKit::WebMimeRegistry* mimeRegistry() {
|
||||
return &mime_registry_;
|
||||
}
|
||||
|
||||
virtual void setCookies(
|
||||
const WebKit::WebURL& url, const WebKit::WebURL& policy_url,
|
||||
const WebKit::WebString& value) {
|
||||
BrowserResourceLoaderBridge::SetCookie(url, policy_url, UTF16ToUTF8(value));
|
||||
}
|
||||
|
||||
virtual WebKit::WebString cookies(
|
||||
const WebKit::WebURL& url, const WebKit::WebURL& policy_url) {
|
||||
return UTF8ToUTF16(BrowserResourceLoaderBridge::GetCookies(url, policy_url));
|
||||
}
|
||||
|
||||
virtual void prefetchHostName(const WebKit::WebString&) {
|
||||
}
|
||||
|
||||
virtual WebKit::WebString defaultLocale() {
|
||||
return ASCIIToUTF16("en-US");
|
||||
}
|
||||
|
||||
private:
|
||||
webkit_glue::SimpleWebMimeRegistryImpl mime_registry_;
|
||||
};
|
||||
|
||||
#endif // _BROWSER_WEBKIT_INIT_H
|
@@ -8,6 +8,7 @@
|
||||
#include "browser_impl.h"
|
||||
#include "browser_resource_loader_bridge.h"
|
||||
#include "browser_request_context.h"
|
||||
#include "browser_webkit_glue.h"
|
||||
#include "../include/cef_nplugin.h"
|
||||
|
||||
#include "base/command_line.h"
|
||||
@@ -298,6 +299,9 @@ bool CefContext::Initialize(bool multi_threaded_message_loop)
|
||||
};
|
||||
RegisterClassEx(&wcex);
|
||||
|
||||
// Initialize WebKit encodings
|
||||
webkit_glue::InitializeTextEncoding();
|
||||
|
||||
// Initialize web preferences
|
||||
webprefs_ = new WebPreferences;
|
||||
*webprefs_ = WebPreferences();
|
||||
|
@@ -10,7 +10,8 @@
|
||||
#include "base/at_exit.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/gfx/native_widget_types.h"
|
||||
#include "webkit/glue/webpreferences.h"
|
||||
#include "webkit/glue/webpreferences.h"
|
||||
#include "browser_webkit_init.h"
|
||||
|
||||
class CefBrowserImpl;
|
||||
|
||||
@@ -68,8 +69,10 @@ protected:
|
||||
WebPreferences* webprefs_;
|
||||
StatsTable* statstable_;
|
||||
|
||||
// Instantiate the AtExitManager to avoid asserts and possible memory leaks.
|
||||
// Initialize the AtExitManager to avoid asserts and possible memory leaks.
|
||||
base::AtExitManager at_exit_manager_;
|
||||
// Initialize WebKit for this scope.
|
||||
BrowserWebKitInit webkit_init_;
|
||||
|
||||
friend DWORD WINAPI ThreadHandlerUI(LPVOID lpParam);
|
||||
};
|
||||
|
@@ -299,6 +299,10 @@
|
||||
RelativePath=".\browser_webkit_glue_win.cc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\browser_webkit_init.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\browser_webview_delegate.cc"
|
||||
>
|
||||
|
@@ -3,6 +3,6 @@
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="webkit_common"
|
||||
InheritedPropertySheets=".\libcef_webkit_includes.vsprops;$(SolutionDir)..\webkit\build\webkit_common_defines.vsprops;$(SolutionDir)..\webkit\build\js_engine$(JS_ENGINE_TYPE).vsprops;$(SolutionDir)..\third_party\npapi\using_npapi.vsprops;$(SolutionDir)..\skia\using_skia.vsprops;$(SolutionDir)..\build\external_code.vsprops;$(SolutionDir)..\third_party\icu38\build\using_icu.vsprops"
|
||||
InheritedPropertySheets=".\libcef_webkit_includes.vsprops;$(SolutionDir)..\webkit\build\webkit_common_defines.vsprops;$(SolutionDir)..\webkit\build\js_engine$(JS_ENGINE_TYPE).vsprops;$(SolutionDir)..\third_party\npapi\using_npapi.vsprops;$(SolutionDir)..\skia\using_skia.vsprops;$(SolutionDir)..\build\external_code.vsprops;$(SolutionDir)..\third_party\icu38\build\using_icu.vsprops;$(SolutionDir)..\webkit\build\webkit\using_WebKit.vsprops"
|
||||
>
|
||||
</VisualStudioPropertySheet>
|
||||
|
@@ -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\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";"
|
||||
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\bindings\v8";"$(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>
|
||||
|
@@ -79,10 +79,10 @@ bool _NPN_ArrayObjectToStringVector(NPObject* npobject,
|
||||
return false;
|
||||
|
||||
V8NPObject *object = reinterpret_cast<V8NPObject*>(npobject);
|
||||
if (!object->v8_object->IsArray())
|
||||
if (!object->v8Object->IsArray())
|
||||
return false;
|
||||
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8_object);
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8Object);
|
||||
for (uint32_t i = 0; i < array->Length(); i++) {
|
||||
v8::Local<v8::Value> value = array->Get(v8::Integer::New(i));
|
||||
v8::Local<v8::String> sval = value->ToString();
|
||||
@@ -102,10 +102,10 @@ bool _NPN_ArrayObjectToWStringVector(NPObject* npobject,
|
||||
return false;
|
||||
|
||||
V8NPObject *object = reinterpret_cast<V8NPObject*>(npobject);
|
||||
if (!object->v8_object->IsArray())
|
||||
if (!object->v8Object->IsArray())
|
||||
return false;
|
||||
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8_object);
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8Object);
|
||||
for (uint32_t i = 0; i < array->Length(); i++) {
|
||||
v8::Local<v8::Value> value = array->Get(v8::Integer::New(i));
|
||||
v8::Local<v8::String> sval = value->ToString();
|
||||
@@ -125,10 +125,10 @@ bool _NPN_ArrayObjectToIntVector(NPObject* npobject,
|
||||
return false;
|
||||
|
||||
V8NPObject *object = reinterpret_cast<V8NPObject*>(npobject);
|
||||
if (!object->v8_object->IsArray())
|
||||
if (!object->v8Object->IsArray())
|
||||
return false;
|
||||
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8_object);
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8Object);
|
||||
for (uint32_t i = 0; i < array->Length(); i++) {
|
||||
v8::Local<v8::Value> value = array->Get(v8::Integer::New(i));
|
||||
v8::Local<v8::Int32> ival = value->ToInt32();
|
||||
@@ -144,10 +144,10 @@ bool _NPN_ArrayObjectToDoubleVector(NPObject* npobject,
|
||||
return false;
|
||||
|
||||
V8NPObject *object = reinterpret_cast<V8NPObject*>(npobject);
|
||||
if (!object->v8_object->IsArray())
|
||||
if (!object->v8Object->IsArray())
|
||||
return false;
|
||||
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8_object);
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8Object);
|
||||
for (uint32_t i = 0; i < array->Length(); i++) {
|
||||
v8::Local<v8::Value> value = array->Get(v8::Integer::New(i));
|
||||
v8::Local<v8::Number> dval = value->ToNumber();
|
||||
@@ -163,10 +163,10 @@ bool _NPN_ArrayObjectToBooleanVector(NPObject* npobject,
|
||||
return false;
|
||||
|
||||
V8NPObject *object = reinterpret_cast<V8NPObject*>(npobject);
|
||||
if (!object->v8_object->IsArray())
|
||||
if (!object->v8Object->IsArray())
|
||||
return false;
|
||||
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8_object);
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8Object);
|
||||
for (uint32_t i = 0; i < array->Length(); i++) {
|
||||
v8::Local<v8::Value> value = array->Get(v8::Integer::New(i));
|
||||
v8::Local<v8::Boolean> bval = value->ToBoolean();
|
||||
@@ -182,10 +182,10 @@ int _NPN_ArrayObjectGetVectorSize(NPObject* npobject)
|
||||
return -1;
|
||||
|
||||
V8NPObject *object = reinterpret_cast<V8NPObject*>(npobject);
|
||||
if (!object->v8_object->IsArray())
|
||||
if (!object->v8Object->IsArray())
|
||||
return -1;
|
||||
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8_object);
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8Object);
|
||||
return array->Length();
|
||||
}
|
||||
|
||||
@@ -196,10 +196,10 @@ bool _NPN_ArrayObjectToVectorTypeHint(NPObject* npobject,
|
||||
return false;
|
||||
|
||||
V8NPObject *object = reinterpret_cast<V8NPObject*>(npobject);
|
||||
if (!object->v8_object->IsArray())
|
||||
if (!object->v8Object->IsArray())
|
||||
return false;
|
||||
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8_object);
|
||||
v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(object->v8Object);
|
||||
if (array->Length() == 0)
|
||||
return false;
|
||||
|
||||
|
@@ -144,7 +144,11 @@ void WebWidgetHost::DidInvalidateRect(const gfx::Rect& damaged_rect) {
|
||||
}
|
||||
|
||||
void WebWidgetHost::DidScrollRect(int dx, int dy, const gfx::Rect& clip_rect) {
|
||||
DCHECK(dx || dy);
|
||||
if (dx != 0 && dy != 0) {
|
||||
// We only support uni-directional scroll
|
||||
DidScrollRect(0, dy, clip_rect);
|
||||
dy = 0;
|
||||
}
|
||||
|
||||
// If we already have a pending scroll operation or if this scroll operation
|
||||
// intersects the existing paint region, then just failover to invalidating.
|
||||
@@ -188,7 +192,6 @@ WebWidgetHost::~WebWidgetHost() {
|
||||
TrackMouseLeave(false);
|
||||
|
||||
webwidget_->Close();
|
||||
webwidget_->Release();
|
||||
}
|
||||
|
||||
bool WebWidgetHost::WndProc(UINT message, WPARAM wparam, LPARAM lparam) {
|
||||
@@ -282,6 +285,11 @@ void WebWidgetHost::MouseEvent(UINT message, WPARAM wparam, LPARAM lparam) {
|
||||
break;
|
||||
case WebInputEvent::MOUSE_DOWN:
|
||||
SetCapture(view_);
|
||||
// This mimics a temporary workaround in RenderWidgetHostViewWin
|
||||
// for bug 765011 to get focus when the mouse is clicked. This
|
||||
// happens after the mouse down event is sent to the renderer
|
||||
// because normally Windows does a WM_SETFOCUS after WM_LBUTTONDOWN.
|
||||
::SetFocus(view_);
|
||||
break;
|
||||
case WebInputEvent::MOUSE_UP:
|
||||
if (GetCapture() == view_)
|
||||
@@ -289,14 +297,6 @@ void WebWidgetHost::MouseEvent(UINT message, WPARAM wparam, LPARAM lparam) {
|
||||
break;
|
||||
}
|
||||
webwidget_->HandleInputEvent(&event);
|
||||
|
||||
if (event.type == WebInputEvent::MOUSE_DOWN) {
|
||||
// This mimics a temporary workaround in RenderWidgetHostViewWin
|
||||
// for bug 765011 to get focus when the mouse is clicked. This
|
||||
// happens after the mouse down event is sent to the renderer
|
||||
// because normally Windows does a WM_SETFOCUS after WM_LBUTTONDOWN.
|
||||
::SetFocus(view_);
|
||||
}
|
||||
}
|
||||
|
||||
void WebWidgetHost::WheelEvent(WPARAM wparam, LPARAM lparam) {
|
||||
|
Reference in New Issue
Block a user