2014-10-31 18:17:05 +00:00
|
|
|
// Copyright (c) 2013 GitHub, Inc.
|
2014-04-25 09:49:37 +00:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
2013-05-02 16:05:09 +00:00
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_API_ELECTRON_API_APP_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_API_ELECTRON_API_APP_H_
|
2013-05-02 16:05:09 +00:00
|
|
|
|
2017-05-26 15:32:08 +00:00
|
|
|
#include <memory>
|
2024-01-10 22:23:35 +00:00
|
|
|
#include <optional>
|
2014-03-16 01:13:06 +00:00
|
|
|
#include <string>
|
2016-09-15 13:37:35 +00:00
|
|
|
#include <vector>
|
2014-03-16 01:13:06 +00:00
|
|
|
|
2024-01-05 11:18:31 +00:00
|
|
|
#include "base/containers/flat_map.h"
|
2017-02-16 19:19:19 +00:00
|
|
|
#include "base/task/cancelable_task_tracker.h"
|
2015-10-20 21:36:01 +00:00
|
|
|
#include "chrome/browser/process_singleton.h"
|
2017-05-16 00:41:45 +00:00
|
|
|
#include "content/public/browser/browser_child_process_observer.h"
|
2015-06-25 12:28:07 +00:00
|
|
|
#include "content/public/browser/gpu_data_manager_observer.h"
|
2017-05-16 00:41:45 +00:00
|
|
|
#include "content/public/browser/render_process_host.h"
|
2022-02-10 02:58:52 +00:00
|
|
|
#include "crypto/crypto_buildflags.h"
|
2019-04-20 17:20:37 +00:00
|
|
|
#include "net/base/completion_once_callback.h"
|
|
|
|
#include "net/base/completion_repeating_callback.h"
|
2017-08-20 21:35:04 +00:00
|
|
|
#include "net/ssl/client_cert_identity.h"
|
2019-06-19 20:46:59 +00:00
|
|
|
#include "shell/browser/browser.h"
|
|
|
|
#include "shell/browser/browser_observer.h"
|
|
|
|
#include "shell/browser/electron_browser_client.h"
|
2020-07-28 23:43:43 +00:00
|
|
|
#include "shell/browser/event_emitter_mixin.h"
|
2013-05-02 16:05:09 +00:00
|
|
|
|
2022-02-10 02:58:52 +00:00
|
|
|
#if BUILDFLAG(USE_NSS_CERTS)
|
2021-11-08 00:53:00 +00:00
|
|
|
#include "shell/browser/certificate_manager_model.h"
|
2016-04-19 05:17:28 +00:00
|
|
|
#endif
|
|
|
|
|
2014-08-19 13:26:45 +00:00
|
|
|
namespace base {
|
|
|
|
class FilePath;
|
|
|
|
}
|
|
|
|
|
2024-07-25 09:25:45 +00:00
|
|
|
namespace gfx {
|
|
|
|
class Image;
|
|
|
|
}
|
|
|
|
|
2024-07-29 17:42:57 +00:00
|
|
|
namespace gin {
|
|
|
|
template <typename T>
|
|
|
|
class Handle;
|
|
|
|
} // namespace gin
|
|
|
|
|
|
|
|
namespace gin_helper {
|
|
|
|
class Dictionary;
|
|
|
|
class ErrorThrower;
|
|
|
|
} // namespace gin_helper
|
|
|
|
|
2013-05-02 16:05:09 +00:00
|
|
|
namespace electron {
|
|
|
|
|
2024-07-25 09:25:45 +00:00
|
|
|
struct ProcessMetric;
|
|
|
|
|
2022-02-10 02:58:52 +00:00
|
|
|
#if BUILDFLAG(IS_WIN)
|
2016-08-12 09:31:17 +00:00
|
|
|
enum class JumpListResult : int;
|
|
|
|
#endif
|
|
|
|
|
2013-05-02 16:05:09 +00:00
|
|
|
namespace api {
|
|
|
|
|
2024-09-04 23:40:02 +00:00
|
|
|
class App final : public ElectronBrowserClient::Delegate,
|
|
|
|
public gin::Wrappable<App>,
|
|
|
|
public gin_helper::EventEmitterMixin<App>,
|
|
|
|
private BrowserObserver,
|
|
|
|
private content::GpuDataManagerObserver,
|
|
|
|
private content::BrowserChildProcessObserver {
|
2013-05-02 16:05:09 +00:00
|
|
|
public:
|
2018-04-18 01:44:10 +00:00
|
|
|
using FileIconCallback =
|
2019-04-27 04:42:56 +00:00
|
|
|
base::RepeatingCallback<void(v8::Local<v8::Value>, const gfx::Image&)>;
|
2016-11-02 18:57:16 +00:00
|
|
|
|
2019-10-24 05:47:58 +00:00
|
|
|
static gin::Handle<App> Create(v8::Isolate* isolate);
|
2020-05-19 17:18:12 +00:00
|
|
|
static App* Get();
|
2013-05-02 16:05:09 +00:00
|
|
|
|
2020-07-28 23:43:43 +00:00
|
|
|
// gin::Wrappable
|
|
|
|
static gin::WrapperInfo kWrapperInfo;
|
|
|
|
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
|
|
|
|
v8::Isolate* isolate) override;
|
|
|
|
const char* GetTypeName() override;
|
2016-04-25 01:17:54 +00:00
|
|
|
|
2022-02-10 02:58:52 +00:00
|
|
|
#if BUILDFLAG(USE_NSS_CERTS)
|
2016-04-18 05:11:31 +00:00
|
|
|
void OnCertificateManagerModelCreated(
|
2020-04-13 20:52:07 +00:00
|
|
|
base::Value options,
|
2019-04-20 17:20:37 +00:00
|
|
|
net::CompletionOnceCallback callback,
|
2016-05-23 01:59:39 +00:00
|
|
|
std::unique_ptr<CertificateManagerModel> model);
|
2016-04-19 05:17:28 +00:00
|
|
|
#endif
|
2016-04-18 05:11:31 +00:00
|
|
|
|
2017-04-13 14:26:42 +00:00
|
|
|
base::FilePath GetAppPath() const;
|
2017-05-25 04:15:34 +00:00
|
|
|
void RenderProcessReady(content::RenderProcessHost* host);
|
2020-12-01 01:47:46 +00:00
|
|
|
void RenderProcessExited(content::RenderProcessHost* host);
|
2017-04-04 00:36:01 +00:00
|
|
|
|
2021-06-02 19:17:08 +00:00
|
|
|
static bool IsPackaged();
|
|
|
|
|
2020-07-28 23:43:43 +00:00
|
|
|
App();
|
2020-05-19 17:18:12 +00:00
|
|
|
|
2021-11-03 11:41:45 +00:00
|
|
|
// disable copy
|
|
|
|
App(const App&) = delete;
|
|
|
|
App& operator=(const App&) = delete;
|
|
|
|
|
2020-05-19 17:18:12 +00:00
|
|
|
private:
|
2016-04-25 01:17:54 +00:00
|
|
|
~App() override;
|
2013-05-03 02:53:54 +00:00
|
|
|
|
2014-11-16 14:45:29 +00:00
|
|
|
// BrowserObserver:
|
2015-02-26 03:33:42 +00:00
|
|
|
void OnBeforeQuit(bool* prevent_default) override;
|
2014-11-16 14:45:29 +00:00
|
|
|
void OnWillQuit(bool* prevent_default) override;
|
|
|
|
void OnWindowAllClosed() override;
|
|
|
|
void OnQuit() override;
|
|
|
|
void OnOpenFile(bool* prevent_default, const std::string& file_path) override;
|
|
|
|
void OnOpenURL(const std::string& url) override;
|
2015-09-15 02:05:53 +00:00
|
|
|
void OnActivate(bool has_visible_windows) override;
|
2014-11-16 14:45:29 +00:00
|
|
|
void OnWillFinishLaunching() override;
|
2022-06-23 06:28:41 +00:00
|
|
|
void OnFinishLaunching(base::Value::Dict launch_info) override;
|
2016-07-11 21:32:14 +00:00
|
|
|
void OnAccessibilitySupportChanged() override;
|
2017-09-15 19:33:12 +00:00
|
|
|
void OnPreMainMessageLoopRun() override;
|
2020-04-13 23:39:26 +00:00
|
|
|
void OnPreCreateThreads() override;
|
2022-02-10 02:58:52 +00:00
|
|
|
#if BUILDFLAG(IS_MAC)
|
2018-04-18 01:44:10 +00:00
|
|
|
void OnWillContinueUserActivity(bool* prevent_default,
|
|
|
|
const std::string& type) override;
|
|
|
|
void OnDidFailToContinueUserActivity(const std::string& type,
|
|
|
|
const std::string& error) override;
|
|
|
|
void OnContinueUserActivity(bool* prevent_default,
|
|
|
|
const std::string& type,
|
2022-06-23 06:28:41 +00:00
|
|
|
base::Value::Dict user_info,
|
|
|
|
base::Value::Dict details) override;
|
|
|
|
void OnUserActivityWasContinued(const std::string& type,
|
|
|
|
base::Value::Dict user_info) override;
|
|
|
|
void OnUpdateUserActivityState(bool* prevent_default,
|
|
|
|
const std::string& type,
|
|
|
|
base::Value::Dict user_info) override;
|
2017-06-11 08:19:01 +00:00
|
|
|
void OnNewWindowForTab() override;
|
2020-06-16 17:03:41 +00:00
|
|
|
void OnDidBecomeActive() override;
|
2023-04-18 14:53:39 +00:00
|
|
|
void OnDidResignActive() override;
|
2016-05-05 03:26:23 +00:00
|
|
|
#endif
|
2015-11-18 02:07:03 +00:00
|
|
|
|
|
|
|
// content::ContentBrowserClient:
|
2015-11-18 02:39:25 +00:00
|
|
|
void AllowCertificateError(
|
2016-03-08 14:28:53 +00:00
|
|
|
content::WebContents* web_contents,
|
2015-11-18 02:39:25 +00:00
|
|
|
int cert_error,
|
|
|
|
const net::SSLInfo& ssl_info,
|
|
|
|
const GURL& request_url,
|
2019-05-13 21:24:39 +00:00
|
|
|
bool is_main_frame_request,
|
2015-11-18 02:39:25 +00:00
|
|
|
bool strict_enforcement,
|
2019-12-11 00:22:35 +00:00
|
|
|
base::OnceCallback<void(content::CertificateRequestResultType)> callback)
|
|
|
|
override;
|
2019-07-03 01:22:09 +00:00
|
|
|
base::OnceClosure SelectClientCertificate(
|
2023-07-20 07:36:59 +00:00
|
|
|
content::BrowserContext* browser_context,
|
chore: bump chromium to 128.0.6611.0 (main) (#42779)
* chore: bump chromium in DEPS to 128.0.6577.0
* chore: bump chromium in DEPS to 128.0.6579.0
* 5675706: Reland "Reland "Reland "Reland "Add toolchains without PartitionAlloc-Everywhere for dump_syms et al""""
https://chromium-review.googlesource.com/c/chromium/src/+/5675706
* 5668597: [PDF Ink Signatures] Prompt download menu on save when there are edits
https://chromium-review.googlesource.com/c/chromium/src/+/5668597
* 5677014: Reland "Pull data_sharing_sdk from CIPD"
https://chromium-review.googlesource.com/c/chromium/src/+/5677014
* chore: fixup patch indices
* chore: bump chromium in DEPS to 128.0.6581.0
* chore: bump chromium in DEPS to 128.0.6583.0
* update patches
* 5455480: [Extensions] Allow service worker requests to continue without a cert
https://chromium-review.googlesource.com/c/chromium/src/+/5455480
* try to get some debugging output from script/push-patch.js
* chore: bump chromium in DEPS to 128.0.6585.0
* chore: bump chromium in DEPS to 128.0.6587.0
* update patches
* chore: bump chromium in DEPS to 128.0.6589.0
* more patch work
* maybe over here?
* chore: update patches
* 5673207: [HTTPS Upgrades] Disable in captive portal login webview
https://chromium-review.googlesource.com/c/chromium/src/+/5673207
* 5636785: Extensions: WAR: manifest.json's use_dynamic_url requires a dynamic url
https://chromium-review.googlesource.com/c/chromium/src/+/5636785
* chore: bump chromium in DEPS to 128.0.6591.0
* 5665458: Trigger WN2 page when feature is enabled
https://chromium-review.googlesource.com/c/chromium/src/+/5665458
* update patches
* chore: bump chromium in DEPS to 128.0.6593.0
* chore: bump chromium in DEPS to 128.0.6595.0
* chore: bump chromium in DEPS to 128.0.6597.0
* (patch update) 5694586: [compile hints] Remove the usage of v8::Isolate::SetJavaScriptCompileHintsMagicEnabledCallback API
https://chromium-review.googlesource.com/c/chromium/src/+/5694586
* update patches
* 5691287: Reland "Change blink::WebKeyboardEvent to use std::array in is members"
https://chromium-review.googlesource.com/c/chromium/src/+/5691287
The code changed here is modeled after code in `content/renderer/pepper/event_conversion.cc` that was also modified in this CL, so I took the same approach.
* 5529018: Cleanup EnableWebHidOnExtensionServiceWorker flag
https://chromium-review.googlesource.com/c/chromium/src/+/5529018
* 5526324: [Code Health] Add deprecation comment for base::SupportsWeakPtr.
https://chromium-review.googlesource.com/c/chromium/src/+/5526324
Note that this CL actually does make `SupportsWeakPtr` strictly restricted to existing implementations, no new ones. We could add a patch to add ourselves to this list, but it looks like we'll have to refactor this anyways in the near future. Since the refactor seems straightforward, let's try that first.
* chore: bump chromium in DEPS to 128.0.6598.0
* chore: update patches
* 5704737: Rename ExclusiveAccessContext::GetActiveWebContents to avoid conflict
https://chromium-review.googlesource.com/c/chromium/src/+/5704737
* chore: bump chromium in DEPS to 128.0.6601.0
* chore: update patches
* Add `base::StringPiece` header includes
Chromium is working on replacing `base::StringPiece` with `std::string_view`. (See the Chromium Bug below.) They're currently running mass codemods (across many multiple changes) to replace uses of `StringPiece` with `string_view`, including removing the header include for `StringPiece` in those files. This cascades down to our files that were implicitly depending on those includes through some other include.
They're on track to eventually deprecate and remove `StringPiece` so our code should be converted, but that can be done as an upgrade follow-up task. For now, adding the header back to files that need it should suffice for minimal upgrade changes.
Chromium Bug: https://issues.chromium.org/issues/40506050
* 5702737: GlobalRequestID: Avoid unwanted inlining and narrowing int conversions
https://chromium-review.googlesource.com/c/chromium/src/+/5702737
contender for smallest commit 2024
* 5706534: Rename GlobalFeatures to GlobalDesktopFeatures.
https://chromium-review.googlesource.com/c/chromium/src/+/5706534
* 5691321: ui: remove params variants of SelectFile listener functions
https://chromium-review.googlesource.com/c/chromium/src/+/5691321
* 5714949: [Extensions] Display re-enable dialog for MV2 disabled stage
https://chromium-review.googlesource.com/c/chromium/src/+/5714949
* chore: update libc++ filenames
* patch: disable scope reuse & associated dchecks in v8 (hopefully temp, upgrade follow-up)
* fixup! Add `base::StringPiece` header includes
* update MAS patch
5710330: Add crash keys to debug NativeWidgetMacNSWindowBorderlessFrame exception
https://chromium-review.googlesource.com/c/chromium/src/+/5710330
* chore: bump chromium in DEPS to 128.0.6603.0
* chore: update patches
* 5713258: Reland "Preparation for decoupling creation/initialization of context"
https://chromium-review.googlesource.com/c/chromium/src/+/5713258
When destroying a context, it must already be shutdown, and this change enforces it with a new CHECK.
We were overriding `BrowserContextKeyedServiceFactory::BrowserContextShutdown` with an empty implementation, which differed from the default implementation that notifies the `KeyedServiceFactory` that the context has shutdown. Since we were missing this notification, the CHECK would later trip when the service was being destoryed because it was not registered as shutdown when it was shutdown.
* chore: bump chromium in DEPS to 128.0.6605.2
* chore: update patches
* refactor: linux open/save dialog patch
Our existing implementation was relying on an opaque `void* params` parameter that was passed through `ui::SelectFileDialog`.
Recently, that parameter has been getting removed:
- 5691321: ui: remove params variants of SelectFile listener functions | https://chromium-review.googlesource.com/c/chromium/src/+/5691321
- 5709097: ui: remove SelectFileDialog impl params | https://chromium-review.googlesource.com/c/chromium/src/+/5709097
- https://issues.chromium.org/issues/340178601 "reconsider SelectFileDialog"
This restructures the patch to work with mostly the same mechanics, but directly on the `ui::SelectFileDialog` object. This nets us some wins in terms of a smaller patch.
* 5713262: DevTools UI binding AIDA client event returns response
https://chromium-review.googlesource.com/c/chromium/src/+/5713262
* fixup! refactor: linux open/save dialog patch
* chore: bump chromium in DEPS to 128.0.6606.0
* chore: update patches
* fixup! refactor: linux open/save dialog patch
* chore: bump chromium in DEPS to 128.0.6607.0
* chore: update printing.patch
Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5722937
* fix: pwd error in electron-test, nan-test
fix: unshallow depot_tools before 3-way apply
* chore: e patches all
* fixup! fix: pwd error in electron-test, nan-test
* chore: bump chromium in DEPS to 128.0.6609.0
* chore: bump chromium in DEPS to 128.0.6611.0
* chore: update patches
* chore: update libcxx filenames
---------
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Alice Zhao <alice@makenotion.com>
2024-07-23 15:59:44 +00:00
|
|
|
int process_id,
|
2015-06-11 15:22:07 +00:00
|
|
|
content::WebContents* web_contents,
|
|
|
|
net::SSLCertRequestInfo* cert_request_info,
|
2021-06-01 01:46:25 +00:00
|
|
|
net::ClientCertIdentityList identities,
|
2016-05-23 01:59:39 +00:00
|
|
|
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
|
2017-12-07 04:12:38 +00:00
|
|
|
bool CanCreateWindow(content::RenderFrameHost* opener,
|
|
|
|
const GURL& opener_url,
|
|
|
|
const GURL& opener_top_level_frame_url,
|
2019-01-21 18:14:57 +00:00
|
|
|
const url::Origin& source_origin,
|
2017-12-07 04:12:38 +00:00
|
|
|
content::mojom::WindowContainerType container_type,
|
|
|
|
const GURL& target_url,
|
|
|
|
const content::Referrer& referrer,
|
|
|
|
const std::string& frame_name,
|
|
|
|
WindowOpenDisposition disposition,
|
|
|
|
const blink::mojom::WindowFeatures& features,
|
2020-03-26 18:05:45 +00:00
|
|
|
const std::string& raw_features,
|
2018-04-11 08:42:14 +00:00
|
|
|
const scoped_refptr<network::ResourceRequestBody>& body,
|
2017-12-07 04:12:38 +00:00
|
|
|
bool user_gesture,
|
|
|
|
bool opener_suppressed,
|
|
|
|
bool* no_javascript_access) override;
|
2014-11-16 14:45:29 +00:00
|
|
|
|
2015-06-25 12:28:07 +00:00
|
|
|
// content::GpuDataManagerObserver:
|
2019-05-18 01:06:48 +00:00
|
|
|
void OnGpuInfoUpdate() override;
|
2015-06-25 12:28:07 +00:00
|
|
|
|
2017-05-16 00:41:45 +00:00
|
|
|
// content::BrowserChildProcessObserver:
|
|
|
|
void BrowserChildProcessLaunchedAndConnected(
|
|
|
|
const content::ChildProcessData& data) override;
|
|
|
|
void BrowserChildProcessHostDisconnected(
|
|
|
|
const content::ChildProcessData& data) override;
|
2018-09-15 00:11:49 +00:00
|
|
|
void BrowserChildProcessCrashed(
|
|
|
|
const content::ChildProcessData& data,
|
|
|
|
const content::ChildProcessTerminationInfo& info) override;
|
|
|
|
void BrowserChildProcessKilled(
|
|
|
|
const content::ChildProcessData& data,
|
|
|
|
const content::ChildProcessTerminationInfo& info) override;
|
2017-05-16 00:41:45 +00:00
|
|
|
|
2014-04-17 09:13:46 +00:00
|
|
|
private:
|
2020-07-20 14:34:16 +00:00
|
|
|
void BrowserChildProcessCrashedOrKilled(
|
|
|
|
const content::ChildProcessData& data,
|
|
|
|
const content::ChildProcessTerminationInfo& info);
|
|
|
|
|
2017-04-13 01:59:12 +00:00
|
|
|
void SetAppPath(const base::FilePath& app_path);
|
2020-07-07 18:00:45 +00:00
|
|
|
void ChildProcessLaunched(int process_type,
|
2020-12-01 01:47:46 +00:00
|
|
|
int pid,
|
2020-07-07 18:00:45 +00:00
|
|
|
base::ProcessHandle handle,
|
2020-10-19 11:55:47 +00:00
|
|
|
const std::string& service_name = std::string(),
|
2020-07-07 18:00:45 +00:00
|
|
|
const std::string& name = std::string());
|
2020-12-01 01:47:46 +00:00
|
|
|
void ChildProcessDisconnected(int pid);
|
2017-04-04 00:36:01 +00:00
|
|
|
|
2019-09-06 05:52:54 +00:00
|
|
|
void SetAppLogsPath(gin_helper::ErrorThrower thrower,
|
2024-01-10 22:23:35 +00:00
|
|
|
std::optional<base::FilePath> custom_path);
|
2019-04-19 05:04:58 +00:00
|
|
|
|
2015-01-19 01:52:15 +00:00
|
|
|
// Get/Set the pre-defined path in PathService.
|
2019-09-06 05:52:54 +00:00
|
|
|
base::FilePath GetPath(gin_helper::ErrorThrower thrower,
|
|
|
|
const std::string& name);
|
|
|
|
void SetPath(gin_helper::ErrorThrower thrower,
|
2015-01-19 04:24:58 +00:00
|
|
|
const std::string& name,
|
|
|
|
const base::FilePath& path);
|
2015-01-19 01:52:15 +00:00
|
|
|
|
2014-09-18 11:12:24 +00:00
|
|
|
void SetDesktopName(const std::string& desktop_name);
|
2016-06-02 12:49:29 +00:00
|
|
|
std::string GetLocale();
|
2018-11-20 20:33:23 +00:00
|
|
|
std::string GetLocaleCountryCode();
|
2022-09-23 18:50:46 +00:00
|
|
|
std::string GetSystemLocale(gin_helper::ErrorThrower thrower) const;
|
2024-02-29 09:31:13 +00:00
|
|
|
void OnSecondInstance(base::CommandLine cmd,
|
2022-05-23 05:20:54 +00:00
|
|
|
const base::FilePath& cwd,
|
2024-04-15 17:32:48 +00:00
|
|
|
const std::vector<uint8_t> additional_data);
|
2018-05-07 15:29:18 +00:00
|
|
|
bool HasSingleInstanceLock() const;
|
2021-10-15 01:32:32 +00:00
|
|
|
bool RequestSingleInstanceLock(gin::Arguments* args);
|
2018-05-07 15:29:18 +00:00
|
|
|
void ReleaseSingleInstanceLock();
|
2020-07-28 23:43:43 +00:00
|
|
|
bool Relaunch(gin::Arguments* args);
|
2019-09-06 05:52:54 +00:00
|
|
|
void DisableHardwareAcceleration(gin_helper::ErrorThrower thrower);
|
|
|
|
void DisableDomainBlockingFor3DAPIs(gin_helper::ErrorThrower thrower);
|
2016-07-11 21:32:14 +00:00
|
|
|
bool IsAccessibilitySupportEnabled();
|
2019-09-06 05:52:54 +00:00
|
|
|
void SetAccessibilitySupportEnabled(gin_helper::ErrorThrower thrower,
|
|
|
|
bool enabled);
|
2024-03-22 13:00:21 +00:00
|
|
|
v8::Local<v8::Value> GetLoginItemSettings(gin::Arguments* args);
|
2022-02-10 02:58:52 +00:00
|
|
|
#if BUILDFLAG(USE_NSS_CERTS)
|
2020-04-13 20:52:07 +00:00
|
|
|
void ImportCertificate(gin_helper::ErrorThrower thrower,
|
|
|
|
base::Value options,
|
|
|
|
net::CompletionOnceCallback callback);
|
2016-04-19 05:17:28 +00:00
|
|
|
#endif
|
2018-12-05 16:50:12 +00:00
|
|
|
v8::Local<v8::Promise> GetFileIcon(const base::FilePath& path,
|
2020-07-28 23:43:43 +00:00
|
|
|
gin::Arguments* args);
|
2015-10-21 20:17:56 +00:00
|
|
|
|
2019-10-24 05:47:58 +00:00
|
|
|
std::vector<gin_helper::Dictionary> GetAppMetrics(v8::Isolate* isolate);
|
2017-05-30 20:00:55 +00:00
|
|
|
v8::Local<v8::Value> GetGPUFeatureStatus(v8::Isolate* isolate);
|
2018-09-27 14:59:23 +00:00
|
|
|
v8::Local<v8::Promise> GetGPUInfo(v8::Isolate* isolate,
|
|
|
|
const std::string& info_type);
|
2019-09-06 05:52:54 +00:00
|
|
|
void EnableSandbox(gin_helper::ErrorThrower thrower);
|
2019-05-01 23:34:42 +00:00
|
|
|
void SetUserAgentFallback(const std::string& user_agent);
|
|
|
|
std::string GetUserAgentFallback();
|
2024-02-22 17:08:25 +00:00
|
|
|
v8::Local<v8::Promise> SetProxy(gin::Arguments* args);
|
|
|
|
v8::Local<v8::Promise> ResolveProxy(gin::Arguments* args);
|
2017-04-17 11:59:16 +00:00
|
|
|
|
2022-02-10 02:58:52 +00:00
|
|
|
#if BUILDFLAG(IS_MAC)
|
2020-02-05 19:12:25 +00:00
|
|
|
void SetActivationPolicy(gin_helper::ErrorThrower thrower,
|
|
|
|
const std::string& policy);
|
2019-10-24 05:47:58 +00:00
|
|
|
bool MoveToApplicationsFolder(gin_helper::ErrorThrower, gin::Arguments* args);
|
2017-08-31 14:37:12 +00:00
|
|
|
bool IsInApplicationsFolder();
|
2019-02-14 22:29:20 +00:00
|
|
|
v8::Local<v8::Value> GetDockAPI(v8::Isolate* isolate);
|
|
|
|
v8::Global<v8::Value> dock_;
|
2017-08-31 14:37:12 +00:00
|
|
|
#endif
|
2019-03-14 20:39:52 +00:00
|
|
|
|
2022-02-10 02:58:52 +00:00
|
|
|
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
|
2021-06-02 07:16:33 +00:00
|
|
|
bool IsRunningUnderARM64Translation() const;
|
|
|
|
#endif
|
|
|
|
|
2022-11-14 20:46:52 +00:00
|
|
|
#if IS_MAS_BUILD()
|
2019-04-24 18:29:59 +00:00
|
|
|
base::RepeatingCallback<void()> StartAccessingSecurityScopedResource(
|
2020-07-28 23:43:43 +00:00
|
|
|
gin::Arguments* args);
|
2018-02-12 18:25:06 +00:00
|
|
|
#endif
|
2017-08-31 14:37:12 +00:00
|
|
|
|
2022-02-10 02:58:52 +00:00
|
|
|
#if BUILDFLAG(IS_WIN)
|
2016-08-12 09:31:17 +00:00
|
|
|
// Get the current Jump List settings.
|
|
|
|
v8::Local<v8::Value> GetJumpListSettings();
|
|
|
|
|
|
|
|
// Set or remove a custom Jump List for the application.
|
2020-07-28 23:43:43 +00:00
|
|
|
JumpListResult SetJumpList(v8::Local<v8::Value> val, gin::Arguments* args);
|
2022-02-10 02:58:52 +00:00
|
|
|
#endif // BUILDFLAG(IS_WIN)
|
2016-08-12 09:31:17 +00:00
|
|
|
|
2016-05-23 01:59:39 +00:00
|
|
|
std::unique_ptr<ProcessSingleton> process_singleton_;
|
2016-04-19 05:17:28 +00:00
|
|
|
|
2022-02-10 02:58:52 +00:00
|
|
|
#if BUILDFLAG(USE_NSS_CERTS)
|
2016-05-23 01:59:39 +00:00
|
|
|
std::unique_ptr<CertificateManagerModel> certificate_manager_model_;
|
2016-04-19 05:17:28 +00:00
|
|
|
#endif
|
2014-08-19 13:26:45 +00:00
|
|
|
|
2017-02-17 08:33:46 +00:00
|
|
|
// Tracks tasks requesting file icons.
|
|
|
|
base::CancelableTaskTracker cancelable_task_tracker_;
|
|
|
|
|
2017-04-13 01:59:12 +00:00
|
|
|
base::FilePath app_path_;
|
2017-04-04 00:36:01 +00:00
|
|
|
|
2024-01-05 11:18:31 +00:00
|
|
|
// pid -> electron::ProcessMetric
|
|
|
|
base::flat_map<int, std::unique_ptr<electron::ProcessMetric>> app_metrics_;
|
2017-05-16 00:41:45 +00:00
|
|
|
|
2020-04-13 23:39:26 +00:00
|
|
|
bool disable_hw_acceleration_ = false;
|
|
|
|
bool disable_domain_blocking_for_3DAPIs_ = false;
|
2022-08-19 22:45:58 +00:00
|
|
|
bool watch_singleton_socket_on_ready_ = false;
|
2013-05-02 16:05:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace api
|
|
|
|
|
|
|
|
} // namespace electron
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_APP_H_
|