{% from "templates/macros.tmpl" import license, source_files_for_generated_file %}
{{ license() }}
{{source_files_for_generated_file(template_file, input_files)}}
#include "{{primary_header_name}}"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/frame/settings.h"
namespace blink {
InternalSettingsGenerated::InternalSettingsGenerated(Page& page)
: InternalSettingsPageSupplementBase(page) {
{% for setting in settings %}
backup_.Set{{setting.name.to_upper_camel_case()}}(
GetSettings().Get{{setting.name.to_upper_camel_case()}}());
{% endfor %}
}
InternalSettingsGenerated::~InternalSettingsGenerated() {}
void InternalSettingsGenerated::ResetToConsistentState() {
{% for setting in settings %}
GetSettings().Set{{setting.name.to_upper_camel_case()}}(
backup_.Get{{setting.name.to_upper_camel_case()}}());
{% endfor %}
}
{% for setting in settings if setting.type|to_idl_type %}
void InternalSettingsGenerated::set{{setting.name.to_upper_camel_case()}}(
{{setting.type|to_passing_type}} {{setting.name}}) {
GetSettings().Set{{setting.name.to_upper_camel_case()}}({{setting.name}});
}
{% endfor %}
void InternalSettingsGenerated::Trace(Visitor* visitor) const {
ScriptWrappable::Trace(visitor);
InternalSettingsPageSupplementBase::Trace(visitor);
}
Settings& InternalSettingsGenerated::GetSettings() {
CHECK(GetSupplementable());
return GetSupplementable()->GetSettings();
}
} // namespace blink