Fix remove boolean parameter at IsSwitchEnabled function
This commit is contained in:
parent
2384c9f493
commit
16eafdb0ce
1 changed files with 14 additions and 24 deletions
|
@ -39,16 +39,8 @@ namespace atom {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
bool IsSwitchEnabled(base::CommandLine* command_line,
|
bool IsSwitchEnabled(base::CommandLine* command_line,
|
||||||
const char* switch_string,
|
const char* switch_string) {
|
||||||
bool* enabled) {
|
return command_line->GetSwitchValueASCII(switch_string) == "true";
|
||||||
std::string value = command_line->GetSwitchValueASCII(switch_string);
|
|
||||||
if (value == "true")
|
|
||||||
*enabled = true;
|
|
||||||
else if (value == "false")
|
|
||||||
*enabled = false;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper class to forward the messages to the client.
|
// Helper class to forward the messages to the client.
|
||||||
|
@ -216,10 +208,8 @@ bool AtomRendererClient::ShouldOverridePageVisibilityState(
|
||||||
const content::RenderFrame* render_frame,
|
const content::RenderFrame* render_frame,
|
||||||
blink::WebPageVisibilityState* override_state) {
|
blink::WebPageVisibilityState* override_state) {
|
||||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||||
bool b;
|
|
||||||
|
|
||||||
if (IsSwitchEnabled(command_line, switches::kPageVisibility, &b)
|
if (IsSwitchEnabled(command_line, switches::kPageVisibility)) {
|
||||||
&& b) {
|
|
||||||
*override_state = blink::WebPageVisibilityStateVisible;
|
*override_state = blink::WebPageVisibilityStateVisible;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -229,17 +219,17 @@ bool AtomRendererClient::ShouldOverridePageVisibilityState(
|
||||||
|
|
||||||
void AtomRendererClient::EnableWebRuntimeFeatures() {
|
void AtomRendererClient::EnableWebRuntimeFeatures() {
|
||||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||||
bool b;
|
|
||||||
if (IsSwitchEnabled(command_line, switches::kExperimentalFeatures, &b))
|
if (IsSwitchEnabled(command_line, switches::kExperimentalFeatures))
|
||||||
blink::WebRuntimeFeatures::enableExperimentalFeatures(b);
|
blink::WebRuntimeFeatures::enableExperimentalFeatures(true);
|
||||||
if (IsSwitchEnabled(command_line, switches::kExperimentalCanvasFeatures, &b))
|
if (IsSwitchEnabled(command_line, switches::kExperimentalCanvasFeatures))
|
||||||
blink::WebRuntimeFeatures::enableExperimentalCanvasFeatures(b);
|
blink::WebRuntimeFeatures::enableExperimentalCanvasFeatures(true);
|
||||||
if (IsSwitchEnabled(command_line, switches::kOverlayScrollbars, &b))
|
if (IsSwitchEnabled(command_line, switches::kOverlayScrollbars))
|
||||||
blink::WebRuntimeFeatures::enableOverlayScrollbars(b);
|
blink::WebRuntimeFeatures::enableOverlayScrollbars(true);
|
||||||
if (IsSwitchEnabled(command_line, switches::kOverlayFullscreenVideo, &b))
|
if (IsSwitchEnabled(command_line, switches::kOverlayFullscreenVideo))
|
||||||
blink::WebRuntimeFeatures::enableOverlayFullscreenVideo(b);
|
blink::WebRuntimeFeatures::enableOverlayFullscreenVideo(true);
|
||||||
if (IsSwitchEnabled(command_line, switches::kSharedWorker, &b))
|
if (IsSwitchEnabled(command_line, switches::kSharedWorker))
|
||||||
blink::WebRuntimeFeatures::enableSharedWorker(b);
|
blink::WebRuntimeFeatures::enableSharedWorker(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
Loading…
Reference in a new issue