summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-06 20:37:57 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-06 20:37:57 +0000
commit114efaeb2baaeb92a34a773c8e0379e1b221e379 (patch)
treee35ca9e3237bcb372441391221be0bfb700a23b9
parent7fa2be92b9f0553a47e28ac96710cff039311044 (diff)
downloadchromium_src-114efaeb2baaeb92a34a773c8e0379e1b221e379.zip
chromium_src-114efaeb2baaeb92a34a773c8e0379e1b221e379.tar.gz
chromium_src-114efaeb2baaeb92a34a773c8e0379e1b221e379.tar.bz2
Restructure the events target into two components:
- events_base (built by most people) - defining some basic utilities. - events (built by users of aura/views) - the ui::Event type & friends. Prior to this there was one target, and platforms that did not want ui::Event would exclude those files explicitly, making it hard to build those files on those platforms without breaking other components. R=sadrul@chromium.org BUG=none Review URL: https://codereview.chromium.org/57433011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233347 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--cc/cc.gyp2
-rw-r--r--chrome/chrome.gyp1
-rw-r--r--chrome/chrome_browser.gypi2
-rw-r--r--chrome/chrome_browser_ui.gypi17
-rw-r--r--chrome/chrome_tests.gypi5
-rw-r--r--components/autofill.gypi3
-rw-r--r--content/content_app.gypi1
-rw-r--r--content/content_browser.gypi7
-rw-r--r--content/content_shell.gypi2
-rw-r--r--content/content_tests.gypi2
-rw-r--r--media/media.gyp2
-rw-r--r--remoting/remoting.gyp2
-rw-r--r--ui/app_list/app_list.gyp2
-rw-r--r--ui/aura/aura.gyp8
-rw-r--r--ui/compositor/compositor.gyp3
-rw-r--r--ui/events/event_switches.h14
-rw-r--r--ui/events/events.gyp74
-rw-r--r--ui/events/events_base_export.h29
-rw-r--r--ui/events/events_stub.cc151
-rw-r--r--ui/events/keycodes/keyboard_code_conversion.h5
-rw-r--r--ui/events/keycodes/keyboard_code_conversion_android.h4
-rw-r--r--ui/events/keycodes/keyboard_code_conversion_gtk.h11
-rw-r--r--ui/events/keycodes/keyboard_code_conversion_mac.h13
-rw-r--r--ui/events/keycodes/keyboard_code_conversion_win.h6
-rw-r--r--ui/events/keycodes/keyboard_code_conversion_x.h11
-rw-r--r--ui/events/latency_info.h4
-rw-r--r--ui/gfx/gfx.gyp6
-rw-r--r--ui/message_center/message_center.gyp4
-rw-r--r--ui/ozone/ozone.gyp1
-rw-r--r--ui/snapshot/snapshot.gyp2
-rw-r--r--ui/surface/surface.gyp4
-rw-r--r--ui/ui.gyp11
-rw-r--r--ui/ui_unittests.gyp10
-rw-r--r--ui/views/views.gyp1
34 files changed, 300 insertions, 120 deletions
diff --git a/cc/cc.gyp b/cc/cc.gyp
index cab195f..792a058 100644
--- a/cc/cc.gyp
+++ b/cc/cc.gyp
@@ -17,7 +17,7 @@
'<(DEPTH)/media/media.gyp:media',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/third_party/WebKit/public/blink.gyp:blink_minimal',
- '<(DEPTH)/ui/events/events.gyp:events',
+ '<(DEPTH)/ui/events/events.gyp:events_base',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx',
'<(DEPTH)/ui/gl/gl.gyp:gl',
],
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index ca88974..415d8b0 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -687,7 +687,6 @@
'dependencies': [
'chrome_resources.gyp:chrome_strings',
'../base/base.gyp:base',
- '../ui/events/events.gyp:events',
'../ui/gfx/gfx.gyp:gfx',
'../ui/ui.gyp:ui',
],
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 58ad06a..303b5e7 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -60,7 +60,7 @@
'../third_party/zlib/zlib.gyp:minizip',
'../third_party/zlib/zlib.gyp:zlib',
'../ui/base/strings/ui_strings.gyp:ui_strings',
- '../ui/events/events.gyp:events',
+ '../ui/events/events.gyp:events_base',
'../ui/gfx/gfx.gyp:gfx',
'../ui/message_center/message_center.gyp:message_center',
'../ui/shell_dialogs/shell_dialogs.gyp:shell_dialogs',
diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi
index 63a744a..3130866 100644
--- a/chrome/chrome_browser_ui.gypi
+++ b/chrome/chrome_browser_ui.gypi
@@ -44,7 +44,6 @@
'../third_party/libxml/libxml.gyp:libxml',
'../third_party/zlib/zlib.gyp:zlib',
'../ui/base/strings/ui_strings.gyp:ui_strings',
- '../ui/events/events.gyp:events',
'../ui/gfx/gfx.gyp:gfx',
'../ui/message_center/message_center.gyp:message_center',
'../ui/native_theme/native_theme.gyp:native_theme',
@@ -2672,17 +2671,19 @@
'../third_party/libusb/libusb.gyp:libusb',
],
}],
- ['toolkit_views == 0', {
- 'sources!': [
- 'browser/ui/tabs/tab_strip_layout_type.h',
- 'browser/ui/tabs/tab_strip_layout_type_prefs.cc',
- 'browser/ui/tabs/tab_strip_layout_type_prefs.h',
- ],
- }],
['toolkit_views == 1', {
+ 'dependencies': [
+ '../ui/events/events.gyp:events',
+ ],
'sources!': [
'browser/ui/profile_reset_bubble_stub.cc',
],
+ }, { # toolkit_views == 0
+ 'sources!': [
+ 'browser/ui/tabs/tab_strip_layout_type.h',
+ 'browser/ui/tabs/tab_strip_layout_type_prefs.cc',
+ 'browser/ui/tabs/tab_strip_layout_type_prefs.h',
+ ],
}],
['OS=="linux"', {
'dependencies': [
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index ae26530..92814b5 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -549,7 +549,6 @@
'../net/net.gyp:net',
'../third_party/zlib/zlib.gyp:minizip',
'../third_party/zlib/zlib.gyp:zlib',
- '../ui/events/events.gyp:events',
'../ui/gfx/gfx.gyp:gfx',
'../ui/ui.gyp:ui',
'../url/url.gyp:url_lib',
@@ -739,7 +738,7 @@
'../crypto/crypto.gyp:crypto',
'../net/net.gyp:http_server',
'../net/net.gyp:net',
- '../ui/events/events.gyp:events',
+ '../ui/events/events.gyp:events_base',
'../ui/gfx/gfx.gyp:gfx',
'../ui/ui.gyp:ui',
],
@@ -841,7 +840,6 @@
'../net/net.gyp:http_server',
'../net/net.gyp:net',
'../testing/gtest.gyp:gtest',
- '../ui/events/events.gyp:events',
'../ui/gfx/gfx.gyp:gfx',
'../ui/ui.gyp:ui',
],
@@ -865,7 +863,6 @@
'../net/net.gyp:http_server',
'../net/net.gyp:net',
'../testing/gtest.gyp:gtest',
- '../ui/events/events.gyp:events',
'../ui/gfx/gfx.gyp:gfx',
'../ui/ui.gyp:ui',
],
diff --git a/components/autofill.gypi b/components/autofill.gypi
index 81497e7..d3bae3e 100644
--- a/components/autofill.gypi
+++ b/components/autofill.gypi
@@ -34,7 +34,6 @@
'../content/content.gyp:content_common',
'../ipc/ipc.gyp:ipc',
'../third_party/WebKit/public/blink.gyp:blink_minimal',
- '../ui/events/events.gyp:events',
'../ui/gfx/gfx.gyp:gfx',
'../ui/ui.gyp:ui',
'../url/url.gyp:url_lib',
@@ -112,7 +111,6 @@
'../third_party/icu/icu.gyp:icuuc',
'../third_party/libjingle/libjingle.gyp:libjingle',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber',
- '../ui/events/events.gyp:events',
'../ui/gfx/gfx.gyp:gfx',
'../ui/ui.gyp:ui',
'../url/url.gyp:url_lib',
@@ -301,7 +299,6 @@
'../third_party/icu/icu.gyp:icuuc',
'../third_party/libjingle/libjingle.gyp:libjingle',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber',
- '../ui/events/events.gyp:events',
'../ui/gfx/gfx.gyp:gfx',
'../ui/ui.gyp:ui',
'../url/url.gyp:url_lib',
diff --git a/content/content_app.gypi b/content/content_app.gypi
index 6a419e4..127b593 100644
--- a/content/content_app.gypi
+++ b/content/content_app.gypi
@@ -10,7 +10,6 @@
'../base/base.gyp:base',
'../base/base.gyp:base_i18n',
'../crypto/crypto.gyp:crypto',
- '../ui/events/events.gyp:events',
'../ui/gfx/gfx.gyp:gfx',
'../ui/ui.gyp:ui',
],
diff --git a/content/content_browser.gypi b/content/content_browser.gypi
index 2fc19ee..2dc3acf 100644
--- a/content/content_browser.gypi
+++ b/content/content_browser.gypi
@@ -14,7 +14,7 @@
'../third_party/re2/re2.gyp:re2',
'../third_party/zlib/google/zip.gyp:zip',
'../third_party/zlib/zlib.gyp:zlib',
- '../ui/events/events.gyp:events',
+ '../ui/events/events.gyp:events_base',
'../ui/gfx/gfx.gyp:gfx',
'../ui/snapshot/snapshot.gyp:snapshot',
'../ui/ui.gyp:ui',
@@ -1230,6 +1230,11 @@
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/grit/webui_resources_map.cc',
],
'conditions': [
+ ['toolkit_views==1', {
+ 'dependencies': [
+ '../ui/events/events.gyp:events',
+ ],
+ }],
['OS!="win" and OS!="mac" and OS!="linux"', {
'sources': [
'browser/gamepad/gamepad_platform_data_fetcher.cc',
diff --git a/content/content_shell.gypi b/content/content_shell.gypi
index e5058c3..42d971a 100644
--- a/content/content_shell.gypi
+++ b/content/content_shell.gypi
@@ -47,7 +47,7 @@
'../net/net.gyp:net_resources',
'../skia/skia.gyp:skia',
'../third_party/WebKit/public/blink_test_runner.gyp:blink_test_runner',
- '../ui/events/events.gyp:events',
+ '../ui/events/events.gyp:events_base',
'../ui/gfx/gfx.gyp:gfx',
'../ui/gl/gl.gyp:gl',
'../ui/ui.gyp:ui',
diff --git a/content/content_tests.gypi b/content/content_tests.gypi
index 37cb50f..565d009 100644
--- a/content/content_tests.gypi
+++ b/content/content_tests.gypi
@@ -12,7 +12,7 @@
'../skia/skia.gyp:skia',
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
- '../ui/events/events.gyp:events',
+ '../ui/events/events.gyp:events_base',
'../ui/gfx/gfx.gyp:gfx',
'../ui/ui.gyp:keycode_converter',
'../ui/ui.gyp:ui',
diff --git a/media/media.gyp b/media/media.gyp
index d346dac4..ec59412 100644
--- a/media/media.gyp
+++ b/media/media.gyp
@@ -49,7 +49,7 @@
'../gpu/gpu.gyp:command_buffer_common',
'../skia/skia.gyp:skia',
'../third_party/opus/opus.gyp:opus',
- '../ui/events/events.gyp:events',
+ '../ui/events/events.gyp:events_base',
'../ui/gfx/gfx.gyp:gfx',
'../url/url.gyp:url_lib',
'shared_memory_support',
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index 99a70a2..fb3eb93 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -2481,7 +2481,6 @@
'dependencies': [
'../base/base.gyp:base',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
- '../ui/events/events.gyp:events',
'../ui/gfx/gfx.gyp:gfx',
'../ui/ui.gyp:ui',
'../net/net.gyp:net',
@@ -2789,7 +2788,6 @@
'../ppapi/ppapi.gyp:ppapi_cpp',
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
- '../ui/events/events.gyp:events',
'../ui/gfx/gfx.gyp:gfx',
'../ui/ui.gyp:ui',
'remoting_base',
diff --git a/ui/app_list/app_list.gyp b/ui/app_list/app_list.gyp
index 0c14307..1225d53 100644
--- a/ui/app_list/app_list.gyp
+++ b/ui/app_list/app_list.gyp
@@ -17,7 +17,6 @@
'../../skia/skia.gyp:skia',
'../base/strings/ui_strings.gyp:ui_strings',
'../compositor/compositor.gyp:compositor',
- '../events/events.gyp:events',
'../gfx/gfx.gyp:gfx',
'../ui.gyp:ui',
'../ui.gyp:ui_resources',
@@ -133,6 +132,7 @@
'dependencies': [
'../../content/content.gyp:content',
'../../content/content.gyp:content_browser',
+ '../events/events.gyp:events',
'../views/controls/webview/webview.gyp:webview',
'../views/views.gyp:views',
],
diff --git a/ui/aura/aura.gyp b/ui/aura/aura.gyp
index e9d2733..2ef029e 100644
--- a/ui/aura/aura.gyp
+++ b/ui/aura/aura.gyp
@@ -19,6 +19,7 @@
'../../skia/skia.gyp:skia',
'../compositor/compositor.gyp:compositor',
'../events/events.gyp:events',
+ '../events/events.gyp:events_base',
'../gfx/gfx.gyp:gfx',
'../ui.gyp:ui',
'../ui.gyp:ui_resources',
@@ -125,11 +126,6 @@
'input_state_lookup.cc',
],
}],
- ['use_ozone==1', {
- 'dependencies': [
- '../ozone/ozone.gyp:ozone',
- ],
- }],
],
},
{
@@ -140,6 +136,7 @@
'../../testing/gtest.gyp:gtest',
'../compositor/compositor.gyp:compositor_test_support',
'../events/events.gyp:events',
+ '../events/events.gyp:events_base',
'../gfx/gfx.gyp:gfx',
'../ui.gyp:ui',
'../ui_unittests.gyp:ui_test_support',
@@ -276,6 +273,7 @@
'../compositor/compositor.gyp:compositor_test_support',
'../compositor/compositor.gyp:compositor',
'../events/events.gyp:events',
+ '../events/events.gyp:events_base',
'../gfx/gfx.gyp:gfx',
'../gl/gl.gyp:gl',
'../ui.gyp:ui',
diff --git a/ui/compositor/compositor.gyp b/ui/compositor/compositor.gyp
index c2afadc..ae25017 100644
--- a/ui/compositor/compositor.gyp
+++ b/ui/compositor/compositor.gyp
@@ -16,7 +16,6 @@
'<(DEPTH)/cc/cc.gyp:cc',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/third_party/WebKit/public/blink.gyp:blink_minimal',
- '<(DEPTH)/ui/events/events.gyp:events',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx',
'<(DEPTH)/ui/gl/gl.gyp:gl',
],
@@ -80,7 +79,6 @@
'<(DEPTH)/cc/cc_tests.gyp:cc_test_support',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/third_party/WebKit/public/blink.gyp:blink_minimal',
- '<(DEPTH)/ui/events/events.gyp:events',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx',
'<(DEPTH)/ui/gl/gl.gyp:gl',
'<(DEPTH)/ui/ui.gyp:ui',
@@ -110,7 +108,6 @@
'<(DEPTH)/cc/cc_tests.gyp:cc_test_support',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/testing/gtest.gyp:gtest',
- '<(DEPTH)/ui/events/events.gyp:events',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx',
'<(DEPTH)/ui/gl/gl.gyp:gl',
'<(DEPTH)/ui/ui.gyp:ui',
diff --git a/ui/events/event_switches.h b/ui/events/event_switches.h
index ec2fbd1..d434304 100644
--- a/ui/events/event_switches.h
+++ b/ui/events/event_switches.h
@@ -6,18 +6,18 @@
#define UI_EVENTS_EVENTS_SWITCHES_H_
#include "base/compiler_specific.h"
-#include "ui/events/events_export.h"
+#include "ui/events/events_base_export.h"
namespace switches {
-EVENTS_EXPORT extern const char kEnableScrollPrediction[];
-EVENTS_EXPORT extern const char kTouchEvents[];
-EVENTS_EXPORT extern const char kTouchEventsAuto[];
-EVENTS_EXPORT extern const char kTouchEventsEnabled[];
-EVENTS_EXPORT extern const char kTouchEventsDisabled[];
+EVENTS_BASE_EXPORT extern const char kEnableScrollPrediction[];
+EVENTS_BASE_EXPORT extern const char kTouchEvents[];
+EVENTS_BASE_EXPORT extern const char kTouchEventsAuto[];
+EVENTS_BASE_EXPORT extern const char kTouchEventsEnabled[];
+EVENTS_BASE_EXPORT extern const char kTouchEventsDisabled[];
#if defined(OS_LINUX)
-EVENTS_EXPORT extern const char kTouchDevices[];
+EVENTS_BASE_EXPORT extern const char kTouchDevices[];
#endif
} // namespace switches
diff --git a/ui/events/events.gyp b/ui/events/events.gyp
index eb11794..6770cf6 100644
--- a/ui/events/events.gyp
+++ b/ui/events/events.gyp
@@ -8,19 +8,47 @@
},
'targets': [
{
+ 'target_name': 'events_base',
+ 'type': '<(component)',
+ 'dependencies': [
+ '<(DEPTH)/base/base.gyp:base',
+ ],
+ 'defines': [
+ 'EVENTS_BASE_IMPLEMENTATION',
+ ],
+ 'sources': [
+ 'events_base_export.h',
+ 'event_switches.cc',
+ 'event_switches.h',
+ 'keycodes/keyboard_code_conversion.cc',
+ 'keycodes/keyboard_code_conversion.h',
+ 'keycodes/keyboard_code_conversion_android.cc',
+ 'keycodes/keyboard_code_conversion_android.h',
+ 'keycodes/keyboard_code_conversion_gtk.cc',
+ 'keycodes/keyboard_code_conversion_gtk.h',
+ 'keycodes/keyboard_code_conversion_mac.h',
+ 'keycodes/keyboard_code_conversion_mac.mm',
+ 'keycodes/keyboard_code_conversion_win.cc',
+ 'keycodes/keyboard_code_conversion_win.h',
+ 'keycodes/keyboard_code_conversion_x.cc',
+ 'keycodes/keyboard_code_conversion_x.h',
+ 'keycodes/keyboard_codes.h',
+ 'latency_info.cc',
+ 'latency_info.h',
+ ],
+ },
+ {
'target_name': 'events',
'type': '<(component)',
'dependencies': [
'<(DEPTH)/base/base.gyp:base',
- '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
- '<(DEPTH)/skia/skia.gyp:skia',
'../gfx/gfx.gyp:gfx',
+ 'events_base',
],
'defines': [
'EVENTS_IMPLEMENTATION',
],
'sources': [
- 'cocoa/events_mac.mm',
'event.cc',
'event.h',
'event_constants.h',
@@ -28,13 +56,12 @@
'event_dispatcher.h',
'event_handler.cc',
'event_handler.h',
- 'event_switches.cc',
- 'event_switches.h',
'event_target.cc',
'event_target.h',
'event_utils.cc',
'event_utils.h',
'events_export.h',
+ 'events_stub.cc',
'gestures/gesture_configuration.cc',
'gestures/gesture_configuration.h',
'gestures/gesture_point.cc',
@@ -50,21 +77,6 @@
'gestures/gesture_util.h',
'gestures/velocity_calculator.cc',
'gestures/velocity_calculator.h',
- 'keycodes/keyboard_code_conversion.cc',
- 'keycodes/keyboard_code_conversion.h',
- 'keycodes/keyboard_code_conversion_android.cc',
- 'keycodes/keyboard_code_conversion_android.h',
- 'keycodes/keyboard_code_conversion_gtk.cc',
- 'keycodes/keyboard_code_conversion_gtk.h',
- 'keycodes/keyboard_code_conversion_mac.h',
- 'keycodes/keyboard_code_conversion_mac.mm',
- 'keycodes/keyboard_code_conversion_win.cc',
- 'keycodes/keyboard_code_conversion_win.h',
- 'keycodes/keyboard_code_conversion_x.cc',
- 'keycodes/keyboard_code_conversion_x.h',
- 'keycodes/keyboard_codes.h',
- 'latency_info.cc',
- 'latency_info.h',
'ozone/evdev/event_factory.cc',
'ozone/evdev/event_factory.h',
'ozone/evdev/event_modifiers.cc',
@@ -90,25 +102,11 @@
'x/touch_factory_x11.h',
],
'conditions': [
- ['use_aura==0 and toolkit_views==0', {
- 'sources/': [
- ['exclude', '^gestures/*'],
- ],
- 'sources!': [
- 'event.cc',
- 'event.h',
- 'event_dispatcher.cc',
- 'event_dispatcher.h',
- 'event_handler.cc',
- 'event_handler.h',
- 'event_target.cc',
- 'event_target.h',
- ],
- }],
- ['OS=="android"', {
+ # We explicitly enumerate the platforms we _do_ provide native cracking
+ # for here.
+ ['OS=="win" or use_x11==1 or use_ozone==1', {
'sources!': [
- 'event_utils.cc',
- 'keycodes/keyboard_code_conversion.cc',
+ 'events_stub.cc',
],
}],
['use_x11==1', {
diff --git a/ui/events/events_base_export.h b/ui/events/events_base_export.h
new file mode 100644
index 0000000..2da4f78
--- /dev/null
+++ b/ui/events/events_base_export.h
@@ -0,0 +1,29 @@
+// 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.
+
+#ifndef UI_EVENTS_EVENTS_BASE_EXPORT_H_
+#define UI_EVENTS_EVENTS_BASE_EXPORT_H_
+
+#if defined(COMPONENT_BUILD)
+#if defined(WIN32)
+
+#if defined(EVENTS_BASE_IMPLEMENTATION)
+#define EVENTS_BASE_EXPORT __declspec(dllexport)
+#else
+#define EVENTS_BASE_EXPORT __declspec(dllimport)
+#endif // defined(EVENTS_BASE_IMPLEMENTATION)
+
+#else // defined(WIN32)
+#if defined(EVENTS_BASE_IMPLEMENTATION)
+#define EVENTS_BASE_EXPORT __attribute__((visibility("default")))
+#else
+#define EVENTS_BASE_EXPORT
+#endif
+#endif
+
+#else // defined(COMPONENT_BUILD)
+#define EVENTS_BASE_EXPORT
+#endif
+
+#endif // UI_EVENTS_EVENTS_BASE_EXPORT_H_
diff --git a/ui/events/events_stub.cc b/ui/events/events_stub.cc
new file mode 100644
index 0000000..5a7aa77
--- /dev/null
+++ b/ui/events/events_stub.cc
@@ -0,0 +1,151 @@
+// 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 "base/logging.h"
+#include "base/time/time.h"
+#include "ui/events/event_utils.h"
+#include "ui/gfx/point.h"
+#include "ui/gfx/vector2d.h"
+
+namespace ui {
+
+// Stub implementations of platform-specific methods in events_util.h, built
+// on platform sthat currently do not have a complete implementation of events.
+
+void UpdateDeviceList() {
+ NOTIMPLEMENTED();
+}
+
+EventType EventTypeFromNative(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return ET_UNKNOWN;
+}
+
+int EventFlagsFromNative(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return 0;
+}
+
+base::TimeDelta EventTimeFromNative(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return base::TimeDelta();
+}
+
+gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return gfx::Point();
+}
+
+gfx::Point EventSystemLocationFromNative(
+ const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return gfx::Point();
+}
+
+int EventButtonFromNative(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return 0;
+}
+
+bool IsMouseEvent(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+int GetChangedMouseButtonFlagsFromNative(
+ const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return 0;
+}
+
+gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return gfx::Vector2d();
+}
+
+void ClearTouchIdIfReleased(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+}
+
+int GetTouchId(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return 0;
+}
+
+float GetTouchRadiusX(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return 0.f;
+}
+
+float GetTouchRadiusY(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return 0.f;
+}
+
+float GetTouchAngle(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return 0.f;
+}
+
+float GetTouchForce(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return 0.f;
+}
+
+bool GetScrollOffsets(const base::NativeEvent& native_event,
+ float* x_offset,
+ float* y_offset,
+ float* x_offset_ordinal,
+ float* y_offset_ordinal,
+ int* finger_count) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool GetFlingData(const base::NativeEvent& native_event,
+ float* vx,
+ float* vy,
+ float* vx_ordinal,
+ float* vy_ordinal,
+ bool* is_cancel) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool GetGestureTimes(const base::NativeEvent& native_event,
+ double* start_time,
+ double* end_time) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void SetNaturalScroll(bool enabled) {
+ NOTIMPLEMENTED();
+}
+
+bool IsNaturalScrollEnabled() {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool IsTouchpadEvent(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool IsNoopEvent(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+base::NativeEvent CreateNoopEvent() {
+ return base::NativeEvent();
+}
+
+KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) {
+ NOTIMPLEMENTED();
+ return static_cast<KeyboardCode>(0);
+}
+
+} // namespace ui
diff --git a/ui/events/keycodes/keyboard_code_conversion.h b/ui/events/keycodes/keyboard_code_conversion.h
index 87baf88..b7bdd57 100644
--- a/ui/events/keycodes/keyboard_code_conversion.h
+++ b/ui/events/keycodes/keyboard_code_conversion.h
@@ -6,7 +6,7 @@
#define UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_H_
#include "base/basictypes.h"
-#include "ui/events/events_export.h"
+#include "ui/events/events_base_export.h"
#include "ui/events/keycodes/keyboard_codes.h"
namespace ui {
@@ -31,7 +31,8 @@ namespace ui {
// correct character. That's why we can use XLookupString() function to get
// the correct text generated by a X key event (See how is GetCharacter()
// implemented in event_x.cc).
-EVENTS_EXPORT uint16 GetCharacterFromKeyCode(KeyboardCode key_code, int flags);
+EVENTS_BASE_EXPORT uint16 GetCharacterFromKeyCode(KeyboardCode key_code,
+ int flags);
} // namespace ui
diff --git a/ui/events/keycodes/keyboard_code_conversion_android.h b/ui/events/keycodes/keyboard_code_conversion_android.h
index f064393..23552f5 100644
--- a/ui/events/keycodes/keyboard_code_conversion_android.h
+++ b/ui/events/keycodes/keyboard_code_conversion_android.h
@@ -5,12 +5,12 @@
#ifndef UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_ANDROID_H_
#define UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_ANDROID_H_
-#include "ui/events/events_export.h"
+#include "ui/events/events_base_export.h"
#include "ui/events/keycodes/keyboard_codes_posix.h"
namespace ui {
-EVENTS_EXPORT KeyboardCode KeyboardCodeFromAndroidKeyCode(int keycode);
+EVENTS_BASE_EXPORT KeyboardCode KeyboardCodeFromAndroidKeyCode(int keycode);
} // namespace ui
diff --git a/ui/events/keycodes/keyboard_code_conversion_gtk.h b/ui/events/keycodes/keyboard_code_conversion_gtk.h
index c9b6a8d..6258f41 100644
--- a/ui/events/keycodes/keyboard_code_conversion_gtk.h
+++ b/ui/events/keycodes/keyboard_code_conversion_gtk.h
@@ -36,21 +36,22 @@
#ifndef UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_GTK_H_
#define UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_GTK_H_
-#include "ui/events/events_export.h"
+#include "ui/events/events_base_export.h"
#include "ui/events/keycodes/keyboard_codes_posix.h"
typedef struct _GdkEventKey GdkEventKey;
namespace ui {
-EVENTS_EXPORT KeyboardCode WindowsKeyCodeForGdkKeyCode(int keycode);
+EVENTS_BASE_EXPORT KeyboardCode WindowsKeyCodeForGdkKeyCode(int keycode);
-EVENTS_EXPORT int GdkKeyCodeForWindowsKeyCode(KeyboardCode keycode, bool shift);
+EVENTS_BASE_EXPORT int GdkKeyCodeForWindowsKeyCode(KeyboardCode keycode,
+ bool shift);
// For WebKit DRT testing: simulate the native keycode for the given
// input |keycode|. Return the native keycode.
-EVENTS_EXPORT int GdkNativeKeyCodeForWindowsKeyCode(KeyboardCode keycode,
- bool shift);
+EVENTS_BASE_EXPORT int GdkNativeKeyCodeForWindowsKeyCode(KeyboardCode keycode,
+ bool shift);
} // namespace ui
diff --git a/ui/events/keycodes/keyboard_code_conversion_mac.h b/ui/events/keycodes/keyboard_code_conversion_mac.h
index d7c05b0..d74c579 100644
--- a/ui/events/keycodes/keyboard_code_conversion_mac.h
+++ b/ui/events/keycodes/keyboard_code_conversion_mac.h
@@ -8,7 +8,7 @@
#import <Cocoa/Cocoa.h>
#include "base/basictypes.h"
-#include "ui/events/events_export.h"
+#include "ui/events/events_base_export.h"
#include "ui/events/keycodes/keyboard_codes_posix.h"
namespace ui {
@@ -25,16 +25,17 @@ namespace ui {
// -1 will be returned if the keycode can't be converted.
// This function is mainly for simulating keyboard events in unit tests.
// See |KeyboardCodeFromNSEvent| for reverse conversion.
-EVENTS_EXPORT int MacKeyCodeForWindowsKeyCode(KeyboardCode keycode,
- NSUInteger flags,
- unichar* character,
- unichar* characterIgnoringModifiers);
+EVENTS_BASE_EXPORT int MacKeyCodeForWindowsKeyCode(
+ KeyboardCode keycode,
+ NSUInteger flags,
+ unichar* character,
+ unichar* characterIgnoringModifiers);
// This implementation cribbed from:
// third_party/WebKit/Source/web/mac/WebInputEventFactory.mm
// Converts |event| into a |KeyboardCode|. The mapping is not direct as the Mac
// has a different notion of key codes.
-EVENTS_EXPORT KeyboardCode KeyboardCodeFromNSEvent(NSEvent* event);
+EVENTS_BASE_EXPORT KeyboardCode KeyboardCodeFromNSEvent(NSEvent* event);
} // namespace ui
diff --git a/ui/events/keycodes/keyboard_code_conversion_win.h b/ui/events/keycodes/keyboard_code_conversion_win.h
index 9d1c5d7..1883c8d 100644
--- a/ui/events/keycodes/keyboard_code_conversion_win.h
+++ b/ui/events/keycodes/keyboard_code_conversion_win.h
@@ -5,14 +5,14 @@
#ifndef UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_WIN_H_
#define UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_WIN_H_
-#include "ui/events/events_export.h"
+#include "ui/events/events_base_export.h"
#include "ui/events/keycodes/keyboard_codes.h"
namespace ui {
// Methods to convert ui::KeyboardCode/Windows virtual key type methods.
-EVENTS_EXPORT WORD WindowsKeyCodeForKeyboardCode(KeyboardCode keycode);
-EVENTS_EXPORT KeyboardCode KeyboardCodeForWindowsKeyCode(WORD keycode);
+EVENTS_BASE_EXPORT WORD WindowsKeyCodeForKeyboardCode(KeyboardCode keycode);
+EVENTS_BASE_EXPORT KeyboardCode KeyboardCodeForWindowsKeyCode(WORD keycode);
} // namespace ui
diff --git a/ui/events/keycodes/keyboard_code_conversion_x.h b/ui/events/keycodes/keyboard_code_conversion_x.h
index 80b3806..bd8e9ca 100644
--- a/ui/events/keycodes/keyboard_code_conversion_x.h
+++ b/ui/events/keycodes/keyboard_code_conversion_x.h
@@ -6,22 +6,23 @@
#define UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_X_H_
#include "base/basictypes.h"
-#include "ui/events/events_export.h"
+#include "ui/events/events_base_export.h"
#include "ui/events/keycodes/keyboard_codes_posix.h"
typedef union _XEvent XEvent;
namespace ui {
-EVENTS_EXPORT KeyboardCode KeyboardCodeFromXKeyEvent(XEvent* xev);
+EVENTS_BASE_EXPORT KeyboardCode KeyboardCodeFromXKeyEvent(XEvent* xev);
-EVENTS_EXPORT KeyboardCode KeyboardCodeFromXKeysym(unsigned int keysym);
+EVENTS_BASE_EXPORT KeyboardCode KeyboardCodeFromXKeysym(unsigned int keysym);
// Returns a character on a standard US PC keyboard from an XEvent.
-EVENTS_EXPORT uint16 GetCharacterFromXEvent(XEvent* xev);
+EVENTS_BASE_EXPORT uint16 GetCharacterFromXEvent(XEvent* xev);
// Converts a KeyboardCode into an X KeySym.
-EVENTS_EXPORT int XKeysymForWindowsKeyCode(KeyboardCode keycode, bool shift);
+EVENTS_BASE_EXPORT int XKeysymForWindowsKeyCode(KeyboardCode keycode,
+ bool shift);
// Converts an X keycode into an X KeySym.
unsigned int DefaultXKeysymFromHardwareKeycode(unsigned int keycode);
diff --git a/ui/events/latency_info.h b/ui/events/latency_info.h
index fb58176..f0f89b7 100644
--- a/ui/events/latency_info.h
+++ b/ui/events/latency_info.h
@@ -10,7 +10,7 @@
#include "base/basictypes.h"
#include "base/time/time.h"
-#include "ui/events/events_export.h"
+#include "ui/events/events_base_export.h"
namespace ui {
@@ -57,7 +57,7 @@ enum LatencyComponentType {
WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT
};
-struct EVENTS_EXPORT LatencyInfo {
+struct EVENTS_BASE_EXPORT LatencyInfo {
struct LatencyComponent {
// Nondecreasing number that can be used to determine what events happened
// in the component at the time this struct was sent on to the next
diff --git a/ui/gfx/gfx.gyp b/ui/gfx/gfx.gyp
index 4a75a5e..6b5403c 100644
--- a/ui/gfx/gfx.gyp
+++ b/ui/gfx/gfx.gyp
@@ -23,6 +23,12 @@
'<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
'<(DEPTH)/url/url.gyp:url_lib',
],
+ # text_elider.h includes ICU headers.
+ 'export_dependent_settings': [
+ '<(DEPTH)/skia/skia.gyp:skia',
+ '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
+ '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
+ ],
'defines': [
'GFX_IMPLEMENTATION',
],
diff --git a/ui/message_center/message_center.gyp b/ui/message_center/message_center.gyp
index 39e9813..e0de1cc 100644
--- a/ui/message_center/message_center.gyp
+++ b/ui/message_center/message_center.gyp
@@ -17,7 +17,6 @@
'../../skia/skia.gyp:skia',
'../../url/url.gyp:url_lib',
'../base/strings/ui_strings.gyp:ui_strings',
- '../events/events.gyp:events',
'../gfx/gfx.gyp:gfx',
'../ui.gyp:ui',
'../ui.gyp:ui_resources',
@@ -99,6 +98,7 @@
'conditions': [
['toolkit_views==1', {
'dependencies': [
+ '../events/events.gyp:events',
'../views/views.gyp:views',
],
}, {
@@ -148,7 +148,6 @@
'../../base/base.gyp:base',
'../../base/base.gyp:test_support_base',
'../../skia/skia.gyp:skia',
- '../events/events.gyp:events',
'../gfx/gfx.gyp:gfx',
'../ui.gyp:ui',
'message_center',
@@ -170,7 +169,6 @@
'../../skia/skia.gyp:skia',
'../../testing/gtest.gyp:gtest',
'../../url/url.gyp:url_lib',
- '../events/events.gyp:events',
'../gfx/gfx.gyp:gfx',
'../ui.gyp:ui',
'../ui_unittests.gyp:run_ui_unittests',
diff --git a/ui/ozone/ozone.gyp b/ui/ozone/ozone.gyp
index ee5db69..47fa190 100644
--- a/ui/ozone/ozone.gyp
+++ b/ui/ozone/ozone.gyp
@@ -16,7 +16,6 @@
'dependencies': [
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx',
- '<(DEPTH)/ui/events/events.gyp:events',
'<(DEPTH)/skia/skia.gyp:skia',
'<@(external_ozone_platform_deps)',
],
diff --git a/ui/snapshot/snapshot.gyp b/ui/snapshot/snapshot.gyp
index 8cc7abf..b96567a 100644
--- a/ui/snapshot/snapshot.gyp
+++ b/ui/snapshot/snapshot.gyp
@@ -13,7 +13,6 @@
'dependencies': [
'../../skia/skia.gyp:skia',
'../../base/base.gyp:base',
- '../events/events.gyp:events',
'../gfx/gfx.gyp:gfx',
'../ui.gyp:ui',
],
@@ -51,7 +50,6 @@
'../../base/base.gyp:base',
'../../base/base.gyp:test_support_base',
'../../testing/gtest.gyp:gtest',
- '../events/events.gyp:events',
'../gfx/gfx.gyp:gfx',
'../ui.gyp:ui',
'snapshot'
diff --git a/ui/surface/surface.gyp b/ui/surface/surface.gyp
index 1b3e7e5..57a0d2c 100644
--- a/ui/surface/surface.gyp
+++ b/ui/surface/surface.gyp
@@ -61,7 +61,7 @@
'<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'<(DEPTH)/media/media.gyp:media',
'<(DEPTH)/skia/skia.gyp:skia',
- '<(DEPTH)/ui/events/events.gyp:events',
+ '<(DEPTH)/ui/events/events.gyp:events_base',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx',
'<(DEPTH)/ui/gl/gl.gyp:gl',
'<(DEPTH)/ui/ui.gyp:ui',
@@ -102,7 +102,7 @@
'<(DEPTH)/media/media.gyp:media',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/testing/gtest.gyp:gtest',
- '<(DEPTH)/ui/events/events.gyp:events',
+ '<(DEPTH)/ui/events/events.gyp:events_base',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx',
'<(DEPTH)/ui/ui.gyp:ui',
'surface',
diff --git a/ui/ui.gyp b/ui/ui.gyp
index 18ebe56..b167374 100644
--- a/ui/ui.gyp
+++ b/ui/ui.gyp
@@ -26,19 +26,15 @@
'../third_party/zlib/zlib.gyp:zlib',
'../url/url.gyp:url_lib',
'base/strings/ui_strings.gyp:ui_strings',
- 'events/events.gyp:events',
+ 'events/events.gyp:events_base',
'gfx/gfx.gyp:gfx',
'ui_resources',
],
'defines': [
'UI_IMPLEMENTATION',
],
- # Export these dependencies since text_elider.h includes ICU headers.
'export_dependent_settings': [
'../net/net.gyp:net',
- '../third_party/icu/icu.gyp:icui18n',
- '../third_party/icu/icu.gyp:icuuc',
- 'events/events.gyp:events',
'gfx/gfx.gyp:gfx',
],
'sources' : [
@@ -351,6 +347,11 @@
],
},
}],
+ ['toolkit_views==1', {
+ 'dependencies': [
+ 'events/events.gyp:events',
+ ],
+ }],
['use_aura==1', {
'sources/': [
['exclude', 'base/work_area_watcher_observer.h'],
diff --git a/ui/ui_unittests.gyp b/ui/ui_unittests.gyp
index 77ef413..bc7c586 100644
--- a/ui/ui_unittests.gyp
+++ b/ui/ui_unittests.gyp
@@ -13,7 +13,6 @@
'../base/base.gyp:base',
'../skia/skia.gyp:skia',
'../testing/gtest.gyp:gtest',
- 'events/events.gyp:events',
'gfx/gfx.gyp:gfx',
],
'sources': [
@@ -89,7 +88,7 @@
'../third_party/libpng/libpng.gyp:libpng',
'../url/url.gyp:url_lib',
'base/strings/ui_strings.gyp:ui_strings',
- 'events/events.gyp:events',
+ 'events/events.gyp:events_base',
'run_ui_unittests',
'shell_dialogs/shell_dialogs.gyp:shell_dialogs',
'ui.gyp:keycode_converter',
@@ -155,7 +154,6 @@
'base/cocoa/controls/blue_label_button_unittest.mm',
'base/cocoa/controls/hover_image_menu_button_unittest.mm',
'base/cocoa/controls/hyperlink_button_cell_unittest.mm',
- 'base/cocoa/events_mac_unittest.mm',
'base/cocoa/focus_tracker_unittest.mm',
'base/cocoa/fullscreen_window_manager_unittest.mm',
'base/cocoa/hover_image_button_unittest.mm',
@@ -332,6 +330,12 @@
'events/event_unittest.cc',
],
}],
+ ['toolkit_views==1', {
+ 'dependencies': [
+ 'events/events.gyp:events',
+ 'events/events.gyp:events_base',
+ ],
+ }],
['use_aura==1', {
'sources!': [
'base/dialogs/select_file_dialog_win_unittest.cc',
diff --git a/ui/views/views.gyp b/ui/views/views.gyp
index 23d3768..ccf8de2 100644
--- a/ui/views/views.gyp
+++ b/ui/views/views.gyp
@@ -31,6 +31,7 @@
'../base/strings/ui_strings.gyp:ui_strings',
'../compositor/compositor.gyp:compositor',
'../events/events.gyp:events',
+ '../events/events.gyp:events_base',
'../gfx/gfx.gyp:gfx',
'../native_theme/native_theme.gyp:native_theme',
'../ui.gyp:ui',