diff --git a/CefSharp.Wpf/WebView.cpp b/CefSharp.Wpf/WebView.cpp index 4f134d341..41e989982 100644 --- a/CefSharp.Wpf/WebView.cpp +++ b/CefSharp.Wpf/WebView.cpp @@ -118,15 +118,17 @@ namespace Wpf else if (message == WM_KEYUP || message == WM_SYSKEYUP) type = KT_KEYUP; - bool sysChar = + CefKeyInfo keyInfo; + keyInfo.key = + wParam.ToInt32(); + keyInfo.sysChar = message == WM_SYSKEYDOWN || message == WM_SYSKEYUP || message == WM_SYSCHAR; - - bool imeChar = + keyInfo.imeChar = message == WM_IME_CHAR; - browser->SendKeyEvent(type, wParam.ToInt32(), lParam.ToInt32(), sysChar, imeChar); + browser->SendKeyEvent(type, keyInfo, lParam.ToInt32()); handled = true; } @@ -164,8 +166,9 @@ namespace Wpf e->Key >= Key::Left && e->Key <= Key::Down) { CefBrowser::KeyType type = e->IsDown ? KT_KEYDOWN : KT_KEYUP; - int key = KeyInterop::VirtualKeyFromKey(e->Key); - browser->SendKeyEvent(type, key, 0, false, false); + CefKeyInfo keyInfo; + keyInfo.key = KeyInterop::VirtualKeyFromKey(e->Key); + browser->SendKeyEvent(type, keyInfo, 0); e->Handled = true; } @@ -260,7 +263,7 @@ namespace Wpf if (TryGetCefBrowser(browser)) { Point point = e->GetPosition(this); - browser->SendMouseWheelEvent((int)point.X, (int)point.Y, e->Delta); + browser->SendMouseWheelEvent((int)point.X, (int)point.Y, 0, e->Delta); } } diff --git a/CefSharp/BindingHandler.cpp b/CefSharp/BindingHandler.cpp index 2e9fd4081..7420ed0a5 100644 --- a/CefSharp/BindingHandler.cpp +++ b/CefSharp/BindingHandler.cpp @@ -247,9 +247,10 @@ namespace CefSharp void BindingHandler::Bind(String^ name, Object^ obj, CefRefPtr window) { CefRefPtr bindingData = new BindingData(obj); - CefRefPtr userData = static_cast>(bindingData); - CefRefPtr wrappedObject = window->CreateObject(userData, NULL); CefRefPtr handler = static_cast(new BindingHandler()); + CefRefPtr userData = static_cast>(bindingData); + CefRefPtr wrappedObject = window->CreateObject(NULL); + wrappedObject->SetUserData(userData); array^ methods = obj->GetType()->GetMethods(BindingFlags::Instance | BindingFlags::Public); diff --git a/CefSharp/ScriptCore.cpp b/CefSharp/ScriptCore.cpp index 899e109e0..04194bcb8 100644 --- a/CefSharp/ScriptCore.cpp +++ b/CefSharp/ScriptCore.cpp @@ -45,24 +45,22 @@ namespace CefSharp CefV8ValueList args; args.push_back(arg); - if (eval->ExecuteFunctionWithContext(context, global, args, - result, exception, false)) + result = eval->ExecuteFunctionWithContext(context, global, args); + + if (result == nullptr) { - if (exception) + // XXX + _exceptionMessage = "Error"; + } + else + { + try { - CefString message = exception->GetMessage(); - _exceptionMessage = toClr(message); + _result = convertFromCef(result); } - else + catch (Exception^ ex) { - try - { - _result = convertFromCef(result); - } - catch (Exception^ ex) - { - _exceptionMessage = ex->Message; - } + _exceptionMessage = ex->Message; } } diff --git a/CefSharp/TypeUtil.cpp b/CefSharp/TypeUtil.cpp index c4c96c589..6e5c9d323 100644 --- a/CefSharp/TypeUtil.cpp +++ b/CefSharp/TypeUtil.cpp @@ -77,9 +77,8 @@ namespace CefSharp } if (type->IsArray) { - CefRefPtr cefArray = CefV8Value::CreateArray(); - System::Array^ managedArray = (System::Array^)obj; + CefRefPtr cefArray = CefV8Value::CreateArray(managedArray->Length); for (int i = 0; i < managedArray->Length; i++) { @@ -103,9 +102,8 @@ namespace CefSharp } if (type->IsValueType && !type->IsPrimitive && !type->IsEnum) { - CefRefPtr cefArray = CefV8Value::CreateArray(); - cli::array^ fields = type->GetFields(); + CefRefPtr cefArray = CefV8Value::CreateArray(fields->Length); for (int i = 0; i < fields->Length; i++) { diff --git a/Release/avcodec-54.dll b/Release/avcodec-54.dll index 1d150ca09..b527c34a6 100644 Binary files a/Release/avcodec-54.dll and b/Release/avcodec-54.dll differ diff --git a/Release/avformat-54.dll b/Release/avformat-54.dll index a64f2d413..44e7d1c8d 100644 Binary files a/Release/avformat-54.dll and b/Release/avformat-54.dll differ diff --git a/Release/avutil-51.dll b/Release/avutil-51.dll index 0dde82009..f3d9bb5f0 100644 Binary files a/Release/avutil-51.dll and b/Release/avutil-51.dll differ diff --git a/Release/chrome.pak b/Release/chrome.pak index d29499115..582b6517e 100644 Binary files a/Release/chrome.pak and b/Release/chrome.pak differ diff --git a/Release/libEGL.dll b/Release/libEGL.dll index dcd75c0aa..7d8be935c 100644 Binary files a/Release/libEGL.dll and b/Release/libEGL.dll differ diff --git a/Release/libGLESv2.dll b/Release/libGLESv2.dll index aeae30460..7c65c0318 100644 Binary files a/Release/libGLESv2.dll and b/Release/libGLESv2.dll differ diff --git a/Release/libcef.dll b/Release/libcef.dll index 78547c7e1..d74567bc0 100644 Binary files a/Release/libcef.dll and b/Release/libcef.dll differ diff --git a/Release/locales/am.pak b/Release/locales/am.pak index a615c8ccd..a8d492330 100644 Binary files a/Release/locales/am.pak and b/Release/locales/am.pak differ diff --git a/Release/locales/ar.pak b/Release/locales/ar.pak index a2783d42b..f00a8bf05 100644 Binary files a/Release/locales/ar.pak and b/Release/locales/ar.pak differ diff --git a/Release/locales/bg.pak b/Release/locales/bg.pak index fd631bafc..fdd2decb3 100644 Binary files a/Release/locales/bg.pak and b/Release/locales/bg.pak differ diff --git a/Release/locales/bn.pak b/Release/locales/bn.pak index 06cf41bef..aa6785bdb 100644 Binary files a/Release/locales/bn.pak and b/Release/locales/bn.pak differ diff --git a/Release/locales/ca.pak b/Release/locales/ca.pak index 763f20af8..ec23fcb89 100644 Binary files a/Release/locales/ca.pak and b/Release/locales/ca.pak differ diff --git a/Release/locales/cs.pak b/Release/locales/cs.pak index 9c44c88d0..edfab8e37 100644 Binary files a/Release/locales/cs.pak and b/Release/locales/cs.pak differ diff --git a/Release/locales/da.pak b/Release/locales/da.pak index a684db159..7406d85fd 100644 Binary files a/Release/locales/da.pak and b/Release/locales/da.pak differ diff --git a/Release/locales/de.pak b/Release/locales/de.pak index 2c832613f..857001a94 100644 Binary files a/Release/locales/de.pak and b/Release/locales/de.pak differ diff --git a/Release/locales/el.pak b/Release/locales/el.pak index 4d8f76ed2..0ce7a0e62 100644 Binary files a/Release/locales/el.pak and b/Release/locales/el.pak differ diff --git a/Release/locales/en-GB.pak b/Release/locales/en-GB.pak index c53d601f4..7086ee925 100644 Binary files a/Release/locales/en-GB.pak and b/Release/locales/en-GB.pak differ diff --git a/Release/locales/en-US.pak b/Release/locales/en-US.pak index c4a0a75a4..80fe1b49b 100644 Binary files a/Release/locales/en-US.pak and b/Release/locales/en-US.pak differ diff --git a/Release/locales/es-419.pak b/Release/locales/es-419.pak index d5e17526d..5fc8107a4 100644 Binary files a/Release/locales/es-419.pak and b/Release/locales/es-419.pak differ diff --git a/Release/locales/es.pak b/Release/locales/es.pak index 339652d09..d59b65712 100644 Binary files a/Release/locales/es.pak and b/Release/locales/es.pak differ diff --git a/Release/locales/et.pak b/Release/locales/et.pak index dc1ec0e82..782f83cc0 100644 Binary files a/Release/locales/et.pak and b/Release/locales/et.pak differ diff --git a/Release/locales/fa.pak b/Release/locales/fa.pak index 90721c25d..785b5a419 100644 Binary files a/Release/locales/fa.pak and b/Release/locales/fa.pak differ diff --git a/Release/locales/fi.pak b/Release/locales/fi.pak index 0e05729da..9ff879feb 100644 Binary files a/Release/locales/fi.pak and b/Release/locales/fi.pak differ diff --git a/Release/locales/fil.pak b/Release/locales/fil.pak index 0a5f25b9f..a3af3bf69 100644 Binary files a/Release/locales/fil.pak and b/Release/locales/fil.pak differ diff --git a/Release/locales/fr.pak b/Release/locales/fr.pak index c579aac42..b6d59cec5 100644 Binary files a/Release/locales/fr.pak and b/Release/locales/fr.pak differ diff --git a/Release/locales/gu.pak b/Release/locales/gu.pak index 14ebaab66..55b2c57bd 100644 Binary files a/Release/locales/gu.pak and b/Release/locales/gu.pak differ diff --git a/Release/locales/he.pak b/Release/locales/he.pak index 4b3e43a3f..f62a50a3d 100644 Binary files a/Release/locales/he.pak and b/Release/locales/he.pak differ diff --git a/Release/locales/hi.pak b/Release/locales/hi.pak index 9fe0f5521..d317d2ebf 100644 Binary files a/Release/locales/hi.pak and b/Release/locales/hi.pak differ diff --git a/Release/locales/hr.pak b/Release/locales/hr.pak index d007bb352..7157f6a6f 100644 Binary files a/Release/locales/hr.pak and b/Release/locales/hr.pak differ diff --git a/Release/locales/hu.pak b/Release/locales/hu.pak index c3a6d8788..27408318f 100644 Binary files a/Release/locales/hu.pak and b/Release/locales/hu.pak differ diff --git a/Release/locales/id.pak b/Release/locales/id.pak index f83d43a03..a0f538a50 100644 Binary files a/Release/locales/id.pak and b/Release/locales/id.pak differ diff --git a/Release/locales/it.pak b/Release/locales/it.pak index 23f4427ae..bde145613 100644 Binary files a/Release/locales/it.pak and b/Release/locales/it.pak differ diff --git a/Release/locales/ja.pak b/Release/locales/ja.pak index 7d28af4e4..b796cc75d 100644 Binary files a/Release/locales/ja.pak and b/Release/locales/ja.pak differ diff --git a/Release/locales/kn.pak b/Release/locales/kn.pak index 1667f36e1..d74467e0a 100644 Binary files a/Release/locales/kn.pak and b/Release/locales/kn.pak differ diff --git a/Release/locales/ko.pak b/Release/locales/ko.pak index c1b30bb19..0e0f06c59 100644 Binary files a/Release/locales/ko.pak and b/Release/locales/ko.pak differ diff --git a/Release/locales/lt.pak b/Release/locales/lt.pak index 17ad9ba65..f9b6552ab 100644 Binary files a/Release/locales/lt.pak and b/Release/locales/lt.pak differ diff --git a/Release/locales/lv.pak b/Release/locales/lv.pak index ebaad1eb0..5478c3142 100644 Binary files a/Release/locales/lv.pak and b/Release/locales/lv.pak differ diff --git a/Release/locales/ml.pak b/Release/locales/ml.pak index bc31c6ee8..d1c4a1d72 100644 Binary files a/Release/locales/ml.pak and b/Release/locales/ml.pak differ diff --git a/Release/locales/mr.pak b/Release/locales/mr.pak index d86649a3f..75de4d2a8 100644 Binary files a/Release/locales/mr.pak and b/Release/locales/mr.pak differ diff --git a/Release/locales/ms.pak b/Release/locales/ms.pak index 952db7baa..bbe88f43e 100644 Binary files a/Release/locales/ms.pak and b/Release/locales/ms.pak differ diff --git a/Release/locales/nb.pak b/Release/locales/nb.pak index 639e7a0a0..3debb1275 100644 Binary files a/Release/locales/nb.pak and b/Release/locales/nb.pak differ diff --git a/Release/locales/nl.pak b/Release/locales/nl.pak index 04563656b..d061331b6 100644 Binary files a/Release/locales/nl.pak and b/Release/locales/nl.pak differ diff --git a/Release/locales/pl.pak b/Release/locales/pl.pak index 64da38b86..7603e8c5f 100644 Binary files a/Release/locales/pl.pak and b/Release/locales/pl.pak differ diff --git a/Release/locales/pt-BR.pak b/Release/locales/pt-BR.pak index e869479bf..50f4ab6e0 100644 Binary files a/Release/locales/pt-BR.pak and b/Release/locales/pt-BR.pak differ diff --git a/Release/locales/pt-PT.pak b/Release/locales/pt-PT.pak index f5c313683..992dd2c5f 100644 Binary files a/Release/locales/pt-PT.pak and b/Release/locales/pt-PT.pak differ diff --git a/Release/locales/ro.pak b/Release/locales/ro.pak index 2a0e445e8..7fef884c3 100644 Binary files a/Release/locales/ro.pak and b/Release/locales/ro.pak differ diff --git a/Release/locales/ru.pak b/Release/locales/ru.pak index ef089e8db..1dcb8fb9c 100644 Binary files a/Release/locales/ru.pak and b/Release/locales/ru.pak differ diff --git a/Release/locales/sk.pak b/Release/locales/sk.pak index 018d52306..681050e6b 100644 Binary files a/Release/locales/sk.pak and b/Release/locales/sk.pak differ diff --git a/Release/locales/sl.pak b/Release/locales/sl.pak index 5f5427bbb..33350d8c9 100644 Binary files a/Release/locales/sl.pak and b/Release/locales/sl.pak differ diff --git a/Release/locales/sr.pak b/Release/locales/sr.pak index 0df9c6436..9df3ff639 100644 Binary files a/Release/locales/sr.pak and b/Release/locales/sr.pak differ diff --git a/Release/locales/sv.pak b/Release/locales/sv.pak index 75e95c935..0506c8a98 100644 Binary files a/Release/locales/sv.pak and b/Release/locales/sv.pak differ diff --git a/Release/locales/sw.pak b/Release/locales/sw.pak index b99934479..a960b27c9 100644 Binary files a/Release/locales/sw.pak and b/Release/locales/sw.pak differ diff --git a/Release/locales/ta.pak b/Release/locales/ta.pak index 2cbfd5f3d..04e0f0862 100644 Binary files a/Release/locales/ta.pak and b/Release/locales/ta.pak differ diff --git a/Release/locales/te.pak b/Release/locales/te.pak index 580186eb5..22241b7a8 100644 Binary files a/Release/locales/te.pak and b/Release/locales/te.pak differ diff --git a/Release/locales/th.pak b/Release/locales/th.pak index ad44a28de..91b042286 100644 Binary files a/Release/locales/th.pak and b/Release/locales/th.pak differ diff --git a/Release/locales/tr.pak b/Release/locales/tr.pak index 6157bf83e..d286b643e 100644 Binary files a/Release/locales/tr.pak and b/Release/locales/tr.pak differ diff --git a/Release/locales/uk.pak b/Release/locales/uk.pak index 20694f226..9f899d324 100644 Binary files a/Release/locales/uk.pak and b/Release/locales/uk.pak differ diff --git a/Release/locales/vi.pak b/Release/locales/vi.pak index c662501df..7995f8e8a 100644 Binary files a/Release/locales/vi.pak and b/Release/locales/vi.pak differ diff --git a/Release/locales/zh-CN.pak b/Release/locales/zh-CN.pak index 26db8874f..fe9833d09 100644 Binary files a/Release/locales/zh-CN.pak and b/Release/locales/zh-CN.pak differ diff --git a/Release/locales/zh-TW.pak b/Release/locales/zh-TW.pak index 008784ee8..7a40623e8 100644 Binary files a/Release/locales/zh-TW.pak and b/Release/locales/zh-TW.pak differ diff --git a/include/cef_browser.h b/include/cef_browser.h index 540e4b9c6..b319bc1dd 100644 --- a/include/cef_browser.h +++ b/include/cef_browser.h @@ -294,8 +294,8 @@ class CefBrowser : public virtual CefBase { // Send a key event to the browser. /// /*--cef()--*/ - virtual void SendKeyEvent(KeyType type, int key, int modifiers, bool sysChar, - bool imeChar) =0; + virtual void SendKeyEvent(KeyType type, const CefKeyInfo& keyInfo, + int modifiers) =0; /// // Send a mouse click event to the browser. The |x| and |y| coordinates are @@ -314,10 +314,11 @@ class CefBrowser : public virtual CefBase { /// // Send a mouse wheel event to the browser. The |x| and |y| coordinates are - // relative to the upper-left corner of the view. + // relative to the upper-left corner of the view. The |deltaX| and |deltaY| + // values represent the movement delta in the X and Y directions respectively. /// /*--cef()--*/ - virtual void SendMouseWheelEvent(int x, int y, int delta) =0; + virtual void SendMouseWheelEvent(int x, int y, int deltaX, int deltaY) =0; /// // Send a focus event to the browser. diff --git a/include/cef_v8.h b/include/cef_v8.h index 6024ce4a9..9f6e198ec 100644 --- a/include/cef_v8.h +++ b/include/cef_v8.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -44,6 +44,7 @@ #include "include/cef_frame.h" #include +class CefV8Exception; class CefV8Handler; class CefV8Value; @@ -114,7 +115,8 @@ bool CefRegisterExtension(const CefString& extension_name, /// -// Class that encapsulates a V8 context handle. +// Class that encapsulates a V8 context handle. The methods of this class may +// only be called on the UI thread. /// /*--cef(source=library)--*/ class CefV8Context : public virtual CefBase { @@ -150,17 +152,18 @@ class CefV8Context : public virtual CefBase { virtual CefRefPtr GetFrame() =0; /// - // Returns the global object for this context. + // Returns the global object for this context. The context must be entered + // before calling this method. /// /*--cef()--*/ virtual CefRefPtr GetGlobal() =0; /// // Enter this context. A context must be explicitly entered before creating a - // V8 Object, Array or Function asynchronously. Exit() must be called the same - // number of times as Enter() before releasing this context. V8 objects belong - // to the context in which they are created. Returns true if the scope was - // entered successfully. + // V8 Object, Array, Function or Date asynchronously. Exit() must be called + // the same number of times as Enter() before releasing this context. V8 + // objects belong to the context in which they are created. Returns true if + // the scope was entered successfully. /// /*--cef()--*/ virtual bool Enter() =0; @@ -178,6 +181,17 @@ class CefV8Context : public virtual CefBase { /// /*--cef()--*/ virtual bool IsSame(CefRefPtr that) =0; + + /// + // Evaluates the specified JavaScript code using this context's global object. + // On success |retval| will be set to the return value, if any, and the + // function will return true. On failure |exception| will be set to the + // exception, if any, and the function will return false. + /// + /*--cef()--*/ + virtual bool Eval(const CefString& code, + CefRefPtr& retval, + CefRefPtr& exception) =0; }; @@ -302,8 +316,8 @@ class CefV8Exception : public virtual CefBase { }; /// -// Class representing a V8 value. The methods of this class should only be -// called on the UI thread. +// Class representing a V8 value. The methods of this class may only be called +// on the UI thread. /// /*--cef(source=library)--*/ class CefV8Value : public virtual CefBase { @@ -316,55 +330,72 @@ class CefV8Value : public virtual CefBase { /// /*--cef()--*/ static CefRefPtr CreateUndefined(); + /// // Create a new CefV8Value object of type null. /// /*--cef()--*/ static CefRefPtr CreateNull(); + /// // Create a new CefV8Value object of type bool. /// /*--cef()--*/ static CefRefPtr CreateBool(bool value); + /// // Create a new CefV8Value object of type int. /// /*--cef()--*/ - static CefRefPtr CreateInt(int value); + static CefRefPtr CreateInt(int32 value); + + /// + // Create a new CefV8Value object of type unsigned int. + /// + /*--cef()--*/ + static CefRefPtr CreateUInt(uint32 value); + /// // Create a new CefV8Value object of type double. /// /*--cef()--*/ static CefRefPtr CreateDouble(double value); + /// - // Create a new CefV8Value object of type Date. - /// - /*--cef()--*/ - static CefRefPtr CreateDate(const CefTime& date); - /// - // Create a new CefV8Value object of type string. - /// - /*--cef(optional_param=value)--*/ - static CefRefPtr CreateString(const CefString& value); - /// - // Create a new CefV8Value object of type object with optional user data and - // accessor. This method should only be called from within the scope of a - // CefV8ContextHandler, CefV8Handler or CefV8Accessor callback, or in - // combination with calling Enter() and Exit() on a stored CefV8Context - // reference. - /// - /*--cef(capi_name=cef_v8value_create_object_with_accessor, - optional_param=user_data,optional_param=accessor)--*/ - static CefRefPtr CreateObject(CefRefPtr user_data, - CefRefPtr accessor); - /// - // Create a new CefV8Value object of type array. This method should only be + // Create a new CefV8Value object of type Date. This method should only be // called from within the scope of a CefV8ContextHandler, CefV8Handler or // CefV8Accessor callback, or in combination with calling Enter() and Exit() // on a stored CefV8Context reference. /// /*--cef()--*/ - static CefRefPtr CreateArray(); + static CefRefPtr CreateDate(const CefTime& date); + + /// + // Create a new CefV8Value object of type string. + /// + /*--cef(optional_param=value)--*/ + static CefRefPtr CreateString(const CefString& value); + + /// + // Create a new CefV8Value object of type object with optional accessor. This + // method should only be called from within the scope of a + // CefV8ContextHandler, CefV8Handler or CefV8Accessor callback, or in + // combination with calling Enter() and Exit() on a stored CefV8Context + // reference. + /// + /*--cef(optional_param=accessor)--*/ + static CefRefPtr CreateObject(CefRefPtr accessor); + + /// + // Create a new CefV8Value object of type array with the specified |length|. + // If |length| is negative the returned array will have length 0. This method + // should only be called from within the scope of a CefV8ContextHandler, + // CefV8Handler or CefV8Accessor callback, or in combination with calling + // Enter() and Exit() on a stored CefV8Context reference. + /// + /*--cef()--*/ + static CefRefPtr CreateArray(int length); + /// // Create a new CefV8Value object of type function. This method should only be // called from within the scope of a CefV8ContextHandler, CefV8Handler or @@ -380,46 +411,61 @@ class CefV8Value : public virtual CefBase { /// /*--cef()--*/ virtual bool IsUndefined() =0; + /// // True if the value type is null. /// /*--cef()--*/ virtual bool IsNull() =0; + /// // True if the value type is bool. /// /*--cef()--*/ virtual bool IsBool() =0; + /// // True if the value type is int. /// /*--cef()--*/ virtual bool IsInt() =0; + + /// + // True if the value type is unsigned int. + /// + /*--cef()--*/ + virtual bool IsUInt() =0; + /// // True if the value type is double. /// /*--cef()--*/ virtual bool IsDouble() =0; + /// // True if the value type is Date. /// /*--cef()--*/ virtual bool IsDate() =0; + /// // True if the value type is string. /// /*--cef()--*/ virtual bool IsString() =0; + /// // True if the value type is object. /// /*--cef()--*/ virtual bool IsObject() =0; + /// // True if the value type is array. /// /*--cef()--*/ virtual bool IsArray() =0; + /// // True if the value type is function. /// @@ -439,24 +485,35 @@ class CefV8Value : public virtual CefBase { /// /*--cef()--*/ virtual bool GetBoolValue() =0; + /// // Return an int value. The underlying data will be converted to if // necessary. /// /*--cef()--*/ - virtual int GetIntValue() =0; + virtual int32 GetIntValue() =0; + + /// + // Return an unisgned int value. The underlying data will be converted to if + // necessary. + /// + /*--cef()--*/ + virtual uint32 GetUIntValue() =0; + /// // Return a double value. The underlying data will be converted to if // necessary. /// /*--cef()--*/ virtual double GetDoubleValue() =0; + /// // Return a Date value. The underlying data will be converted to if // necessary. /// /*--cef()--*/ virtual CefTime GetDateValue() =0; + /// // Return a string value. The underlying data will be converted to if // necessary. @@ -469,11 +526,55 @@ class CefV8Value : public virtual CefBase { // functions are also objects. String- and integer-based keys can be used // interchangably with the framework converting between them as necessary. + /// + // Returns true if this is a user created object. + /// + /*--cef()--*/ + virtual bool IsUserCreated() =0; + + /// + // Returns true if the last method call resulted in an exception. This + // attribute exists only in the scope of the current CEF value object. + /// + /*--cef()--*/ + virtual bool HasException() =0; + + /// + // Returns the exception resulting from the last method call. This attribute + // exists only in the scope of the current CEF value object. + /// + /*--cef()--*/ + virtual CefRefPtr GetException() =0; + + /// + // Clears the last exception and returns true on success. + /// + /*--cef()--*/ + virtual bool ClearException() =0; + + /// + // Returns true if this object will re-throw future exceptions. This attribute + // exists only in the scope of the current CEF value object. + /// + /*--cef()--*/ + virtual bool WillRethrowExceptions() =0; + + /// + // Set whether this object will re-throw future exceptions. By default + // exceptions are not re-thrown. If a exception is re-thrown the current + // context should not be accessed again until after the exception has been + // caught and not re-thrown. Returns true on success. This attribute exists + // only in the scope of the current CEF value object. + /// + /*--cef()--*/ + virtual bool SetRethrowExceptions(bool rethrow) =0; + /// // Returns true if the object has a value with the specified identifier. /// /*--cef(capi_name=has_value_bykey)--*/ virtual bool HasValue(const CefString& key) =0; + /// // Returns true if the object has a value with the specified identifier. /// @@ -481,42 +582,62 @@ class CefV8Value : public virtual CefBase { virtual bool HasValue(int index) =0; /// - // Delete the value with the specified identifier. + // Deletes the value with the specified identifier and returns true on + // success. Returns false if this method is called incorrectly or an exception + // is thrown. For read-only and don't-delete values this method will return + // true even though deletion failed. /// /*--cef(capi_name=delete_value_bykey)--*/ virtual bool DeleteValue(const CefString& key) =0; + /// - // Delete the value with the specified identifier. + // Deletes the value with the specified identifier and returns true on + // success. Returns false if this method is called incorrectly, deletion fails + // or an exception is thrown. For read-only and don't-delete values this + // method will return true even though deletion failed. /// /*--cef(capi_name=delete_value_byindex,index_param=index)--*/ virtual bool DeleteValue(int index) =0; /// - // Returns the value with the specified identifier. + // Returns the value with the specified identifier on success. Returns NULL + // if this method is called incorrectly or an exception is thrown. /// /*--cef(capi_name=get_value_bykey)--*/ virtual CefRefPtr GetValue(const CefString& key) =0; + /// - // Returns the value with the specified identifier. + // Returns the value with the specified identifier on success. Returns NULL + // if this method is called incorrectly or an exception is thrown. /// /*--cef(capi_name=get_value_byindex,index_param=index)--*/ virtual CefRefPtr GetValue(int index) =0; /// - // Associate a value with the specified identifier. + // Associates a value with the specified identifier and returns true on + // success. Returns false if this method is called incorrectly or an exception + // is thrown. For read-only values this method will return true even though + // assignment failed. /// /*--cef(capi_name=set_value_bykey)--*/ virtual bool SetValue(const CefString& key, CefRefPtr value, PropertyAttribute attribute) =0; + /// - // Associate a value with the specified identifier. + // Associates a value with the specified identifier and returns true on + // success. Returns false if this method is called incorrectly or an exception + // is thrown. For read-only values this method will return true even though + // assignment failed. /// /*--cef(capi_name=set_value_byindex,index_param=index)--*/ virtual bool SetValue(int index, CefRefPtr value) =0; /// - // Register an identifier whose access will be forwarded to the CefV8Accessor - // instance passed to CefV8Value::CreateObject(). + // Registers an identifier and returns true on success. Access to the + // identifier will be forwarded to the CefV8Accessor instance passed to + // CefV8Value::CreateObject(). Returns false if this method is called + // incorrectly or an exception is thrown. For read-only values this method + // will return true even though assignment failed. /// /*--cef(capi_name=set_value_byaccessor)--*/ virtual bool SetValue(const CefString& key, AccessControl settings, @@ -530,7 +651,15 @@ class CefV8Value : public virtual CefBase { virtual bool GetKeys(std::vector& keys) =0; /// - // Returns the user data, if any, specified when the object was created. + // Sets the user data for this object and returns true on success. Returns + // false if this method is called incorrectly. This method can only be called + // on user created objects. + /// + /*--cef(optional_param=user_data)--*/ + virtual bool SetUserData(CefRefPtr user_data) =0; + + /// + // Returns the user data, if any, assigned to this object. /// /*--cef()--*/ virtual CefRefPtr GetUserData() =0; @@ -550,7 +679,8 @@ class CefV8Value : public virtual CefBase { // external memory associated with it and automatically decreases the global // total by the appropriate amount on its destruction. |change_in_bytes| // specifies the number of bytes to adjust by. This method returns the number - // of bytes associated with the object after the adjustment. + // of bytes associated with the object after the adjustment. This method can + // only be called on user created objects. /// /*--cef()--*/ virtual int AdjustExternallyAllocatedMemory(int change_in_bytes) =0; @@ -584,35 +714,29 @@ class CefV8Value : public virtual CefBase { // be called from within the scope of a CefV8Handler or CefV8Accessor // callback, or in combination with calling Enter() and Exit() on a stored // CefV8Context reference. |object| is the receiver ('this' object) of the - // function. |arguments| is the list of arguments that will be passed to the - // function. If execution succeeds |retval| will be set to the function return - // value. If execution fails |exception| will be set to the exception that was - // thrown. If |rethrow_exception| is true any exception will also be re- - // thrown. This method returns false if called incorrectly. + // function. If |object| is empty the current context's global object will be + // used. |arguments| is the list of arguments that will be passed to the + // function. Returns the function return value on success. Returns NULL if + // this method is called incorrectly or an exception is thrown. /// /*--cef(optional_param=object)--*/ - virtual bool ExecuteFunction(CefRefPtr object, - const CefV8ValueList& arguments, - CefRefPtr& retval, - CefRefPtr& exception, - bool rethrow_exception) =0; + virtual CefRefPtr ExecuteFunction( + CefRefPtr object, + const CefV8ValueList& arguments) =0; /// // Execute the function using the specified V8 context. |object| is the - // receiver ('this' object) of the function. |arguments| is the list of - // arguments that will be passed to the function. If execution succeeds - // |retval| will be set to the function return value. If execution fails - // |exception| will be set to the exception that was thrown. If - // |rethrow_exception| is true any exception will also be re-thrown. This - // method returns false if called incorrectly. + // receiver ('this' object) of the function. If |object| is empty the + // specified context's global object will be used. |arguments| is the list of + // arguments that will be passed to the function. Returns the function return + // value on success. Returns NULL if this method is called incorrectly or an + // exception is thrown. /// /*--cef(optional_param=object)--*/ - virtual bool ExecuteFunctionWithContext(CefRefPtr context, - CefRefPtr object, - const CefV8ValueList& arguments, - CefRefPtr& retval, - CefRefPtr& exception, - bool rethrow_exception) =0; + virtual CefRefPtr ExecuteFunctionWithContext( + CefRefPtr context, + CefRefPtr object, + const CefV8ValueList& arguments) =0; }; #endif // CEF_INCLUDE_CEF_V8_H_ diff --git a/include/cef_version.h b/include/cef_version.h index 2f63fb8e9..68e6f5310 100644 --- a/include/cef_version.h +++ b/include/cef_version.h @@ -35,12 +35,12 @@ #ifndef CEF_INCLUDE_CEF_VERSION_H_ #define CEF_INCLUDE_CEF_VERSION_H_ -#define CEF_REVISION 589 +#define CEF_REVISION 646 #define COPYRIGHT_YEAR 2012 -#define CHROME_VERSION_MAJOR 20 +#define CHROME_VERSION_MAJOR 21 #define CHROME_VERSION_MINOR 0 -#define CHROME_VERSION_BUILD 1099 +#define CHROME_VERSION_BUILD 1148 #define CHROME_VERSION_PATCH 0 #define DO_MAKE_STRING(p) #p diff --git a/include/internal/cef_string_wrappers.h b/include/internal/cef_string_wrappers.h index e6b29ebb4..c0507c1cc 100644 --- a/include/internal/cef_string_wrappers.h +++ b/include/internal/cef_string_wrappers.h @@ -414,7 +414,7 @@ class CefStringBase { // Clear the string data. /// void clear() { - if (!empty()) + if (string_) traits::clear(string_); } diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index 1cecb5e63..f2ee43852 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -61,6 +61,20 @@ typedef long long int64; // NOLINT(runtime/int) typedef unsigned long long uint64; // NOLINT(runtime/int) #endif +// TODO: Remove these type guards. These are to avoid conflicts with +// obsolete/protypes.h in the Gecko SDK. +#ifndef _INT32 +#define _INT32 +typedef int int32; +#endif + +// TODO: Remove these type guards. These are to avoid conflicts with +// obsolete/protypes.h in the Gecko SDK. +#ifndef _UINT32 +#define _UINT32 +typedef unsigned int uint32; +#endif + #ifdef __cplusplus extern "C" { #endif @@ -856,10 +870,11 @@ enum cef_handler_keyevent_type_t { // Key event modifiers. /// enum cef_handler_keyevent_modifiers_t { - KEY_SHIFT = 1 << 0, - KEY_CTRL = 1 << 1, - KEY_ALT = 1 << 2, - KEY_META = 1 << 3 + KEY_SHIFT = 1 << 0, + KEY_CTRL = 1 << 1, + KEY_ALT = 1 << 2, + KEY_META = 1 << 3, + KEY_KEYPAD = 1 << 4, // Only used on Mac OS-X }; /// diff --git a/include/internal/cef_types_win.h b/include/internal/cef_types_win.h index c275f69d8..9b5e48e59 100644 --- a/include/internal/cef_types_win.h +++ b/include/internal/cef_types_win.h @@ -92,6 +92,15 @@ typedef struct _cef_print_info_t { double m_Scale; } cef_print_info_t; +/// +// Class representing key information. +/// +typedef struct _cef_key_info_t { + int key; + BOOL sysChar; + BOOL imeChar; +} cef_key_info_t; + #ifdef __cplusplus } #endif diff --git a/include/internal/cef_win.h b/include/internal/cef_win.h index 9a89f4a7c..68d91dced 100644 --- a/include/internal/cef_win.h +++ b/include/internal/cef_win.h @@ -71,7 +71,6 @@ class CefCriticalSection { #define CefWindowHandle cef_window_handle_t #define CefCursorHandle cef_cursor_handle_t - struct CefWindowInfoTraits { typedef cef_window_info_t struct_type; @@ -162,6 +161,26 @@ struct CefPrintInfoTraits { /// typedef CefStructBase CefPrintInfo; + +struct CefKeyInfoTraits { + typedef cef_key_info_t struct_type; + + static inline void init(struct_type* s) {} + static inline void clear(struct_type* s) {} + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->key = src->key; + target->sysChar = src->sysChar; + target->imeChar = src->imeChar; + } +}; + +/// +// Class representing key information. +/// +typedef CefStructBase CefKeyInfo; + #endif // OS_WIN #endif // CEF_INCLUDE_INTERNAL_CEF_WIN_H_ diff --git a/libs/Release/libcef.lib b/libs/Release/libcef.lib index 44ec07ea3..3bc619fee 100644 Binary files a/libs/Release/libcef.lib and b/libs/Release/libcef.lib differ diff --git a/libs/Release/libcef_dll_wrapper.lib b/libs/Release/libcef_dll_wrapper.lib index cb347b5d2..da5da37ae 100644 Binary files a/libs/Release/libcef_dll_wrapper.lib and b/libs/Release/libcef_dll_wrapper.lib differ