From 737e22b003a0a0f943e956b7d92b5216a77cdc5e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 Nov 2015 22:23:21 +0800 Subject: [PATCH] Use minWidth style for options instead of min-width --- atom/browser/lib/guest-view-manager.coffee | 10 ++-- atom/browser/lib/guest-window-manager.coffee | 4 +- atom/browser/web_contents_preferences.cc | 8 ++-- atom/common/options_switches.cc | 50 ++++++++++---------- atom/renderer/lib/init.coffee | 4 +- spec/chromium-spec.coffee | 2 +- 6 files changed, 39 insertions(+), 39 deletions(-) diff --git a/atom/browser/lib/guest-view-manager.coffee b/atom/browser/lib/guest-view-manager.coffee index c99b681498e4..8b2658a180cf 100644 --- a/atom/browser/lib/guest-view-manager.coffee +++ b/atom/browser/lib/guest-view-manager.coffee @@ -118,11 +118,11 @@ attachGuest = (embedder, elementInstanceId, guestInstanceId, params) -> destroyGuest embedder, oldGuestInstanceId webPreferences = - 'guest-instance-id': guestInstanceId - 'node-integration': params.nodeintegration ? false - 'plugins': params.plugins - 'web-security': !params.disablewebsecurity - webPreferences['preload-url'] = params.preload if params.preload + guestInstanceId: guestInstanceId + nodeIntegration: params.nodeintegration ? false + plugins: params.plugins + webSecurity: !params.disablewebsecurity + webPreferences.preloadUrl = params.preload if params.preload webViewManager.addGuest guestInstanceId, elementInstanceId, embedder, guest, webPreferences guest.attachParams = params diff --git a/atom/browser/lib/guest-window-manager.coffee b/atom/browser/lib/guest-window-manager.coffee index fe01c6fa771e..f2c5fe3a43cd 100644 --- a/atom/browser/lib/guest-window-manager.coffee +++ b/atom/browser/lib/guest-window-manager.coffee @@ -11,8 +11,8 @@ mergeBrowserWindowOptions = (embedder, options) -> options.__proto__ = embedder.browserWindowOptions else # Or only inherit web-preferences if it is a webview. - options['web-preferences'] ?= {} - options['web-preferences'].__proto__ = embedder.getWebPreferences() + options.webPreferences ?= {} + options.webPreferences.__proto__ = embedder.getWebPreferences() options # Create a new guest created by |embedder| with |options|. diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index 14e32353af65..a0088221ba2c 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -135,21 +135,21 @@ void WebContentsPreferences::OverrideWebkitPrefs( prefs->images_enabled = b; if (self->web_preferences_.GetBoolean("java", &b)) prefs->java_enabled = b; - if (self->web_preferences_.GetBoolean("text-areas-are-resizable", &b)) + if (self->web_preferences_.GetBoolean("textAreasAreResizable", &b)) prefs->text_areas_are_resizable = b; if (self->web_preferences_.GetBoolean("webgl", &b)) prefs->experimental_webgl_enabled = b; if (self->web_preferences_.GetBoolean("webaudio", &b)) prefs->webaudio_enabled = b; - if (self->web_preferences_.GetBoolean("web-security", &b)) { + if (self->web_preferences_.GetBoolean("webSecurity", &b)) { prefs->web_security_enabled = b; prefs->allow_displaying_insecure_content = !b; prefs->allow_running_insecure_content = !b; } - if (self->web_preferences_.GetBoolean("allow-displaying-insecure-content", + if (self->web_preferences_.GetBoolean("allowDisplayingInsecureContent", &b)) prefs->allow_displaying_insecure_content = b; - if (self->web_preferences_.GetBoolean("allow-running-insecure-content", &b)) + if (self->web_preferences_.GetBoolean("allowRunningInsecureContent", &b)) prefs->allow_running_insecure_content = b; } diff --git a/atom/common/options_switches.cc b/atom/common/options_switches.cc index 9fe38cdfd352..9b3b50b4bf31 100644 --- a/atom/common/options_switches.cc +++ b/atom/common/options_switches.cc @@ -17,40 +17,40 @@ const char kX[] = "x"; const char kY[] = "y"; const char kWidth[] = "width"; const char kHeight[] = "height"; -const char kMinWidth[] = "min-width"; -const char kMinHeight[] = "min-height"; -const char kMaxWidth[] = "max-width"; -const char kMaxHeight[] = "max-height"; +const char kMinWidth[] = "minWidth"; +const char kMinHeight[] = "minHeight"; +const char kMaxWidth[] = "maxWidth"; +const char kMaxHeight[] = "maxHeight"; const char kResizable[] = "resizable"; const char kFullscreen[] = "fullscreen"; // Whether the window should show in taskbar. -const char kSkipTaskbar[] = "skip-taskbar"; +const char kSkipTaskbar[] = "skipTaskbar"; // Start with the kiosk mode, see Opera's page for description: // http://www.opera.com/support/mastering/kiosk/ const char kKiosk[] = "kiosk"; // Make windows stays on the top of all other windows. -const char kAlwaysOnTop[] = "always-on-top"; +const char kAlwaysOnTop[] = "alwaysOnTop"; // Enable the NSView to accept first mouse event. -const char kAcceptFirstMouse[] = "accept-first-mouse"; +const char kAcceptFirstMouse[] = "acceptFirstMouse"; // Whether window size should include window frame. -const char kUseContentSize[] = "use-content-size"; +const char kUseContentSize[] = "useContentSize"; // The requested title bar style for the window -const char kTitleBarStyle[] = "title-bar-style"; +const char kTitleBarStyle[] = "titleBarStyle"; // The menu bar is hidden unless "Alt" is pressed. -const char kAutoHideMenuBar[] = "auto-hide-menu-bar"; +const char kAutoHideMenuBar[] = "autoHideMenuBar"; // Enable window to be resized larger than screen. -const char kEnableLargerThanScreen[] = "enable-larger-than-screen"; +const char kEnableLargerThanScreen[] = "enableLargerThanScreen"; // Forces to use dark theme on Linux. -const char kDarkTheme[] = "dark-theme"; +const char kDarkTheme[] = "darkTheme"; // Whether the window should be transparent. const char kTransparent[] = "transparent"; @@ -59,38 +59,38 @@ const char kTransparent[] = "transparent"; const char kType[] = "type"; // Disable auto-hiding cursor. -const char kDisableAutoHideCursor[] = "disable-auto-hide-cursor"; +const char kDisableAutoHideCursor[] = "disableAutoHideCursor"; // Use the OS X's standard window instead of the textured window. -const char kStandardWindow[] = "standard-window"; +const char kStandardWindow[] = "standardWindow"; // Default browser window background color. -const char kBackgroundColor[] = "background-color"; +const char kBackgroundColor[] = "backgroundColor"; // The WebPreferences. -const char kWebPreferences[] = "web-preferences"; +const char kWebPreferences[] = "webPreferences"; // The factor of which page should be zoomed. -const char kZoomFactor[] = "zoom-factor"; +const char kZoomFactor[] = "zoomFactor"; // 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"; +const char kPreloadUrl[] = "preloadUrl"; // Enable the node integration. -const char kNodeIntegration[] = "node-integration"; +const char kNodeIntegration[] = "nodeIntegration"; // Instancd ID of guest WebContents. -const char kGuestInstanceID[] = "guest-instance-id"; +const char kGuestInstanceID[] = "guestInstanceId"; // Web runtime features. -const char kExperimentalFeatures[] = "experimental-features"; -const char kExperimentalCanvasFeatures[] = "experimental-canvas-features"; -const char kOverlayScrollbars[] = "overlay-scrollbars"; -const char kOverlayFullscreenVideo[] = "overlay-fullscreen-video"; -const char kSharedWorker[] = "shared-worker"; +const char kExperimentalFeatures[] = "experimentalFeatures"; +const char kExperimentalCanvasFeatures[] = "experimentalCanvasFeatures"; +const char kOverlayScrollbars[] = "overlayScrollbars"; +const char kOverlayFullscreenVideo[] = "overlayFullscreenVideo"; +const char kSharedWorker[] = "sharedWorker"; // Enable plugins. const char kEnablePlugins[] = "enable-plugins"; diff --git a/atom/renderer/lib/init.coffee b/atom/renderer/lib/init.coffee index b7224b39aeed..ed3482fb972b 100644 --- a/atom/renderer/lib/init.coffee +++ b/atom/renderer/lib/init.coffee @@ -25,10 +25,10 @@ v8Util.setHiddenValue global, 'ipc', new events.EventEmitter # Process command line arguments. nodeIntegration = 'false' for arg in process.argv - if arg.indexOf('--guest-instance-id=') == 0 + if arg.indexOf('--guestInstanceId=') == 0 # This is a guest web view. process.guestInstanceId = parseInt arg.substr(arg.indexOf('=') + 1) - else if arg.indexOf('--node-integration=') == 0 + else if arg.indexOf('--nodeIntegration=') == 0 nodeIntegration = arg.substr arg.indexOf('=') + 1 else if arg.indexOf('--preload=') == 0 preloadScript = arg.substr arg.indexOf('=') + 1 diff --git a/spec/chromium-spec.coffee b/spec/chromium-spec.coffee index a034f9378235..09bae3d92e7e 100644 --- a/spec/chromium-spec.coffee +++ b/spec/chromium-spec.coffee @@ -70,7 +70,7 @@ describe 'chromium feature', -> b.close() done() window.addEventListener 'message', listener - b = window.open "file://#{fixtures}/pages/window-opener-node.html", '', 'node-integration=no,show=no' + b = window.open "file://#{fixtures}/pages/window-opener-node.html", '', 'nodeIntegration=no,show=no' it 'inherit options of parent window', (done) -> listener = (event) ->