Use minWidth style for options instead of min-width

This commit is contained in:
Cheng Zhao 2015-11-10 22:23:21 +08:00
parent d37aa8bed9
commit 737e22b003
6 changed files with 39 additions and 39 deletions

View file

@ -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

View file

@ -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|.

View file

@ -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;
}

View file

@ -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";

View file

@ -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

View file

@ -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) ->