From cfcd3e4c8a81639b2395b06b2f018ee42db01367 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Mon, 29 Jul 2013 09:36:34 +0300 Subject: [PATCH] I give up with this one. It makes more sense to have this as a string after all, so then we might as well use the previous name (Address). The "SetAddress" method is internal and shouldn't really be used from the outside. We might be closing in to the point where we should split IWebBrowser into two parts - IWebBrowser (which is exposed to external consumers) and IWebBrowserInternal (an internal interface mostly needed between CefSharp and CefSharp.Wpf/CefSharp.WinForms). --- CefSharp/BrowserCore.h | 10 +++++----- CefSharp/CefBrowserWrapper.h | 6 +++--- CefSharp/IWebBrowser.h | 5 ++--- CefSharp/Internals/ClientAdapter.cpp | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/CefSharp/BrowserCore.h b/CefSharp/BrowserCore.h index ce06a684a..526c2e6f4 100644 --- a/CefSharp/BrowserCore.h +++ b/CefSharp/BrowserCore.h @@ -33,7 +33,7 @@ namespace CefSharp int _contentsHeight; String^ _tooltip; - Uri^ _address; + String^ _address; String^ _title; ILifeSpanHandler^ _lifeSpanHandler; @@ -48,7 +48,7 @@ namespace CefSharp public: virtual event PropertyChangedEventHandler^ PropertyChanged; - BrowserCore(Uri^ address) + BrowserCore(String^ address) { _loadCompleted = gcnew RtzCountdownEvent(); _address = address; @@ -75,11 +75,11 @@ namespace CefSharp bool get() { return _canGoForward; } } - property Uri^ Address + property String^ Address { - Uri^ get() { return _address; } + String^ get() { return _address; } - void set(Uri^ address) + void set(String^ address) { if (_address != nullptr && _address->Equals(address)) diff --git a/CefSharp/CefBrowserWrapper.h b/CefSharp/CefBrowserWrapper.h index 5fc973cc7..314929cd7 100644 --- a/CefSharp/CefBrowserWrapper.h +++ b/CefSharp/CefBrowserWrapper.h @@ -62,14 +62,14 @@ namespace CefSharp _renderClientAdapter = nullptr; } - void CreateOffscreenBrowser(BrowserSettings^ browserSettings, IntPtr^ sourceHandle, Uri^ uri) + void CreateOffscreenBrowser(BrowserSettings^ browserSettings, IntPtr^ sourceHandle, String^ address) { HWND hwnd = static_cast(sourceHandle->ToPointer()); CefWindowInfo window; window.SetAsOffScreen(hwnd); - CefString url = StringUtils::ToNative(uri->ToString()); + CefString addressNative = StringUtils::ToNative(address); - CefBrowserHost::CreateBrowser(window, _renderClientAdapter, url, + CefBrowserHost::CreateBrowser(window, _renderClientAdapter, addressNative, *(CefBrowserSettings*) browserSettings->_internalBrowserSettings); } diff --git a/CefSharp/IWebBrowser.h b/CefSharp/IWebBrowser.h index cf6a2301d..22f1a78c1 100644 --- a/CefSharp/IWebBrowser.h +++ b/CefSharp/IWebBrowser.h @@ -31,7 +31,7 @@ namespace CefSharp property bool CanGoBack { bool get(); } property bool CanGoForward { bool get(); } - property Uri^ Uri; + property String^ Address; property String^ Title; property String^ TooltipText; @@ -44,8 +44,7 @@ namespace CefSharp void OnInitialized(); - void Load(String^ adress); - void Load(::Uri^ uri); + void SetAddress(String^ address); void LoadHtml(String^ html); void Stop(); void Back(); diff --git a/CefSharp/Internals/ClientAdapter.cpp b/CefSharp/Internals/ClientAdapter.cpp index e739cb062..9c54f56a5 100644 --- a/CefSharp/Internals/ClientAdapter.cpp +++ b/CefSharp/Internals/ClientAdapter.cpp @@ -70,7 +70,7 @@ namespace CefSharp { if (frame->IsMain()) { - _browserControl->Uri = gcnew Uri(StringUtils::ToClr(address)); + _browserControl->SetAddress(StringUtils::ToClr(address)); } }