Skip to content

Commit

Permalink
Xml Doc improvements
Browse files Browse the repository at this point in the history
Fix some invalid markup
Move some unmanaged constructors and implicit conversion to internal
  • Loading branch information
amaitland committed Feb 9, 2018
1 parent cc8c7f0 commit bea70cc
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 58 deletions.
12 changes: 6 additions & 6 deletions CefSharp.Core/BrowserSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ namespace CefSharp
internal:
CefBrowserSettings* _browserSettings;

public:
/// <summary>
/// Default Constructor
/// Internal Constructor
/// </summary>
BrowserSettings() : _browserSettings(new CefBrowserSettings())
BrowserSettings(CefBrowserSettings* browserSettings)
{
_browserSettings = browserSettings;
}

public:
/// <summary>
/// Internal Constructor
/// Default Constructor
/// </summary>
BrowserSettings(CefBrowserSettings* browserSettings)
BrowserSettings() : _browserSettings(new CefBrowserSettings())
{
_browserSettings = browserSettings;
}

!BrowserSettings()
Expand Down
22 changes: 11 additions & 11 deletions CefSharp.Core/Cef.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ namespace CefSharp
/// applicaiton thread (Typically the UI thead). If you call them on different
/// threads, your application will hang. See the documentation for Cef.Shutdown() for more details.
/// </summary>
/// <return>true if successful; otherwise, false.</return>
/// <returns>true if successful; otherwise, false.</returns>
static bool Initialize()
{
auto cefSettings = gcnew CefSettings();
Expand All @@ -149,7 +149,7 @@ namespace CefSharp
/// threads, your application will hang. See the documentation for Cef.Shutdown() for more details.
/// </summary>
/// <param name="cefSettings">CefSharp configuration settings.</param>
/// <return>true if successful; otherwise, false.</return>
/// <returns>true if successful; otherwise, false.</returns>
static bool Initialize(CefSettings^ cefSettings)
{
return Initialize(cefSettings, false, nullptr);
Expand All @@ -163,7 +163,7 @@ namespace CefSharp
/// </summary>
/// <param name="cefSettings">CefSharp configuration settings.</param>
/// <param name="performDependencyCheck">Check that all relevant dependencies avaliable, throws exception if any are missing</param>
/// <return>true if successful; otherwise, false.</return>
/// <returns>true if successful; otherwise, false.</returns>
static bool Initialize(CefSettings^ cefSettings, bool performDependencyCheck, IBrowserProcessHandler^ browserProcessHandler)
{
if (IsInitialized)
Expand Down Expand Up @@ -460,7 +460,7 @@ namespace CefSharp
/// <summary>
/// Clear all registered scheme handler factories.
/// </summary>
/// <return>Returns false on error.</return>
/// <returns>Returns false on error.</returns>
static bool ClearSchemeHandlerFactories()
{
return CefClearSchemeHandlerFactories();
Expand All @@ -478,7 +478,7 @@ namespace CefSharp
/// Async returns a list containing Plugin Information
/// (Wrapper around CefVisitWebPluginInfo)
/// </summary>
/// <return>Returns List of <see cref="Plugin"/> structs.</return>
/// <returns>Returns List of <see cref="Plugin"/> structs.</returns>
static Task<List<WebPluginInfo^>^>^ GetPlugins()
{
auto taskVisitor = gcnew TaskWebPluginInfoVisitor();
Expand Down Expand Up @@ -521,7 +521,7 @@ namespace CefSharp
/// This function bypasses any user permission checks so should only be
/// used by code that is allowed to access location information.
/// </summary>
/// <return>Returns 'best available' location info or, if the location update failed, with error info.</return>
/// <returns>Returns 'best available' location info or, if the location update failed, with error info.</returns>
static bool GetGeolocation(IGetGeolocationCallback^ callback)
{
CefRefPtr<CefGetGeolocationCallback> wrapper = callback == nullptr ? NULL : new CefGetGeolocationCallbackAdapter(callback);
Expand All @@ -534,7 +534,7 @@ namespace CefSharp
/// This function bypasses any user permission checks so should only be
/// used by code that is allowed to access location information.
/// </summary>
/// <return>Returns 'best available' location info or, if the location update failed, with error info.</return>
/// <returns>Returns 'best available' location info or, if the location update failed, with error info.</returns>
static Task<Geoposition^>^ GetGeolocationAsync()
{
auto callback = gcnew TaskGetGeolocationCallback();
Expand All @@ -547,7 +547,7 @@ namespace CefSharp
/// <summary>
/// Returns true if called on the specified CEF thread.
/// </summary>
/// <return>Returns true if called on the specified thread.</return>
/// <returns>Returns true if called on the specified thread.</returns>
static bool CurrentlyOnThread(CefThreadIds threadId)
{
return CefCurrentlyOn((CefThreadId)threadId);
Expand All @@ -556,7 +556,7 @@ namespace CefSharp
/// <summary>
/// Gets the Global Request Context. Make sure to Dispose of this object when finished.
/// </summary>
/// <return>Returns the global request context or null.</return>
/// <returns>Returns the global request context or null.</returns>
static IRequestContext^ GetGlobalRequestContext()
{
auto context = CefRequestContext::GetGlobalContext();
Expand Down Expand Up @@ -646,7 +646,7 @@ namespace CefSharp
/// if your key is named "mykey" then the value will be broken into ordered
/// chunks and submitted using keys named "mykey-1", "mykey-2", etc.
/// </summary>
/// <return>Returns the global request context or null.</return>
/// <returns>Returns the global request context or null.</returns>
static property bool CrashReportingEnabled
{
bool get()
Expand Down Expand Up @@ -722,7 +722,7 @@ namespace CefSharp
/// See <see cref="RegisterWidevineCdm(String, IRegisterCdmCallback)"/> for more details.
/// </summary>
/// <param name="path"> is a directory that contains the Widevine CDM files</param>
/// <return>Returns a Task that can be awaited to receive the <see cref="CdmRegistration"/> response.</return>
/// <returns>Returns a Task that can be awaited to receive the <see cref="CdmRegistration"/> response.</returns>
static Task<CdmRegistration^>^ RegisterWidevineCdmAsync(String^ path)
{
auto callback = gcnew TaskRegisterCdmCallback();
Expand Down
18 changes: 9 additions & 9 deletions CefSharp.Core/CookieManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ namespace CefSharp

}

operator CefRefPtr<CefCookieManager>()
{
if (this == nullptr)
{
return NULL;
}
return _cookieManager.get();
}

public:
///
// Creates a new cookie manager. If |path| is empty data will be stored in
Expand Down Expand Up @@ -68,14 +77,5 @@ namespace CefSharp
return !_cookieManager.get();
}
}

operator CefRefPtr<CefCookieManager>()
{
if (this == nullptr)
{
return NULL;
}
return _cookieManager.get();
}
};
}
20 changes: 10 additions & 10 deletions CefSharp.Core/RequestContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ namespace CefSharp
_settings = nullptr;
}

operator CefRefPtr<CefRequestContext>()
{
if (this == nullptr)
{
return NULL;
}
return _requestContext.get();
}

public:
RequestContext()
{
Expand Down Expand Up @@ -367,7 +376,7 @@ namespace CefSharp
/// Attempts to resolve origin to a list of associated IP addresses.
/// </summary>
/// <param name="origin">host name to resolve</param>
/// <return>A task that represents the Resoolve Host operation. The value of the TResult parameter contains ResolveCallbackResult.</return>
/// <returns>A task that represents the Resoolve Host operation. The value of the TResult parameter contains ResolveCallbackResult.</returns>
virtual Task<ResolveCallbackResult>^ ResolveHostAsync(Uri^ origin)
{
ThrowIfDisposed();
Expand Down Expand Up @@ -402,14 +411,5 @@ namespace CefSharp

return (CefErrorCode)errorCode;
}

operator CefRefPtr<CefRequestContext>()
{
if(this == nullptr)
{
return NULL;
}
return _requestContext.get();
}
};
}
11 changes: 6 additions & 5 deletions CefSharp.Core/RequestContextSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ namespace CefSharp
private:
CefRequestContextSettings* _settings;

internal:
operator CefRequestContextSettings()
{
return *_settings;
}

public:
/// <summary>
/// Default constructor
Expand Down Expand Up @@ -102,10 +108,5 @@ namespace CefSharp
bool get() { return _settings->ignore_certificate_errors == 1; }
void set(bool value) { _settings->ignore_certificate_errors = value; }
}

operator CefRequestContextSettings()
{
return *_settings;
}
};
}
22 changes: 14 additions & 8 deletions CefSharp/AsyncExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@

namespace CefSharp
{
/// <summary>
/// Async extensions for different interfaces
/// </summary>
public static class AsyncExtensions
{
/// <summary>
/// Deletes all cookies that matches all the provided parameters asynchronously.
/// If both <paramref name="url"/> and <paramref name="name"/> are empty, all cookies will be deleted.
/// </summary>
/// <param name="cookieManager">cookie manager</param>
/// <param name="url">The cookie URL. If an empty string is provided, any URL will be matched.</param>
/// <param name="name">The name of the cookie. If an empty string is provided, any URL will be matched.</param>
/// <return>Returns -1 if a non-empty invalid URL is specified, or if cookies cannot be accessed;
/// otherwise, a task that represents the delete operation. The value of the TResult will be the number of cookies that were deleted or -1 if unknown.</return>
/// <returns>Returns -1 if a non-empty invalid URL is specified, or if cookies cannot be accessed;
/// otherwise, a task that represents the delete operation. The value of the TResult will be the number of cookies that were deleted or -1 if unknown.</returns>
public static Task<int> DeleteCookiesAsync(this ICookieManager cookieManager, string url = null, string name = null)
{
if(cookieManager == null)
Expand Down Expand Up @@ -48,8 +52,8 @@ public static Task<int> DeleteCookiesAsync(this ICookieManager cookieManager, st
/// <param name="cookieManager">cookie manager</param>
/// <param name="url">The cookie URL. If an empty string is provided, any URL will be matched.</param>
/// <param name="cookie">the cookie to be set</param>
/// <return>returns false if the cookie cannot be set (e.g. if illegal charecters such as ';' are used);
/// otherwise task that represents the set operation. The value of the TResult parameter contains a bool to indicate success.</return>
/// <returns>returns false if the cookie cannot be set (e.g. if illegal charecters such as ';' are used);
/// otherwise task that represents the set operation. The value of the TResult parameter contains a bool to indicate success.</returns>
public static Task<bool> SetCookieAsync(this ICookieManager cookieManager, string url, Cookie cookie)
{
if (cookieManager == null)
Expand All @@ -75,8 +79,9 @@ public static Task<bool> SetCookieAsync(this ICookieManager cookieManager, strin
/// <summary>
/// Visits all cookies. The returned cookies are sorted by longest path, then by earliest creation date.
/// </summary>
/// <return>A task that represents the VisitAllCookies operation. The value of the TResult parameter contains a List of cookies
/// or null if cookies cannot be accessed.</return>
/// <param name="cookieManager">cookie manager</param>
/// <returns>A task that represents the VisitAllCookies operation. The value of the TResult parameter contains a List of cookies
/// or null if cookies cannot be accessed.</returns>
public static Task<List<Cookie>> VisitAllCookiesAsync(this ICookieManager cookieManager)
{
var cookieVisitor = new TaskCookieVisitor();
Expand All @@ -94,10 +99,11 @@ public static Task<List<Cookie>> VisitAllCookiesAsync(this ICookieManager cookie
/// If <paramref name="includeHttpOnly"/> is true, HTTP-only cookies will also be included in the results. The returned cookies
/// are sorted by longest path, then by earliest creation date.
/// </summary>
/// <param name="cookieManager">cookie manager</param>
/// <param name="url">The URL to use for filtering a subset of the cookies available.</param>
/// <param name="includeHttpOnly">A flag that determines whether HTTP-only cookies will be shown in results.</param>
/// <return>A task that represents the VisitUrlCookies operation. The value of the TResult parameter contains a List of cookies.
/// or null if cookies cannot be accessed.</return>
/// <returns>A task that represents the VisitUrlCookies operation. The value of the TResult parameter contains a List of cookies.
/// or null if cookies cannot be accessed.</returns>
public static Task<List<Cookie>> VisitUrlCookiesAsync(this ICookieManager cookieManager, string url, bool includeHttpOnly)
{
var cookieVisitor = new TaskCookieVisitor();
Expand Down
28 changes: 28 additions & 0 deletions CefSharp/Cookie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,42 @@ namespace CefSharp
"Creation = {Creation}, Expires = {Expires}, LastAccess = {LastAccess}", Name = "Cookie")]
public sealed class Cookie
{
/// <summary>
/// The cookie name
/// </summary>
public string Name { get; set; }
/// <summary>
/// The cookie value.
/// </summary>
public string Value { get; set; }
/// <summary>
/// If domain is empty a host cookie will be created instead of a domain cookie. Domain cookies are stored with a leading "."
/// and are visible to sub-domains whereas host cookies are not.
/// </summary>
public string Domain { get; set; }
/// <summary>
/// Ss non-empty only URLs at or below the path will get the cookie value.
/// </summary>
public string Path { get; set; }
/// <summary>
/// If true the cookie will only be sent for HTTPS requests.
/// </summary>
public bool Secure { get; set; }
/// <summary>
/// Ss true the cookie will only be sent for HTTP requests.
/// </summary>
public bool HttpOnly { get; set; }
/// <summary>
/// Expires or null of no expiry
/// </summary>
public DateTime? Expires { get; set; }
/// <summary>
/// The cookie creation date. This is automatically populated by the system on cookie creation.
/// </summary>
public DateTime Creation { get; set; }
/// <summary>
/// The cookie last access date. This is automatically populated by the system on access.
/// </summary>
public DateTime LastAccess { get; set; }
}
}
3 changes: 3 additions & 0 deletions CefSharp/Enums/ContextMenuType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace CefSharp
{
/// <summary>
/// ContextMenuType
/// </summary>
[Flags]
public enum ContextMenuType
{
Expand Down
4 changes: 2 additions & 2 deletions CefSharp/IBrowserHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public interface IBrowserHost : IDisposable
void DragTargetDragDrop(MouseEvent mouseEvent);

/// <summary>
/// Call this method when the drag operation started by a <see cref="IRenderWebBrowser.StartDragging"/> call has ended either in a drop or by being cancelled.
/// Call this method when the drag operation started by a <see cref="CefSharp.Internals.IRenderWebBrowser.StartDragging"/> call has ended either in a drop or by being cancelled.
/// If the web view is both the drag source and the drag target then all DragTarget* methods should be called before DragSource* methods.
/// This method is only used when window rendering is disabled.
/// </summary>
Expand All @@ -79,7 +79,7 @@ public interface IBrowserHost : IDisposable
void DragTargetDragLeave();

/// <summary>
/// Call this method when the drag operation started by a <see cref="IRenderWebBrowser.StartDragging"/> call has completed.
/// Call this method when the drag operation started by a <see cref="CefSharp.Internals.IRenderWebBrowser.StartDragging"/> call has completed.
/// This method may be called immediately without first calling DragSourceEndedAt to cancel a drag operation.
/// If the web view is both the drag source and the drag target then all DragTarget* methods should be called before DragSource* mthods.
/// This method is only used when window rendering is disabled.
Expand Down
Loading

0 comments on commit bea70cc

Please sign in to comment.