From ec4e0650c67fbd20c9afbfa4ad81bc2a4675a053 Mon Sep 17 00:00:00 2001 From: amaitland Date: Wed, 21 May 2014 16:46:58 +1000 Subject: [PATCH] API cleanup - move non WPF specific commands from IWpfWebBrowser to IWebBrowser --- CefSharp.WinForms/WebView.cs | 6 ++++++ CefSharp.Wpf/IWpfWebBrowser.cs | 33 --------------------------------- CefSharp/IWebBrowser.cs | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 33 deletions(-) diff --git a/CefSharp.WinForms/WebView.cs b/CefSharp.WinForms/WebView.cs index 792950354..7bd2b58c8 100644 --- a/CefSharp.WinForms/WebView.cs +++ b/CefSharp.WinForms/WebView.cs @@ -254,6 +254,12 @@ namespace CefSharp.WinForms managedCefBrowserAdapter.Reload(ignoreCache); } + public double ZoomLevel + { + get { return managedCefBrowserAdapter.GetZoomLevel(); } + set { managedCefBrowserAdapter.SetZoomLevel(value); } + } + public void Undo() { managedCefBrowserAdapter.Undo(); diff --git a/CefSharp.Wpf/IWpfWebBrowser.cs b/CefSharp.Wpf/IWpfWebBrowser.cs index ef072d370..4bbb0e771 100644 --- a/CefSharp.Wpf/IWpfWebBrowser.cs +++ b/CefSharp.Wpf/IWpfWebBrowser.cs @@ -60,38 +60,5 @@ namespace CefSharp.Wpf /// Command which stops loading the current page. /// ICommand StopCommand { get; } - - /// - /// Opens up a new program window (using the default text editor) where the source code of the currently displayed web - /// page is shown. - /// - void ViewSource(); - - /// - /// Attempts to give focus to the WebBrowser control. - /// - /// true if keyboard focus and logical focus were set to this element; false if only logical focus - /// was set to this element, or if the call to this method did not force the focus to change. - bool Focus(); - - /// - /// Reloads the current WebView. - /// - void Reload(); - - /// - /// Reloads the current WebView, optionally ignoring the cache - /// (which means the whole page including all .css, .js etc. resources will be re-fetched). - /// - /// true A reload is performed ignoring borwser cache; false A reload is - /// performed using browser cache - void Reload(bool ignoreCache); - - /// - /// The zoom level at which the browser control is currently displaying. Can be set to 0 to clear the zoom level (resets to - /// default zoom level). - /// - /// This property is a Dependency Property and fully supports data binding. - double ZoomLevel { get; set; } } } diff --git a/CefSharp/IWebBrowser.cs b/CefSharp/IWebBrowser.cs index a313e6367..36d453fed 100644 --- a/CefSharp/IWebBrowser.cs +++ b/CefSharp/IWebBrowser.cs @@ -144,5 +144,38 @@ namespace CefSharp /// /// The main frame display text as a string. string GetText(); + + /// + /// Opens up a new program window (using the default text editor) where the source code of the currently displayed web + /// page is shown. + /// + void ViewSource(); + + /// + /// Attempts to give focus to the WebBrowser control. + /// + /// true if keyboard focus and logical focus were set to this element; false if only logical focus + /// was set to this element, or if the call to this method did not force the focus to change. + bool Focus(); + + /// + /// Reloads the current WebView. + /// + void Reload(); + + /// + /// Reloads the current WebView, optionally ignoring the cache + /// (which means the whole page including all .css, .js etc. resources will be re-fetched). + /// + /// true A reload is performed ignoring borwser cache; false A reload is + /// performed using browser cache + void Reload(bool ignoreCache); + + /// + /// The zoom level at which the browser control is currently displaying. Can be set to 0 to clear the zoom level (resets to + /// default zoom level). + /// + /// This property is a Dependency Property and fully supports data binding. + double ZoomLevel { get; set; } } }