Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/SettingsMacros.h.tmpl

Issue 2611823003: ABANDONED CL: Changes to compile and pass tests after Big Blink Rename (excluding functions). (Closed)
Patch Set: Inducing merge conflicts to force human review and changes after rename. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 {% from "macros.tmpl" import license %} 1 {% from "macros.tmpl" import license %}
2 {{ license() }} 2 {{ license() }}
3 3
4 #ifndef SettingsMacros_h 4 #ifndef SettingsMacros_h
5 #define SettingsMacros_h 5 #define SettingsMacros_h
6 6
7 #define SETTINGS_GETTERS_AND_SETTERS \ 7 #define SETTINGS_GETTERS_AND_SETTERS \
8 {% for setting in settings %} 8 {% for setting in settings %}
9 {{setting.type|to_passing_type}} {{setting.name}}() const { return m_{{setti ng.name}}; } \ 9 {{setting.type|to_passing_type}} {{setting.name}}() const { return m_{{setti ng.name}}; } \
10 void set{{setting.name|upper_first}}({{setting.type|to_passing_type}} {{sett ing.name}}); \ 10 void set{{setting.name|upper_first}}({{setting.type|to_passing_type}} {{sett ing.name}}); \
(...skipping 19 matching lines...) Expand all
30 {% endfor %} 30 {% endfor %}
31 // End of SETTINGS_INITIALIZER_LIST. 31 // End of SETTINGS_INITIALIZER_LIST.
32 32
33 #define SETTINGS_SETTER_BODIES \ 33 #define SETTINGS_SETTER_BODIES \
34 {% for setting in settings %} 34 {% for setting in settings %}
35 void Settings::set{{setting.name|upper_first}}({{setting.type|to_passing_type}} {{setting.name}}) { \ 35 void Settings::set{{setting.name|upper_first}}({{setting.type|to_passing_type}} {{setting.name}}) { \
36 if (m_{{setting.name}} == {{setting.name}}) \ 36 if (m_{{setting.name}} == {{setting.name}}) \
37 return; \ 37 return; \
38 m_{{setting.name}} = {{setting.name}}; \ 38 m_{{setting.name}} = {{setting.name}}; \
39 {% if setting.invalidate %} 39 {% if setting.invalidate %}
40 invalidate(SettingsDelegate::{{setting.invalidate}}Change); \ 40 invalidate(SettingsDelegate::k{{setting.invalidate}}Change); \
41 {% endif %} 41 {% endif %}
42 } \ 42 } \
43 {% endfor %} 43 {% endfor %}
44 void Settings::setFromStrings(const String& name, const String& value) { \ 44 void Settings::setFromStrings(const String& name, const String& value) { \
45 {% for setting in settings %} 45 {% for setting in settings %}
46 if (name == "{{setting.name}}") { \ 46 if (name == "{{setting.name}}") { \
47 set{{setting.name|upper_first}}( \ 47 set{{setting.name|upper_first}}( \
48 {% if setting.type == 'String' %} 48 {% if setting.type == 'String' %}
49 value \ 49 value \
50 {% elif setting.type == 'bool' %} 50 {% elif setting.type == 'bool' %}
51 value.isEmpty() || value == "true" \ 51 value.isEmpty() || value == "true" \
52 {% elif setting.type == 'int' %} 52 {% elif setting.type == 'int' %}
53 value.toInt() \ 53 value.toInt() \
54 {% elif setting.type == 'float' %} 54 {% elif setting.type == 'float' %}
55 value.toFloat() \ 55 value.toFloat() \
56 {% elif setting.type == 'double' %} 56 {% elif setting.type == 'double' %}
57 value.toDouble() \ 57 value.toDouble() \
58 {% else %} 58 {% else %}
59 static_cast<{{setting.type}}>(value.toInt()) \ 59 static_cast<{{setting.type}}>(value.toInt()) \
60 {% endif %} 60 {% endif %}
61 ); \ 61 ); \
62 return; \ 62 return; \
63 } \ 63 } \
64 {% endfor %} 64 {% endfor %}
65 } 65 }
66 // End of SETTINGS_SETTER_BODIES. 66 // End of SETTINGS_SETTER_BODIES.
67 67
68 #endif // SettingsMacros_h 68 #endif // SettingsMacros_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698