parent
1381d16f9c
commit
9653f20995
4 changed files with 14 additions and 1 deletions
|
@ -41,6 +41,7 @@
|
||||||
#include "content/public/browser/render_process_host.h"
|
#include "content/public/browser/render_process_host.h"
|
||||||
#include "content/public/browser/render_view_host.h"
|
#include "content/public/browser/render_view_host.h"
|
||||||
#include "content/public/browser/render_widget_host_view.h"
|
#include "content/public/browser/render_widget_host_view.h"
|
||||||
|
#include "content/public/common/content_switches.h"
|
||||||
#include "content/public/common/renderer_preferences.h"
|
#include "content/public/common/renderer_preferences.h"
|
||||||
#include "content/public/common/user_agent.h"
|
#include "content/public/common/user_agent.h"
|
||||||
#include "ipc/ipc_message_macros.h"
|
#include "ipc/ipc_message_macros.h"
|
||||||
|
@ -351,9 +352,15 @@ void NativeWindow::AppendExtraCommandLineSwitches(
|
||||||
if (web_preferences_.IsEmpty())
|
if (web_preferences_.IsEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
bool b;
|
||||||
|
#if defined(OS_WIN)
|
||||||
|
// Check if DirectWrite is disabled.
|
||||||
|
if (web_preferences_.Get(switches::kDirectWrite, &b) && !b)
|
||||||
|
command_line->AppendSwitch(::switches::kDisableDirectWrite);
|
||||||
|
#endif
|
||||||
|
|
||||||
// This set of options are not availabe in WebPreferences, so we have to pass
|
// This set of options are not availabe in WebPreferences, so we have to pass
|
||||||
// them via command line and enable them in renderer procss.
|
// them via command line and enable them in renderer procss.
|
||||||
bool b;
|
|
||||||
for (size_t i = 0; i < arraysize(kWebRuntimeFeatures); ++i) {
|
for (size_t i = 0; i < arraysize(kWebRuntimeFeatures); ++i) {
|
||||||
const char* feature = kWebRuntimeFeatures[i];
|
const char* feature = kWebRuntimeFeatures[i];
|
||||||
if (web_preferences_.Get(feature, &b))
|
if (web_preferences_.Get(feature, &b))
|
||||||
|
|
|
@ -57,6 +57,9 @@ const char kEnableLargerThanScreen[] = "enable-larger-than-screen";
|
||||||
// Forces to use dark theme on Linux.
|
// Forces to use dark theme on Linux.
|
||||||
const char kDarkTheme[] = "dark-theme";
|
const char kDarkTheme[] = "dark-theme";
|
||||||
|
|
||||||
|
// Enable DirectWrite on Windows.
|
||||||
|
const char kDirectWrite[] = "direct-write";
|
||||||
|
|
||||||
// Web runtime features.
|
// Web runtime features.
|
||||||
const char kExperimentalFeatures[] = "experimental-features";
|
const char kExperimentalFeatures[] = "experimental-features";
|
||||||
const char kExperimentalCanvasFeatures[] = "experimental-canvas-features";
|
const char kExperimentalCanvasFeatures[] = "experimental-canvas-features";
|
||||||
|
|
|
@ -35,6 +35,7 @@ extern const char kZoomFactor[];
|
||||||
extern const char kAutoHideMenuBar[];
|
extern const char kAutoHideMenuBar[];
|
||||||
extern const char kEnableLargerThanScreen[];
|
extern const char kEnableLargerThanScreen[];
|
||||||
extern const char kDarkTheme[];
|
extern const char kDarkTheme[];
|
||||||
|
extern const char kDirectWrite[];
|
||||||
|
|
||||||
extern const char kExperimentalFeatures[];
|
extern const char kExperimentalFeatures[];
|
||||||
extern const char kExperimentalCanvasFeatures[];
|
extern const char kExperimentalCanvasFeatures[];
|
||||||
|
|
|
@ -86,6 +86,8 @@ normal browsers, see [Web Security](web-security.md) for more.
|
||||||
* `overlay-scrollbars` Boolean
|
* `overlay-scrollbars` Boolean
|
||||||
* `overlay-fullscreen-video` Boolean
|
* `overlay-fullscreen-video` Boolean
|
||||||
* `shared-worker` Boolean
|
* `shared-worker` Boolean
|
||||||
|
* `direct-write` Boolean - Whether the DirectWrite font rendering system on
|
||||||
|
Windows is enabled
|
||||||
|
|
||||||
Creates a new `BrowserWindow` with native properties set by the `options`.
|
Creates a new `BrowserWindow` with native properties set by the `options`.
|
||||||
Usually you only need to set the `width` and `height`, other properties will
|
Usually you only need to set the `width` and `height`, other properties will
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue