Skip to content

Commit

Permalink
As per oshima:
Browse files Browse the repository at this point in the history
The ultimate goal is to eliminate TOOLKIT_USES_GTK. Once that migration is completed, TOOLKIT_VIEWS + OS_LINUX should be enough.

Until this happens, we need a binary that:
1) has both gtk and pure-views
2) can enable pure views components with --use-pure-views when possible (this is default in touchui=1).

If we could switch everything with --use-pure-views, that'd be nice, but the world is not perfect and there are things that cannot co-exist (such as message pump). For such component, we'll use GYP_DEFINES to switch.

1) TOOLKIT_USES_PURE_VIEWS is defined with toolkit_pure_views=1.
2) all (or most of) chrome features must be functional with toolkit_pure_views=1
3) both TOOLKIT_USES_GTK and TOOLKIT_USES_PURE_VIEWS are defined. The latter has higher priority (that is, if implementation can't co-exists, TOOLKIT_USE_PURE_VIEWS will take precedence).
4) As the migration proceeds, there will be less TOOLKIT_USES_GTK and more TOOLKIT_USES_PURE_VIEWS.
5) Once the migration is complete (that is, there is no TOOKIT_USES_GTK), we can remove TOOLKIT_USES_PURE_VIEWS or replace it with OS_LINUX when necessary.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/7273079

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91164 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
saintlou@chromium.org committed Jun 30, 2011
1 parent b32bd6e commit 1b54669
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
29 changes: 28 additions & 1 deletion build/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
# Whether we're building a ChromeOS build.
'chromeos%': 0,

# Whether the Views toolkit can use its Pure form when available
# or if it must only use GTK (the default at the moment).
# This is an intermediate step until all of Views is 'Pure',
# at which point we plan to remove those switches.
# This turns on the TOOLKIT_USES_PURE_VIEWS macro which is used
# to replace the corresponding GTK implementation in such a way
# that GTK and PureViews can coexist. This intermediate solution
# allow us to switch the view implementations using
# --use-pure-views, without breaking exiting gtk implementation.
'toolkit_uses_pure_views%': 0,

# Disable touch support by default.
'touchui%': 0,

Expand All @@ -29,6 +40,7 @@
},
# Copy conditionally-set variables out one scope.
'chromeos%': '<(chromeos)',
'toolkit_uses_pure_views%': '<(toolkit_uses_pure_views)',
'touchui%': '<(touchui)',
'views_compositor%': '<(views_compositor)',

Expand All @@ -46,11 +58,18 @@

# Set default value of toolkit_views on for Windows, Chrome OS
# and the touch UI.
['OS=="win" or chromeos==1 or touchui==1', {
['OS=="win" or chromeos==1 or touchui==1 or toolkit_uses_pure_views==1', {
'toolkit_views%': 1,
}, {
'toolkit_views%': 0,
}],

# Views are always Pure in Touch case
['touchui==1', {
'toolkit_uses_pure_views%': 1,
}, {
'toolkit_uses_pure_views%': 0,
}],
],
},

Expand All @@ -59,6 +78,7 @@
'touchui%': '<(touchui)',
'host_arch%': '<(host_arch)',
'toolkit_views%': '<(toolkit_views)',
'toolkit_uses_pure_views%': '<(toolkit_uses_pure_views)',
'views_compositor%': '<(views_compositor)',

# We used to provide a variable for changing how libraries were built.
Expand Down Expand Up @@ -220,6 +240,7 @@
'host_arch%': '<(host_arch)',
'library%': 'static_library',
'toolkit_views%': '<(toolkit_views)',
'toolkit_uses_pure_views%': '<(toolkit_uses_pure_views)',
'views_compositor%': '<(views_compositor)',
'os_posix%': '<(os_posix)',
'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
Expand Down Expand Up @@ -569,6 +590,9 @@
['toolkit_views==1', {
'grit_defines': ['-D', 'toolkit_views'],
}],
['toolkit_uses_pure_views==1', {
'grit_defines': ['-D', 'toolkit_uses_pure_views'],
}],
['touchui==1', {
'grit_defines': ['-D', 'touchui'],
}],
Expand Down Expand Up @@ -662,6 +686,9 @@
['toolkit_views==1', {
'defines': ['TOOLKIT_VIEWS=1'],
}],
['toolkit_uses_pure_views==1', {
'defines': ['TOOLKIT_USES_PURE_VIEWS=1'],
}],
['views_compositor==1', {
'defines': ['VIEWS_COMPOSITOR=1'],
}],
Expand Down
4 changes: 4 additions & 0 deletions views/widget/widget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ void Widget::SetPureViews(bool pure) {

// static
bool Widget::IsPureViews() {
#if defined(TOUCH_UI)
return true;
#else
return use_pure_views;
#endif
}

// static
Expand Down

0 comments on commit 1b54669

Please sign in to comment.