From d37aa8bed9b3131cd254a5cf396da9a28534d9db Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 Nov 2015 22:17:27 +0800 Subject: [PATCH] Reorder switches --- atom/browser/api/atom_api_window.cc | 3 ++ atom/common/options_switches.cc | 63 +++++++++++++++-------------- atom/common/options_switches.h | 25 ++++++------ 3 files changed, 48 insertions(+), 43 deletions(-) diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index 497b5a6930ff..bd24b444db3a 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -60,7 +60,10 @@ void OnCapturePageDone( callback.Run(gfx::Image::CreateFrom1xBitmap(bitmap)); } +// Convert min-width to minWidth recursively in the dictionary. + #if defined(OS_WIN) +// Convert binary data to Buffer. v8::Local ToBuffer(v8::Isolate* isolate, void* val, int size) { auto buffer = node::Buffer::New(isolate, static_cast(val), size); if (buffer.IsEmpty()) diff --git a/atom/common/options_switches.cc b/atom/common/options_switches.cc index 903c15ee6dd1..9fe38cdfd352 100644 --- a/atom/common/options_switches.cc +++ b/atom/common/options_switches.cc @@ -34,8 +34,6 @@ const char kKiosk[] = "kiosk"; // Make windows stays on the top of all other windows. const char kAlwaysOnTop[] = "always-on-top"; -const char kNodeIntegration[] = "node-integration"; - // Enable the NSView to accept first mouse event. const char kAcceptFirstMouse[] = "accept-first-mouse"; @@ -45,12 +43,6 @@ const char kUseContentSize[] = "use-content-size"; // The requested title bar style for the window const char kTitleBarStyle[] = "title-bar-style"; -// The WebPreferences. -const char kWebPreferences[] = "web-preferences"; - -// The factor of which page should be zoomed. -const char kZoomFactor[] = "zoom-factor"; - // The menu bar is hidden unless "Alt" is pressed. const char kAutoHideMenuBar[] = "auto-hide-menu-bar"; @@ -60,27 +52,6 @@ const char kEnableLargerThanScreen[] = "enable-larger-than-screen"; // Forces to use dark theme on Linux. const char kDarkTheme[] = "dark-theme"; -// Enable DirectWrite on Windows. -const char kDirectWrite[] = "direct-write"; - -// Enable plugins. -const char kEnablePlugins[] = "enable-plugins"; - -// Ppapi Flash path. -const char kPpapiFlashPath[] = "ppapi-flash-path"; - -// Ppapi Flash version. -const char kPpapiFlashVersion[] = "ppapi-flash-version"; - -// Instancd ID of guest WebContents. -const char kGuestInstanceID[] = "guest-instance-id"; - -// Script that will be loaded by guest WebContents before other scripts. -const char kPreloadScript[] = "preload"; - -// Like --preload, but the passed argument is an URL. -const char kPreloadUrl[] = "preload-url"; - // Whether the window should be transparent. const char kTransparent[] = "transparent"; @@ -96,8 +67,23 @@ const char kStandardWindow[] = "standard-window"; // Default browser window background color. const char kBackgroundColor[] = "background-color"; -// Path to client certificate. -const char kClientCertificate[] = "client-certificate"; +// The WebPreferences. +const char kWebPreferences[] = "web-preferences"; + +// The factor of which page should be zoomed. +const char kZoomFactor[] = "zoom-factor"; + +// Script that will be loaded by guest WebContents before other scripts. +const char kPreloadScript[] = "preload"; + +// Like --preload, but the passed argument is an URL. +const char kPreloadUrl[] = "preload-url"; + +// Enable the node integration. +const char kNodeIntegration[] = "node-integration"; + +// Instancd ID of guest WebContents. +const char kGuestInstanceID[] = "guest-instance-id"; // Web runtime features. const char kExperimentalFeatures[] = "experimental-features"; @@ -106,9 +92,24 @@ const char kOverlayScrollbars[] = "overlay-scrollbars"; const char kOverlayFullscreenVideo[] = "overlay-fullscreen-video"; const char kSharedWorker[] = "shared-worker"; +// Enable plugins. +const char kEnablePlugins[] = "enable-plugins"; + +// Ppapi Flash path. +const char kPpapiFlashPath[] = "ppapi-flash-path"; + +// Ppapi Flash version. +const char kPpapiFlashVersion[] = "ppapi-flash-version"; + // Set page visiblity to always visible. const char kPageVisibility[] = "page-visibility"; +// Enable DirectWrite on Windows. +const char kDirectWrite[] = "direct-write"; + +// Path to client certificate. +const char kClientCertificate[] = "client-certificate"; + // Disable HTTP cache. const char kDisableHttpCache[] = "disable-http-cache"; diff --git a/atom/common/options_switches.h b/atom/common/options_switches.h index 9887359a502b..9f171836f653 100644 --- a/atom/common/options_switches.h +++ b/atom/common/options_switches.h @@ -27,41 +27,42 @@ extern const char kFullscreen[]; extern const char kSkipTaskbar[]; extern const char kKiosk[]; extern const char kAlwaysOnTop[]; -extern const char kNodeIntegration[]; extern const char kAcceptFirstMouse[]; extern const char kUseContentSize[]; extern const char kTitleBarStyle[]; -extern const char kWebPreferences[]; -extern const char kZoomFactor[]; extern const char kAutoHideMenuBar[]; extern const char kEnableLargerThanScreen[]; extern const char kDarkTheme[]; -extern const char kDirectWrite[]; -extern const char kEnablePlugins[]; -extern const char kPpapiFlashPath[]; -extern const char kPpapiFlashVersion[]; -extern const char kGuestInstanceID[]; -extern const char kPreloadScript[]; -extern const char kPreloadUrl[]; extern const char kTransparent[]; extern const char kType[]; extern const char kDisableAutoHideCursor[]; extern const char kStandardWindow[]; extern const char kBackgroundColor[]; -extern const char kClientCertificate[]; +extern const char kWebPreferences[]; +// WebPreferences. +extern const char kZoomFactor[]; +extern const char kPreloadScript[]; +extern const char kPreloadUrl[]; +extern const char kNodeIntegration[]; +extern const char kGuestInstanceID[]; extern const char kExperimentalFeatures[]; extern const char kExperimentalCanvasFeatures[]; extern const char kOverlayScrollbars[]; extern const char kOverlayFullscreenVideo[]; extern const char kSharedWorker[]; extern const char kPageVisibility[]; +extern const char kDirectWrite[]; +// Following are actually command line switches, should be moved to other files. +extern const char kEnablePlugins[]; +extern const char kPpapiFlashPath[]; +extern const char kPpapiFlashVersion[]; +extern const char kClientCertificate[]; extern const char kDisableHttpCache[]; extern const char kRegisterStandardSchemes[]; extern const char kSSLVersionFallbackMin[]; extern const char kCipherSuiteBlacklist[]; - extern const char kAppUserModelId[]; } // namespace switches