-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Add Initial IRenderProcessHandler.OnContextCreated/Released implementation #2697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
amaitland
merged 5 commits into
cefsharp:master
from
amaitland:feature/renderprocesscontextcreated
Mar 20, 2019
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1c5d400
WinForms/WPF - Dispose of IFrame after calling LoadUrl
amaitland 4a15eff
BrowserProcess - Add initial implementation of IRenderProcessHandler.…
amaitland 06b7711
BrowserProcess - Add wrappers for Browser and Frame
amaitland 5381539
CefSharp.Common.props - Add CefSharpBrowserProcessCore32/64 properties
amaitland 7f0ec78
BrowserProcess - Remove example and add comments about creating your …
amaitland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,221 @@ | ||
| // Copyright © 2015 The CefSharp Authors. All rights reserved. | ||
| // | ||
| // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | ||
|
|
||
| #include "Stdafx.h" | ||
|
|
||
| #include "Frame.h" | ||
| #include "Browser.h" | ||
|
|
||
| using namespace CefSharp::BrowserSubprocess; | ||
|
|
||
| /// | ||
| // Returns the browser host object. This method can only be called in the | ||
| // browser process. | ||
| /// | ||
| /*--cef()--*/ | ||
| IBrowserHost^ Browser::GetHost() | ||
| { | ||
| throw gcnew NotImplementedException("Browser process only"); | ||
| } | ||
|
|
||
| /// | ||
| // Returns true if the browser can navigate backwards. | ||
| /// | ||
| /*--cef()--*/ | ||
| bool Browser::CanGoBack::get() | ||
| { | ||
| return _browser->CanGoBack(); | ||
| } | ||
|
|
||
| /// | ||
| // Navigate backwards. | ||
| /// | ||
| /*--cef()--*/ | ||
| void Browser::GoBack() | ||
| { | ||
| _browser->GoBack(); | ||
| } | ||
|
|
||
| /// | ||
| // Returns true if the browser can navigate forwards. | ||
| /// | ||
| /*--cef()--*/ | ||
| bool Browser::CanGoForward::get() | ||
| { | ||
| return _browser->CanGoForward(); | ||
| } | ||
|
|
||
| /// | ||
| // Navigate forwards. | ||
| /// | ||
| /*--cef()--*/ | ||
| void Browser::GoForward() | ||
| { | ||
| _browser->GoForward(); | ||
| } | ||
|
|
||
| /// | ||
| // Returns true if the browser is currently loading. | ||
| /// | ||
| /*--cef()--*/ | ||
| bool Browser::IsLoading::get() | ||
| { | ||
| return _browser->IsLoading(); | ||
| } | ||
|
|
||
| void Browser::CloseBrowser(bool forceClose) | ||
| { | ||
| throw gcnew NotImplementedException("Browser process only"); | ||
| } | ||
|
|
||
| /// | ||
| // Reload the current page. | ||
| /// | ||
| /*--cef()--*/ | ||
| void Browser::Reload(bool ignoreCache) | ||
| { | ||
| if (ignoreCache) | ||
| { | ||
| _browser->ReloadIgnoreCache(); | ||
| } | ||
| else | ||
| { | ||
| _browser->Reload(); | ||
| } | ||
| } | ||
|
|
||
| /// | ||
| // Stop loading the page. | ||
| /// | ||
| /*--cef()--*/ | ||
| void Browser::StopLoad() | ||
| { | ||
| _browser->StopLoad(); | ||
| } | ||
|
|
||
| /// | ||
| // Returns the globally unique identifier for this browser. | ||
| /// | ||
| /*--cef()--*/ | ||
| int Browser::Identifier::get() | ||
| { | ||
| return _browser->GetIdentifier(); | ||
| } | ||
|
|
||
| /// | ||
| // Returns true if this object is pointing to the same handle as |that| | ||
| // object. | ||
| /// | ||
| /*--cef()--*/ | ||
| bool Browser::IsSame(IBrowser^ that) | ||
| { | ||
| return _browser->IsSame(dynamic_cast<Browser^>(that)->_browser.get()); | ||
| } | ||
|
|
||
| /// | ||
| // Returns true if the window is a popup window. | ||
| /// | ||
| /*--cef()--*/ | ||
| bool Browser::IsPopup::get() | ||
| { | ||
| return _browser->IsPopup(); | ||
| } | ||
|
|
||
| /// | ||
| // Returns true if a document has been loaded in the browser. | ||
| /// | ||
| /*--cef()--*/ | ||
| bool Browser::HasDocument::get() | ||
| { | ||
| return _browser->HasDocument(); | ||
| } | ||
|
|
||
| IFrame^ Browser::MainFrame::get() | ||
| { | ||
| auto frame = _browser->GetMainFrame(); | ||
| return gcnew Frame(frame); | ||
| } | ||
|
|
||
| /// | ||
| // Returns the focused frame for the browser window. | ||
| /// | ||
| /*--cef()--*/ | ||
| IFrame^ Browser::FocusedFrame::get() | ||
| { | ||
| return gcnew Frame(_browser->GetFocusedFrame()); | ||
| } | ||
|
|
||
| /// | ||
| // Returns the frame with the specified identifier, or NULL if not found. | ||
| /// | ||
| /*--cef(capi_name=get_frame_byident)--*/ | ||
| IFrame^ Browser::GetFrame(Int64 identifier) | ||
| { | ||
| auto frame = _browser->GetFrame(identifier); | ||
|
|
||
| if (frame.get()) | ||
| { | ||
| return gcnew Frame(frame); | ||
| } | ||
|
|
||
| return nullptr; | ||
| } | ||
|
|
||
| /// | ||
| // Returns the frame with the specified name, or NULL if not found. | ||
| /// | ||
| /*--cef(optional_param=name)--*/ | ||
| IFrame^ Browser::GetFrame(String^ name) | ||
| { | ||
| auto frame = _browser->GetFrame(StringUtils::ToNative(name)); | ||
|
|
||
| if (frame.get()) | ||
| { | ||
| return gcnew Frame(frame); | ||
| } | ||
|
|
||
| return nullptr; | ||
| } | ||
|
|
||
| /// | ||
| // Returns the number of frames that currently exist. | ||
| /// | ||
| /*--cef()--*/ | ||
| int Browser::GetFrameCount() | ||
| { | ||
| return _browser->GetFrameCount(); | ||
| } | ||
|
|
||
| /// | ||
| // Returns the identifiers of all existing frames. | ||
| /// | ||
| /*--cef(count_func=identifiers:GetFrameCount)--*/ | ||
| List<Int64>^ Browser::GetFrameIdentifiers() | ||
| { | ||
| std::vector<Int64> identifiers; | ||
| _browser->GetFrameIdentifiers(identifiers); | ||
| List<Int64>^ results = gcnew List<Int64>(identifiers.size()); | ||
| for (UINT i = 0; i < identifiers.size(); i++) | ||
| { | ||
| results->Add(identifiers[i]); | ||
| } | ||
| return results; | ||
| } | ||
|
|
||
| /// | ||
| // Returns the names of all existing frames. | ||
| /// | ||
| /*--cef()--*/ | ||
| List<String^>^ Browser::GetFrameNames() | ||
| { | ||
| std::vector<CefString> names; | ||
|
|
||
| _browser->GetFrameNames(names); | ||
| return StringUtils::ToClr(names); | ||
| } | ||
|
|
||
| bool Browser::IsDisposed::get() | ||
| { | ||
| return _disposed; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.