build: define compile time features with buildflag header (#14840)

* build: define compile time features with buildflag header

* refactor: switch to BUILDFLAG(ENABLE_DESKTOP_CAPTURER)

* refactor: switch to BUILDFLAG(ENABLE_RUN_AS_NODE)

* refactor: switch to BUILDFLAG(ENABLE_OSR)

* refactor: switch to BUILDFLAG(ENABLE_VIEW_API)

* refactor: switch to BUILDFLAG(ENABLE_PEPPER_FLASH)

* refactor: switch to BUILDFLAG(OVERRIDE_LOCATION_PROVIDER)

* refactor: switch to BUILDFLAG(ENABLE_PDF_VIEWER)
This commit is contained in:
Robo 2018-10-02 01:30:53 +05:30 committed by John Kleinschmidt
parent 4af922c9a2
commit a24ad6bc14
31 changed files with 172 additions and 209 deletions

View file

@ -52,6 +52,7 @@
#include "content/public/common/url_constants.h"
#include "content/public/common/web_preferences.h"
#include "device/geolocation/public/cpp/location_provider.h"
#include "electron/buildflags/buildflags.h"
#include "net/base/escape.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ppapi/host/ppapi_host.h"
@ -69,13 +70,13 @@
#include "net/ssl/client_cert_store.h"
#endif
#if defined(ENABLE_PEPPER_FLASH)
#if BUILDFLAG(ENABLE_PEPPER_FLASH)
#include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h"
#endif // defined(ENABLE_PEPPER_FLASH)
#endif // BUILDFLAG(ENABLE_PEPPER_FLASH)
#if defined(OVERRIDE_LOCATION_PROVIDER)
#if BUILDFLAG(OVERRIDE_LOCATION_PROVIDER)
#include "atom/browser/fake_location_provider.h"
#endif // defined(OVERRIDE_LOCATION_PROVIDER)
#endif // BUILDFLAG(OVERRIDE_LOCATION_PROVIDER)
using content::BrowserThread;
@ -360,7 +361,7 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
}
void AtomBrowserClient::DidCreatePpapiPlugin(content::BrowserPpapiHost* host) {
#if defined(ENABLE_PEPPER_FLASH)
#if BUILDFLAG(ENABLE_PEPPER_FLASH)
host->GetPpapiHost()->AddHostFactoryFilter(
base::WrapUnique(new ChromeBrowserPepperHostFactory(host)));
#endif
@ -510,7 +511,7 @@ std::unique_ptr<net::ClientCertStore> AtomBrowserClient::CreateClientCertStore(
std::unique_ptr<device::LocationProvider>
AtomBrowserClient::OverrideSystemLocationProvider() {
#if defined(OVERRIDE_LOCATION_PROVIDER)
#if BUILDFLAG(OVERRIDE_LOCATION_PROVIDER)
return std::make_unique<FakeLocationProvider>();
#else
return nullptr;