-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Implement CefGeolocationHandler::OnRequestGeolocationPermission #768
Conversation
…ating the request to a CefSharp.IGeolocationHandler implementation. This allows CefSharp to permit geolocation requests.
Geolocation requests with the option {enableHighAccuracy: false} work as expected. A call to the google api domain is made which fails if the google api key isn't set. There's information about setting the google api key here: http://www.chromium.org/developers/how-tos/api-keys . I can add a wiki entry on the subject once (if?) the PR is accepted. I haven't yet confirmed {enableHighAccuracy: true} working as expected on a device with GPS as I don't have one available to test with. I might be able to get one in the future. |
@pushplay Looks great, let's merge this before the |
return false; | ||
} | ||
|
||
if (handler->OnRequestGeolocationPermission(_browserControl, StringUtils::ToClr(requesting_url), request_id)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brace on new line please 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amaitland done 👍
Thanks, will take it for a spin when I get a chance 👍 |
@pushplay excellent looking (first?) PR, 👍 really happy to have people doing stuff like that in the community 😄 |
It was totally selfish. I needed it to work, so I did it. :) |
😄 I like that kind of selfishness |
I was able to get this going in so far as seeing my CefSharp geolocation API requests showing as 4xx client errors in the Google dev console... looks like I have to "contact sales" to get actual quota for that API 😄
// Set Google API keys, used for Geolocation requests. See http://www.chromium.org/developers/how-tos/api-keys
// Environment.SetEnvironmentVariable("GOOGLE_API_KEY", "");
// Environment.SetEnvironmentVariable("GOOGLE_DEFAULT_CLIENT_ID", "");
// Environment.SetEnvironmentVariable("GOOGLE_DEFAULT_CLIENT_SECRET", "");
|
BTW, really good PR! 👍 |
Nice touch, I like it 👍
Can you use the |
I haven't used UI elements from both in a project, but I have had references to both in a project and it leads to some confusing Intellisense results. |
Sorry, I misread the WPF GeolocationHandler as using the WinForms MessageBox already. Disregard that point 🙊 😄 |
@pushplay Do you mind making the first two changes @jankurianski suggested? After that I think this can be merged 👍 |
@amaitland Sure I'll look into it tomorrow. |
@pushplay Fantastic thanks! 👍 @jankurianski When your happy feel free to test out that shiny new merge button 😄 |
Implement CefGeolocationHandler::OnRequestGeolocationPermission
@pushplay Greatly appreciated 😄 @jankurianski excellent suggestions 👍 |
delegating the request to a CefSharp.IGeolocationHandler implementation. This allows CefSharp to permit geolocation requests.
This implements #332 .