electron/shell/common/options_switches.cc

277 lines
8.3 KiB
C++
Raw Normal View History

// 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-04-12 07:04:46 +00:00
// found in the LICENSE file.
#include "shell/common/options_switches.h"
2013-04-12 07:04:46 +00:00
namespace electron {
2013-04-12 07:04:46 +00:00
namespace options {
2013-04-12 07:04:46 +00:00
2018-04-18 01:55:30 +00:00
const char kTitle[] = "title";
const char kIcon[] = "icon";
const char kFrame[] = "frame";
const char kShow[] = "show";
const char kCenter[] = "center";
const char kX[] = "x";
const char kY[] = "y";
const char kWidth[] = "width";
const char kHeight[] = "height";
const char kMinWidth[] = "minWidth";
const char kMinHeight[] = "minHeight";
const char kMaxWidth[] = "maxWidth";
const char kMaxHeight[] = "maxHeight";
const char kResizable[] = "resizable";
const char kMovable[] = "movable";
const char kMinimizable[] = "minimizable";
const char kMaximizable[] = "maximizable";
2016-01-23 07:47:37 +00:00
const char kFullScreenable[] = "fullscreenable";
2018-04-18 01:55:30 +00:00
const char kClosable[] = "closable";
const char kFullscreen[] = "fullscreen";
const char kTrafficLightPosition[] = "trafficLightPosition";
const char kRoundedCorners[] = "roundedCorners";
2013-04-12 07:04:46 +00:00
feat: enable windows control overlay on Windows (#29600) * rebase "feat: enable windows control overlay on Windows" * correct compilation error * fix linting errors * modify includes and build file * change `hidden` option to `overlay` * add patch to fix visual layout * add button background color parameter * add button text color parameter * modify `overlay` in docs and modify button hover/press transition color * change `text` to `symbol` * remove todo and fix `text` replacement * add new titleBarOverlay property and remove titleBarStyle `overlay` * update browser and frameless window docs * remove chromium patches * chore: update patches * change button hover color, update trailing `_`, update test file * add dchecks, update title bar drawing checks, update test file * modify for mac and linux builds * update docs with overlayColor and overlaySymbolColor * add corner and side hit test info * modify docs and copyright info * modify `titlebar_overlay_` as boolean or object * move `title_bar_style_ to `NativeWindow` * update docs with boolean and object titlebar_overlay_ * add `IsEmpty` checks * move get options for boolean and object checks * fix linting error * disable `use_lld` for macos * Update docs/api/frameless-window.md Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> * Update docs/api/frameless-window.md Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> * Update docs/api/frameless-window.md Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> * Apply docs suggestions from code review Co-authored-by: Jeremy Rose <jeremya@chromium.org> * modify `true` option description `titleBarOverlay` * ci: cleanup keychain after tests on arm64 mac (#30472) Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-08-11 18:07:36 +00:00
// The color to use as the theme and symbol colors respectively for Window
// Controls Overlay if enabled on Windows.
const char kOverlayButtonColor[] = "color";
const char kOverlaySymbolColor[] = "symbolColor";
// Whether the window should show in taskbar.
const char kSkipTaskbar[] = "skipTaskbar";
2013-04-12 07:04:46 +00:00
// Start with the kiosk mode, see Opera's page for description:
// http://www.opera.com/support/mastering/kiosk/
const char kKiosk[] = "kiosk";
const char kSimpleFullScreen[] = "simpleFullscreen";
2013-04-12 07:04:46 +00:00
// Make windows stays on the top of all other windows.
const char kAlwaysOnTop[] = "alwaysOnTop";
2013-04-12 07:04:46 +00:00
// Enable the NSView to accept first mouse event.
const char kAcceptFirstMouse[] = "acceptFirstMouse";
2014-05-15 07:18:46 +00:00
// Whether window size should include window frame.
const char kUseContentSize[] = "useContentSize";
2014-05-15 07:18:46 +00:00
2016-10-27 18:29:51 +00:00
// Whether window zoom should be to page width.
const char kZoomToPageWidth[] = "zoomToPageWidth";
// Whether always show title text in full screen is enabled.
2017-07-14 18:49:40 +00:00
const char kFullscreenWindowTitle[] = "fullscreenWindowTitle";
// The requested title bar style for the window
const char kTitleBarStyle[] = "titleBarStyle";
2017-03-27 14:15:17 +00:00
// Tabbing identifier for the window if native tabs are enabled on macOS.
const char kTabbingIdentifier[] = "tabbingIdentifier";
// The menu bar is hidden unless "Alt" is pressed.
const char kAutoHideMenuBar[] = "autoHideMenuBar";
// Enable window to be resized larger than screen.
const char kEnableLargerThanScreen[] = "enableLargerThanScreen";
// Forces to use dark theme on Linux.
const char kDarkTheme[] = "darkTheme";
2014-12-23 01:48:54 +00:00
// Whether the window should be transparent.
const char kTransparent[] = "transparent";
// Window type hint.
const char kType[] = "type";
2015-04-27 04:08:22 +00:00
// Disable auto-hiding cursor.
const char kDisableAutoHideCursor[] = "disableAutoHideCursor";
2015-04-27 04:08:22 +00:00
2016-06-18 13:28:22 +00:00
// Use the macOS' standard window instead of the textured window.
const char kStandardWindow[] = "standardWindow";
// Default browser window background color.
const char kBackgroundColor[] = "backgroundColor";
// Whether the window should have a shadow.
const char kHasShadow[] = "hasShadow";
2017-09-29 02:26:02 +00:00
// Browser window opacity
const char kOpacity[] = "opacity";
2016-06-13 08:10:28 +00:00
// Whether the window can be activated.
const char kFocusable[] = "focusable";
2015-11-10 14:17:27 +00:00
// The WebPreferences.
const char kWebPreferences[] = "webPreferences";
2015-11-10 14:17:27 +00:00
2016-11-07 20:22:41 +00:00
// Add a vibrancy effect to the browser window
const char kVibrancyType[] = "vibrancy";
// Specify how the material appearance should reflect window activity state on
// macOS.
const char kVisualEffectState[] = "visualEffectState";
2015-11-10 14:17:27 +00:00
// The factor of which page should be zoomed.
const char kZoomFactor[] = "zoomFactor";
2015-11-10 14:17:27 +00:00
// Script that will be loaded by guest WebContents before other scripts.
const char kPreloadScript[] = "preload";
const char kPreloadScripts[] = "preloadScripts";
2015-11-10 14:17:27 +00:00
// Like --preload, but the passed argument is an URL.
2015-11-13 08:03:40 +00:00
const char kPreloadURL[] = "preloadURL";
2015-11-10 14:17:27 +00:00
// Enable the node integration.
const char kNodeIntegration[] = "nodeIntegration";
2015-11-10 14:17:27 +00:00
2016-12-15 21:20:17 +00:00
// Enable context isolation of Electron APIs and preload script
const char kContextIsolation[] = "contextIsolation";
2014-09-09 05:21:15 +00:00
// Web runtime features.
2018-04-18 01:55:30 +00:00
const char kExperimentalFeatures[] = "experimentalFeatures";
2014-09-09 02:33:31 +00:00
// Enable the rubber banding effect.
const char kScrollBounce[] = "scrollBounce";
2016-01-07 06:10:18 +00:00
// Enable blink features.
2018-05-25 18:13:15 +00:00
const char kEnableBlinkFeatures[] = "enableBlinkFeatures";
2016-01-07 06:10:18 +00:00
2016-06-07 20:42:42 +00:00
// Disable blink features.
const char kDisableBlinkFeatures[] = "disableBlinkFeatures";
2017-03-15 09:51:21 +00:00
// Enable the node integration in WebWorker.
const char kNodeIntegrationInWorker[] = "nodeIntegrationInWorker";
// Enable the web view tag.
const char kWebviewTag[] = "webviewTag";
const char kCustomArgs[] = "additionalArguments";
const char kPlugins[] = "plugins";
const char kSandbox[] = "sandbox";
const char kWebSecurity[] = "webSecurity";
const char kAllowRunningInsecureContent[] = "allowRunningInsecureContent";
const char kOffscreen[] = "offscreen";
const char kNodeIntegrationInSubFrames[] = "nodeIntegrationInSubFrames";
// Disable window resizing when HTML Fullscreen API is activated.
const char kDisableHtmlFullscreenWindowResize[] =
"disableHtmlFullscreenWindowResize";
// Enables JavaScript support.
const char kJavaScript[] = "javascript";
// Enables image support.
const char kImages[] = "images";
// Image animation policy.
const char kImageAnimationPolicy[] = "imageAnimationPolicy";
// Make TextArea elements resizable.
const char kTextAreasAreResizable[] = "textAreasAreResizable";
// Enables WebGL support.
const char kWebGL[] = "webgl";
// Whether dragging and dropping a file or link onto the page causes a
// navigation.
const char kNavigateOnDragDrop[] = "navigateOnDragDrop";
const char kHiddenPage[] = "hiddenPage";
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
const char kSpellcheck[] = "spellcheck";
#endif
const char kEnableWebSQL[] = "enableWebSQL";
const char kEnablePreferredSizeMode[] = "enablePreferredSizeMode";
const char ktitleBarOverlay[] = "titleBarOverlay";
} // namespace options
namespace switches {
// Enable chromium sandbox.
const char kEnableSandbox[] = "enable-sandbox";
2015-11-10 14:17:27 +00:00
// Ppapi Flash path.
const char kPpapiFlashPath[] = "ppapi-flash-path";
// Ppapi Flash version.
const char kPpapiFlashVersion[] = "ppapi-flash-version";
// Disable HTTP cache.
const char kDisableHttpCache[] = "disable-http-cache";
// The list of standard schemes.
const char kStandardSchemes[] = "standard-schemes";
// Register schemes to handle service worker.
const char kServiceWorkerSchemes[] = "service-worker-schemes";
// Register schemes as secure.
const char kSecureSchemes[] = "secure-schemes";
// Register schemes as bypassing CSP.
const char kBypassCSPSchemes[] = "bypasscsp-schemes";
// Register schemes as support fetch API.
const char kFetchSchemes[] = "fetch-schemes";
// Register schemes as CORS enabled.
const char kCORSSchemes[] = "cors-schemes";
// Register schemes as streaming responses.
const char kStreamingSchemes[] = "streaming-schemes";
// The browser process app model ID
const char kAppUserModelId[] = "app-user-model-id";
2017-04-04 00:36:01 +00:00
// The application path
const char kAppPath[] = "app-path";
// The command line switch versions of the options.
2018-04-18 01:55:30 +00:00
const char kScrollBounce[] = "scroll-bounce";
2017-03-15 09:51:21 +00:00
// Command switch passed to renderer process to control nodeIntegration.
2018-04-18 01:55:30 +00:00
const char kNodeIntegrationInWorker[] = "node-integration-in-worker";
2017-03-15 09:51:21 +00:00
// Widevine options
// Path to Widevine CDM binaries.
const char kWidevineCdmPath[] = "widevine-cdm-path";
// Widevine CDM version.
const char kWidevineCdmVersion[] = "widevine-cdm-version";
// Forces the maximum disk space to be used by the disk cache, in bytes.
const char kDiskCacheSize[] = "disk-cache-size";
// Ignore the limit of 6 connections per host.
const char kIgnoreConnectionsLimit[] = "ignore-connections-limit";
// Whitelist containing servers for which Integrated Authentication is enabled.
const char kAuthServerWhitelist[] = "auth-server-whitelist";
// Whitelist containing servers for which Kerberos delegation is allowed.
const char kAuthNegotiateDelegateWhitelist[] =
"auth-negotiate-delegate-whitelist";
// If set, include the port in generated Kerberos SPNs.
const char kEnableAuthNegotiatePort[] = "enable-auth-negotiate-port";
// If set, NTLM v2 is disabled for POSIX platforms.
const char kDisableNTLMv2[] = "disable-ntlm-v2";
const char kGlobalCrashKeys[] = "global-crash-keys";
const char kEnableWebSQL[] = "enable-websql";
2013-04-12 07:04:46 +00:00
} // namespace switches
} // namespace electron