summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-06 18:15:51 +0000
committerflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-06 18:15:51 +0000
commitb19e0e2ebf9918ced27ffb9b5eecdff6b33a52d9 (patch)
treeb9245b0bc73a2272696f39786286ae30d0b8e345 /ui
parent3dbbf7d631ca40cd051bf32d8d9a1c244945f07d (diff)
downloadchromium_src-b19e0e2ebf9918ced27ffb9b5eecdff6b33a52d9.zip
chromium_src-b19e0e2ebf9918ced27ffb9b5eecdff6b33a52d9.tar.gz
chromium_src-b19e0e2ebf9918ced27ffb9b5eecdff6b33a52d9.tar.bz2
Add UMA metrics for whether touch events are enabled on new tabs.
BUG=168347 TEST=Check that Tab.TouchEventsEnabled in chrome://histograms is updating correctly based on the --touch-events flag after navigating in a few tabs. Review URL: https://chromiumcodereview.appspot.com/12035021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181005 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/base/layout.cc2
-rw-r--r--ui/base/touch/touch_device.cc15
-rw-r--r--ui/base/touch/touch_device.h (renamed from ui/base/touch/touch_device_win.h)0
-rw-r--r--ui/base/touch/touch_device_android.cc13
-rw-r--r--ui/base/touch/touch_device_aurax11.cc15
-rw-r--r--ui/base/touch/touch_device_win.cc2
-rw-r--r--ui/ui.gyp12
7 files changed, 55 insertions, 4 deletions
diff --git a/ui/base/layout.cc b/ui/base/layout.cc
index f68b1ed..a0381592 100644
--- a/ui/base/layout.cc
+++ b/ui/base/layout.cc
@@ -12,6 +12,7 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "build/build_config.h"
+#include "ui/base/touch/touch_device.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
@@ -22,7 +23,6 @@
#if defined(OS_WIN)
#include "base/win/metro.h"
-#include "ui/base/touch/touch_device_win.h"
#include <Windows.h>
#endif // defined(OS_WIN)
diff --git a/ui/base/touch/touch_device.cc b/ui/base/touch/touch_device.cc
new file mode 100644
index 0000000..de7785c
--- /dev/null
+++ b/ui/base/touch/touch_device.cc
@@ -0,0 +1,15 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/base/touch/touch_device.h"
+
+namespace ui {
+
+// Platforms supporting touch link in an alternate implementation of this
+// method.
+bool IsTouchDevicePresent() {
+ return false;
+}
+
+} // namespace ui
diff --git a/ui/base/touch/touch_device_win.h b/ui/base/touch/touch_device.h
index 8cc4b7d..8cc4b7d 100644
--- a/ui/base/touch/touch_device_win.h
+++ b/ui/base/touch/touch_device.h
diff --git a/ui/base/touch/touch_device_android.cc b/ui/base/touch/touch_device_android.cc
new file mode 100644
index 0000000..39e34c2
--- /dev/null
+++ b/ui/base/touch/touch_device_android.cc
@@ -0,0 +1,13 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/base/touch/touch_device.h"
+
+namespace ui {
+
+bool IsTouchDevicePresent() {
+ return true;
+}
+
+} // namespace ui
diff --git a/ui/base/touch/touch_device_aurax11.cc b/ui/base/touch/touch_device_aurax11.cc
new file mode 100644
index 0000000..963503c
--- /dev/null
+++ b/ui/base/touch/touch_device_aurax11.cc
@@ -0,0 +1,15 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/aura/window.h"
+#include "ui/base/touch/touch_device.h"
+#include "ui/base/touch/touch_factory.h"
+
+namespace ui {
+
+bool IsTouchDevicePresent() {
+ return ui::TouchFactory::GetInstance()->IsTouchDevicePresent();
+}
+
+} // namespace ui
diff --git a/ui/base/touch/touch_device_win.cc b/ui/base/touch/touch_device_win.cc
index f1f4f6e..4eba353 100644
--- a/ui/base/touch/touch_device_win.cc
+++ b/ui/base/touch/touch_device_win.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/base/touch/touch_device_win.h"
+#include "ui/base/touch/touch_device.h"
#include "base/win/windows_version.h"
#include <windows.h>
diff --git a/ui/ui.gyp b/ui/ui.gyp
index 1744c05..57b3f4e 100644
--- a/ui/ui.gyp
+++ b/ui/ui.gyp
@@ -263,6 +263,10 @@
'base/text/utf16_indexing.h',
'base/theme_provider.cc',
'base/theme_provider.h',
+ 'base/touch/touch_device.cc',
+ 'base/touch/touch_device.h',
+ 'base/touch/touch_device_android.cc',
+ 'base/touch/touch_device_win.cc',
'base/touch/touch_factory.cc',
'base/touch/touch_factory.h',
'base/ui_base_exports.cc',
@@ -666,8 +670,12 @@
],
}],
['chromeos==1', {
+ 'sources': [
+ 'base/touch/touch_device_aurax11.cc',
+ ],
'sources!': [
'base/clipboard/clipboard_aurax11.cc',
+ 'base/touch/touch_device.cc',
],
}],
['OS=="win"', {
@@ -676,10 +684,9 @@
'gfx/gdi_util.h',
'gfx/icon_util.cc',
'gfx/icon_util.h',
- 'base/touch/touch_device_win.cc',
- 'base/touch/touch_device_win.h',
],
'sources!': [
+ 'base/touch/touch_device.cc',
'base/touch/touch_factory.cc',
'base/touch/touch_factory.h',
'gfx/pango_util.h',
@@ -793,6 +800,7 @@
'sources!': [
'base/dragdrop/drag_utils.cc',
'base/dragdrop/drag_utils.h',
+ 'base/touch/touch_device.cc',
'base/touch/touch_factory.cc',
'base/touch/touch_factory.h',
'gfx/pango_util.cc',