| OLD | NEW |
| 1 // This file is generated | 1 // This file is generated |
| 2 | 2 |
| 3 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 3 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 4 // Use of this source code is governed by a BSD-style license that can be | 4 // Use of this source code is governed by a BSD-style license that can be |
| 5 // found in the LICENSE file. | 5 // found in the LICENSE file. |
| 6 | 6 |
| 7 #ifndef HEADLESS_PUBLIC_DOMAINS_TYPES_H_ | 7 #ifndef HEADLESS_PUBLIC_DOMAINS_TYPES_H_ |
| 8 #define HEADLESS_PUBLIC_DOMAINS_TYPES_H_ | 8 #define HEADLESS_PUBLIC_DOMAINS_TYPES_H_ |
| 9 | 9 |
| 10 #include "base/optional.h" | 10 #include "base/optional.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 class HEADLESS_EXPORT {{type.id}} { | 62 class HEADLESS_EXPORT {{type.id}} { |
| 63 public: | 63 public: |
| 64 static {{resolve_type(type).pass_type}} Parse(const base::Value& value, ErrorR
eporter* errors); | 64 static {{resolve_type(type).pass_type}} Parse(const base::Value& value, ErrorR
eporter* errors); |
| 65 ~{{type.id}}() { } | 65 ~{{type.id}}() { } |
| 66 {% for property in type.properties %} | 66 {% for property in type.properties %} |
| 67 | 67 |
| 68 {% if property.description %} | 68 {% if property.description %} |
| 69 // {{property.description}} | 69 // {{property.description}} |
| 70 {% endif %} | 70 {% endif %} |
| 71 {% if property.optional %} | 71 {% if property.optional %} |
| 72 bool Has{{property.name | to_title_case}}() { return !!{{property.name | camel
case_to_hacker_style}}_; } | 72 bool Has{{property.name | to_title_case}}() const { return !!{{property.name |
camelcase_to_hacker_style}}_; } |
| 73 {{resolve_type(property).raw_return_type}} Get{{property.name | to_title_case}
}() { return {{resolve_type(property).to_raw_return_type % ("%s_.value()" % prop
erty.name | camelcase_to_hacker_style)}}; } | 73 {{resolve_type(property).raw_return_type}} Get{{property.name | to_title_case}
}() const { return {{resolve_type(property).to_raw_return_type % ("%s_.value()"
% property.name | camelcase_to_hacker_style)}}; } |
| 74 void Set{{property.name | to_title_case}}({{resolve_type(property).pass_type}}
value) { {{property.name | camelcase_to_hacker_style}}_ = {{resolve_type(proper
ty).to_pass_type % 'value'}}; } | 74 void Set{{property.name | to_title_case}}({{resolve_type(property).pass_type}}
value) { {{property.name | camelcase_to_hacker_style}}_ = {{resolve_type(proper
ty).to_pass_type % 'value'}}; } |
| 75 {% else %} | 75 {% else %} |
| 76 {{resolve_type(property).raw_return_type}} Get{{property.name | to_title_case}
}() { return {{resolve_type(property).to_raw_return_type % ("%s_" % property.nam
e | camelcase_to_hacker_style)}}; } | 76 {{resolve_type(property).raw_return_type}} Get{{property.name | to_title_case}
}() const { return {{resolve_type(property).to_raw_return_type % ("%s_" % proper
ty.name | camelcase_to_hacker_style)}}; } |
| 77 void Set{{property.name | to_title_case}}({{resolve_type(property).pass_type}}
value) { {{property.name | camelcase_to_hacker_style}}_ = {{resolve_type(proper
ty).to_pass_type % 'value'}}; } | 77 void Set{{property.name | to_title_case}}({{resolve_type(property).pass_type}}
value) { {{property.name | camelcase_to_hacker_style}}_ = {{resolve_type(proper
ty).to_pass_type % 'value'}}; } |
| 78 {% endif %} | 78 {% endif %} |
| 79 {% endfor %} | 79 {% endfor %} |
| 80 | 80 |
| 81 std::unique_ptr<base::Value> Serialize() const; | 81 std::unique_ptr<base::Value> Serialize() const; |
| 82 {{resolve_type(type).pass_type}} Clone() const; | 82 {{resolve_type(type).pass_type}} Clone() const; |
| 83 | 83 |
| 84 template<int STATE> | 84 template<int STATE> |
| 85 class {{type.id}}Builder { | 85 class {{type.id}}Builder { |
| 86 public: | 86 public: |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 {% endfor %} | 151 {% endfor %} |
| 152 | 152 |
| 153 } // namespace {{domain.domain | camelcase_to_hacker_style}} | 153 } // namespace {{domain.domain | camelcase_to_hacker_style}} |
| 154 {% endfor %} | 154 {% endfor %} |
| 155 | 155 |
| 156 } // namespace headless | 156 } // namespace headless |
| 157 | 157 |
| 158 #endif // HEADLESS_PUBLIC_DOMAINS_TYPES_H_ | 158 #endif // HEADLESS_PUBLIC_DOMAINS_TYPES_H_ |
| OLD | NEW |