refactor: mojofy autofill renderer->browser (#18760)

* re-implement renderer->browser calls with mojo

* lint

* fix: clean up after rebase

* lint

* fix: lazy load autofill drivers
This commit is contained in:
Heilig Benedek 2019-08-19 22:13:24 +02:00 committed by Shelley Vohr
parent 43e6d7fe88
commit b33558d822
14 changed files with 329 additions and 98 deletions

View file

@ -53,6 +53,7 @@
#include "shell/browser/api/atom_api_protocol_ns.h"
#include "shell/browser/api/atom_api_web_contents.h"
#include "shell/browser/api/atom_api_web_request_ns.h"
#include "shell/browser/atom_autofill_driver_factory.h"
#include "shell/browser/atom_browser_context.h"
#include "shell/browser/atom_browser_main_parts.h"
#include "shell/browser/atom_navigation_throttle.h"
@ -74,6 +75,7 @@
#include "shell/browser/web_contents_permission_helper.h"
#include "shell/browser/web_contents_preferences.h"
#include "shell/browser/window_list.h"
#include "shell/common/api/api.mojom.h"
#include "shell/common/application_info.h"
#include "shell/common/options_switches.h"
#include "shell/common/platform_util.h"
@ -1047,6 +1049,20 @@ bool AtomBrowserClient::PreSpawnRenderer(sandbox::TargetPolicy* policy) {
}
#endif // defined(OS_WIN)
bool AtomBrowserClient::BindAssociatedInterfaceRequestFromFrame(
content::RenderFrameHost* render_frame_host,
const std::string& interface_name,
mojo::ScopedInterfaceEndpointHandle* handle) {
if (interface_name == mojom::ElectronAutofillDriver::Name_) {
AutofillDriverFactory::BindAutofillDriver(
mojom::ElectronAutofillDriverAssociatedRequest(std::move(*handle)),
render_frame_host);
return true;
}
return false;
}
std::string AtomBrowserClient::GetApplicationLocale() {
if (BrowserThread::CurrentlyOn(BrowserThread::IO))
return g_io_thread_application_locale.Get();