From 8dfb2790cf3dc7e0e7db6e539da4f87ee779ca4d Mon Sep 17 00:00:00 2001 From: fddima Date: Thu, 9 Dec 2010 18:38:54 +0200 Subject: [PATCH] - BrowserControl now derived from Control. - Removed invalid reference System.Threading, Version=1.0.2698.102. - Throw exception if CefBrowser is not initalized, when try execute some commands from BrowserControl. - Signed CefSharp.dll. --- CefSharp.snk | Bin 0 -> 596 bytes CefSharp/BrowserControl.h | 2 +- CefSharp/CefSharp.vcproj | 706 +++++++++++++++++++------------------- CefSharp/HandlerAdapter.h | 15 +- 4 files changed, 366 insertions(+), 357 deletions(-) create mode 100644 CefSharp.snk diff --git a/CefSharp.snk b/CefSharp.snk new file mode 100644 index 0000000000000000000000000000000000000000..4cdf8ab57949bb4d16ded0869725dcaeec1986ea GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50098S-SyC8%8qGWON(09W;F3g+nPbT+U6D`-wba==4`Zlm9euQz z0IF6vyFb~FN;Ayr__(?l0Jqn__Iq-<2sbAbk+vL>?`>v#;8Gmnarb@^Pr|#;(S_5O zZCp^CtBzG-U(lnmin{xzadrNPqv#4_2OoVQ0*~6D#6l{Z?*S*?UEiFHs@5=dy+ijX zL}22MTbZ<}auD(Zv%n%UxMn=?4^k6*UK%$&MuZ;kP+j_lm0v;)&1 zJKvgAU|EECaNTZIr;_G!x;<3rKeOM#_ol{iuJZButAw5**h7Sr0^Cg6wgFRAwrk2y zOH-&H9hR=~FPT+AUbk(s8W9Toei{H-!v%rP{|i-%ZeEWKgrkCb=Y~?~$9X}MMDU_Q z@f;KH7Dh$2x+ExvKvu^syp5YVaUb*Y8d2ouH^|~?PX>7^*}PsW+FakU|FM%M#3-As zCM;krB;`&w{|ER#1MW?#bW2jfJ_ivI(bod0%`+3u?hjlE+|1*K!bfHAwF!z zJ=|F70r(j5=Ht*h75WJga-0^0kRg^+gM8&&EY1`qSQDvpf$;*AAe9r}=NmUF37;0z i4aPhL1eveuvr8c9lOb% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CefSharp/HandlerAdapter.h b/CefSharp/HandlerAdapter.h index 018b95cbc..4655bda11 100644 --- a/CefSharp/HandlerAdapter.h +++ b/CefSharp/HandlerAdapter.h @@ -14,6 +14,15 @@ namespace CefSharp HWND _browserHwnd; CefRefPtr _cefBrowser; + void ThrowIfCefBrowserIsNotReady() + { + if (_cefBrowser == nullptr) + { + //TODO: make own exception type? + throw gcnew InvalidOperationException("CefBrowser is not ready."); + } + } + protected: public: @@ -52,7 +61,11 @@ namespace CefSharp virtual RetVal HandleFindResult(CefRefPtr browser, int identifier, int count, const CefRect& selectionRect, int activeMatchOrdinal, bool finalUpdate) { return RV_CONTINUE; } HWND GetBrowserHwnd() { return _browserHwnd; } - CefRefPtr GetCefBrowser() { return _cefBrowser; } + CefRefPtr GetCefBrowser() + { + ThrowIfCefBrowserIsNotReady(); + return _cefBrowser; + } }; }; \ No newline at end of file