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

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

Issue 2870113002: m_foo -> foo_ in SettingsMacros, fix DEBUG_TEXT_AUTOSIZING_ON_DESKTOP build. (Closed)
Patch Set: Created 3 years, 7 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}} Get{{setting.name|upper_first}}() const { r eturn m_{{setting.name}}; } \ 9 {{setting.type|to_passing_type}} Get{{setting.name|upper_first}}() const { r eturn {{setting.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}}); \
11 {% endfor %} 11 {% endfor %}
12 void setFromStrings(const String& name, const String& value); 12 void SetFromStrings(const String& name, const String& value);
13 // End of SETTINGS_GETTERS_AND_SETTERS. 13 // End of SETTINGS_GETTERS_AND_SETTERS.
14 14
15 #define SETTINGS_MEMBER_VARIABLES \ 15 #define SETTINGS_MEMBER_VARIABLES \
16 {% for setting in settings if setting.type != 'bool' %} 16 {% for setting in settings if setting.type != 'bool' %}
17 {{setting.type}} m_{{setting.name}}; \ 17 {{setting.type}} {{setting.name}}_; \
18 {% endfor %} 18 {% endfor %}
19 {% for setting in settings if setting.type == 'bool' %} 19 {% for setting in settings if setting.type == 'bool' %}
20 bool m_{{setting.name}} : 1; \ 20 bool {{setting.name}}_ : 1; \
21 {% endfor %} 21 {% endfor %}
22 // End of SETTINGS_MEMBER_VARIABLES. 22 // End of SETTINGS_MEMBER_VARIABLES.
23 23
24 #define SETTINGS_INITIALIZER_LIST \ 24 #define SETTINGS_INITIALIZER_LIST \
25 {% for setting in settings if setting.initial is not none and setting.type ! = 'bool' %} 25 {% for setting in settings if setting.initial is not none and setting.type ! = 'bool' %}
26 , m_{{setting.name}}({{setting.initial}}) \ 26 , {{setting.name}}_({{setting.initial}}) \
27 {% endfor %} 27 {% endfor %}
28 {% for setting in settings if setting.initial is not none and setting.type = = 'bool' %} 28 {% for setting in settings if setting.initial is not none and setting.type = = 'bool' %}
29 , m_{{setting.name}}({{setting.initial|cpp_bool}}) \ 29 , {{setting.name}}_({{setting.initial|cpp_bool}}) \
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 ({{setting.name}}_ == {{setting.name}}) \
37 return; \ 37 return; \
38 m_{{setting.name}} = {{setting.name}}; \ 38 {{setting.name}}_ = {{setting.name}}; \
39 {% if setting.invalidate %} 39 {% if setting.invalidate %}
40 Invalidate(SettingsDelegate::k{{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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/Settings.cpp » ('j') | third_party/WebKit/Source/core/frame/Settings.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698