flutter_flutter/engine/build/scripts/templates/EventFactory.cpp.tmpl
Eric Seidel 55b5bc485d Sort headers
Fix (most) generated includes to have gen/ in their path.

This makes it easier to tell where files exist on disk.

Unfortunately I had to leave the old include path
in engine/BUILD.gn to support all the v8 includes
which were too many to deal with in this patch.

It's a little nasty to have the raw build directory
in our include path, but it produces nicer paths.

R=abarth@chromium.org
2014-11-19 12:33:42 -08:00

28 lines
936 B
Cheetah

{% from 'macros.tmpl' import license %}
{{license()}}
#include "config.h"
#include "core/events/{{namespace}}Factory.h"
#include "{{namespace}}{{suffix}}Headers.h"
#include "gen/sky/platform/RuntimeEnabledFeatures.h"
namespace blink {
PassRefPtr<{{namespace}}> {{namespace}}{{suffix}}Factory::create(const String& type)
{
{% for event in events %}
{% filter enable_conditional(event.Conditional) %}
{% if event|script_name|case_insensitive_matching %}
if (equalIgnoringCase(type, "{{event|script_name}}"){% if event.RuntimeEnabled %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %})
{% else %}
if (type == "{{event|script_name}}"{% if event.RuntimeEnabled %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %})
{% endif %}
return {{event|cpp_name}}::create();
{% endfilter %}
{% endfor %}
return nullptr;
}
} // namespace blink