Delegating CreatePlatformProvider() to a CEF app

Think CEF could benefit from a new feature or capability? Discuss CEF feature requests here.

Delegating CreatePlatformProvider() to a CEF app

Postby hunterlaux » Sun Jun 06, 2021 2:51 am

For the chrome runtime, it would be neat if there could be a hook to override the behavior of ChromeBrowserPolicyConnector::CreatePlatformProvider(), so that platform policies can be easily specified from within the app. This would give control to almost all those juicy chrome policies that an app might depend upon and ensuring that it doesn't conflict with other copies of apps that may be installed on the system.
hunterlaux
Techie
 
Posts: 12
Joined: Fri Nov 17, 2017 5:50 pm

Re: Delegating CreatePlatformProvider() to a CEF app

Postby magreenblatt » Sun Jun 06, 2021 12:11 pm

Do you have a particular API in mind?
magreenblatt
Site Admin
 
Posts: 11087
Joined: Fri May 29, 2009 6:57 pm

Re: Delegating CreatePlatformProvider() to a CEF app

Postby hunterlaux » Sun Jun 06, 2021 6:51 pm

CEF uses command line options for most configurations. The CommandLinePolicyProvider is consistent with that philosophy.

Just spitballing here...
Code: Select all
std::vector<std::unique_ptr<policy::ConfigurationPolicyProvider>>
ChromeBrowserPolicyConnector::CreatePolicyProviders() {
  auto providers = BrowserPolicyConnector::CreatePolicyProviders();
+ if (cef::IsChromeRuntimeEnabled())
+ {
+   std::unique_ptr<CommandLinePolicyProvider> command_line_provider =
+   CommandLinePolicyProvider::CreateForTesting(
+     base::CommandLine::ForCurrentProcess());
+   );
+   command_line_provider_ = command_line_provider.get();
+   providers.push_back(std::move(command_line_provider));
+   return providers;
+ }
  std::unique_ptr<ConfigurationPolicyProvider> platform_provider =
      CreatePlatformProvider();
...
hunterlaux
Techie
 
Posts: 12
Joined: Fri Nov 17, 2017 5:50 pm


Return to Feature Request Forum

Who is online

Users browsing this forum: No registered users and 2 guests