summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-15 15:22:55 +0000
committerflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-15 15:22:55 +0000
commitc71fe6404a9eb07f96d737140619d673916070a8 (patch)
tree89d261c5d323653ce8dff736096baa8a201efddf
parent23e554e0da8d2dbf4f1ea43649b60d61ce103027 (diff)
downloadchromium_src-c71fe6404a9eb07f96d737140619d673916070a8.zip
chromium_src-c71fe6404a9eb07f96d737140619d673916070a8.tar.gz
chromium_src-c71fe6404a9eb07f96d737140619d673916070a8.tar.bz2
Remove touch optimized layout on ChromeOS
BUG=138281 TEST=No touch optimized ui in about flags, nor does it get set when a touch screen is plugged in. Review URL: https://chromiumcodereview.appspot.com/10832252 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151694 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--build/common.gypi4
-rw-r--r--chrome/browser/about_flags.cc2
-rw-r--r--content/browser/web_contents/web_contents_impl.cc8
-rw-r--r--ui/base/layout.cc20
4 files changed, 11 insertions, 23 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 0be21da..c836456 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -130,8 +130,8 @@
'enable_hidpi%': 1,
}],
- # Enable touch UI on Metro and Chrome OS.
- ['OS=="win" or chromeos==1', {
+ # Enable touch UI on Metro.
+ ['OS=="win"', {
'enable_touch_ui%': 1,
}],
],
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 7aeaa17..54438cd 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -702,7 +702,7 @@ const Experiment kExperiments[] = {
"touch-optimized-ui",
IDS_FLAGS_TOUCH_OPTIMIZED_UI_NAME,
IDS_FLAGS_TOUCH_OPTIMIZED_UI_DESCRIPTION,
- kOsWin | kOsCrOS,
+ kOsWin,
MULTI_VALUE_TYPE(kTouchOptimizedUIChoices)
},
{
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index d5a09dc..32ff95d 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -83,6 +83,10 @@
#include "ui/surface/io_surface_support_mac.h"
#endif
+#if defined(USE_AURA) && defined(USE_X11)
+#include "ui/base/touch/touch_factory.h"
+#endif // defined (USE_AURA) && defined(USE_X11)
+
// Cross-Site Navigations
//
// If a WebContentsImpl is told to navigate to a different web site (as
@@ -523,6 +527,10 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh,
command_line.HasSwitch(switches::kEnableCssVariables);
prefs.device_supports_touch =
ui::GetDisplayLayout() == ui::LAYOUT_TOUCH;
+#if defined(USE_AURA) && defined(USE_X11)
+ prefs.device_supports_touch |=
+ ui::TouchFactory::GetInstance()->IsTouchDevicePresent();
+#endif
#if defined(OS_ANDROID)
prefs.device_supports_mouse = false;
#endif
diff --git a/ui/base/layout.cc b/ui/base/layout.cc
index 6f98c9d..618944c 100644
--- a/ui/base/layout.cc
+++ b/ui/base/layout.cc
@@ -19,10 +19,6 @@
#include "ui/compositor/compositor.h"
#endif // defined(USE_AURA) && !defined(OS_WIN)
-#if defined(USE_AURA) && defined(USE_X11)
-#include "ui/base/touch/touch_factory.h"
-#endif // defined(USE_AURA) && defined(USE_X11)
-
#if defined(OS_MACOSX)
#include "base/mac/mac_util.h"
#endif
@@ -59,22 +55,6 @@ bool UseTouchOptimizedUI() {
// On Windows, we use the touch layout only when we are running in
// Metro mode.
return base::win::IsMetroProcess() && base::win::IsTouchEnabled();
-#elif defined(USE_AURA) && defined(USE_X11)
- // Determine whether touch-screen hardware is currently available.
- // For now we must ensure this won't change over the life of the process,
- // since we don't yet support updating the UI. crbug.com/124399
- static bool has_touch_device =
- ui::TouchFactory::GetInstance()->IsTouchDevicePresent();
-
- // Work-around for late device detection in some cases. If we've asked for
- // touch calibration then we're certainly expecting a touch screen, it must
- // just not be ready yet. Force-enable touch-ui mode in this case.
- static bool enable_touch_calibration = CommandLine::ForCurrentProcess()->
- HasSwitch(switches::kEnableTouchCalibration);
- if (!has_touch_device && enable_touch_calibration)
- has_touch_device = true;
-
- return has_touch_device;
#else
return false;
#endif