diff options
40 files changed, 141 insertions, 105 deletions
@@ -6,7 +6,7 @@ include_rules = [ "+third_party/skia/include", "+third_party/khronos/GLES2/gl2.h", "+third_party/khronos/GLES2/gl2ext.h", - "+ui/base", + "+ui/events/latency_info.h", "+ui/gfx", "+ui/gl", # DO NOT ADD ANY NEW WEBKIT HEADERS TO THIS LIST. diff --git a/cc/output/compositor_frame_metadata.h b/cc/output/compositor_frame_metadata.h index 4e569bb..c084151 100644 --- a/cc/output/compositor_frame_metadata.h +++ b/cc/output/compositor_frame_metadata.h @@ -6,7 +6,7 @@ #define CC_OUTPUT_COMPOSITOR_FRAME_METADATA_H_ #include "cc/base/cc_export.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" #include "ui/gfx/size_f.h" #include "ui/gfx/vector2d_f.h" diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index 09f2dec..72a5628 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h @@ -35,7 +35,7 @@ #include "cc/trees/occlusion_tracker.h" #include "cc/trees/proxy.h" #include "third_party/skia/include/core/SkColor.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" #include "ui/gfx/rect.h" namespace WebKit { class WebGraphicsContext3D; } diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h index 7c66759..eb6a015 100644 --- a/cc/trees/layer_tree_impl.h +++ b/cc/trees/layer_tree_impl.h @@ -13,7 +13,7 @@ #include "base/values.h" #include "cc/layers/layer_impl.h" #include "cc/resources/ui_resource_client.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" #if defined(COMPILER_GCC) namespace BASE_HASH_NAMESPACE { diff --git a/content/browser/android/in_process/synchronous_input_event_filter.cc b/content/browser/android/in_process/synchronous_input_event_filter.cc index 17c909d..34144da 100644 --- a/content/browser/android/in_process/synchronous_input_event_filter.cc +++ b/content/browser/android/in_process/synchronous_input_event_filter.cc @@ -8,7 +8,7 @@ #include "cc/input/input_handler.h" #include "content/browser/android/in_process/synchronous_compositor_impl.h" #include "content/public/browser/browser_thread.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" using WebKit::WebInputEvent; diff --git a/content/browser/aura/software_browser_compositor_output_surface.cc b/content/browser/aura/software_browser_compositor_output_surface.cc index c59806e..1f92582 100644 --- a/content/browser/aura/software_browser_compositor_output_surface.cc +++ b/content/browser/aura/software_browser_compositor_output_surface.cc @@ -8,7 +8,7 @@ #include "cc/output/compositor_frame.h" #include "cc/output/software_output_device.h" #include "content/browser/renderer_host/render_widget_host_impl.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" namespace content { diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index fda9cbd..0482b347e8 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -36,7 +36,7 @@ #include "gpu/command_buffer/service/gpu_switches.h" #include "ipc/ipc_channel_handle.h" #include "ipc/ipc_switches.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" #include "ui/gl/gl_switches.h" diff --git a/content/browser/renderer_host/compositing_iosurface_mac.h b/content/browser/renderer_host/compositing_iosurface_mac.h index 674e4e5..623272b 100644 --- a/content/browser/renderer_host/compositing_iosurface_mac.h +++ b/content/browser/renderer_host/compositing_iosurface_mac.h @@ -19,7 +19,7 @@ #include "base/time/time.h" #include "base/timer/timer.h" #include "media/base/video_frame.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/rect.h" #include "ui/gfx/rect_conversions.h" diff --git a/content/browser/renderer_host/input/input_queue_unittest.cc b/content/browser/renderer_host/input/input_queue_unittest.cc index ec66f2a..2d183d9 100644 --- a/content/browser/renderer_host/input/input_queue_unittest.cc +++ b/content/browser/renderer_host/input/input_queue_unittest.cc @@ -14,7 +14,7 @@ #include "content/common/input/web_input_event_payload.h" #include "content/common/input_messages.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" namespace content { namespace { diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index 11a557d..613177c 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h @@ -35,7 +35,7 @@ #include "ipc/ipc_listener.h" #include "ui/base/ime/text_input_mode.h" #include "ui/base/ime/text_input_type.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" #include "ui/gfx/native_widget_types.h" class WebCursor; diff --git a/content/common/content_param_traits_macros.h b/content/common/content_param_traits_macros.h index b99a331..ef56f26 100644 --- a/content/common/content_param_traits_macros.h +++ b/content/common/content_param_traits_macros.h @@ -11,7 +11,7 @@ #include "content/common/content_export.h" #include "ipc/ipc_message_macros.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" #include "webkit/common/resource_type.h" #undef IPC_MESSAGE_EXPORT diff --git a/content/common/gpu/client/command_buffer_proxy_impl.h b/content/common/gpu/client/command_buffer_proxy_impl.h index 04f826d..a3f6260 100644 --- a/content/common/gpu/client/command_buffer_proxy_impl.h +++ b/content/common/gpu/client/command_buffer_proxy_impl.h @@ -24,7 +24,7 @@ #include "gpu/command_buffer/common/command_buffer_shared.h" #include "ipc/ipc_listener.h" #include "media/video/video_decode_accelerator.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" struct GPUCommandBufferConsoleMessage; diff --git a/content/common/gpu/gpu_command_buffer_stub.h b/content/common/gpu/gpu_command_buffer_stub.h index 292c20b..7414b26 100644 --- a/content/common/gpu/gpu_command_buffer_stub.h +++ b/content/common/gpu/gpu_command_buffer_stub.h @@ -23,7 +23,7 @@ #include "ipc/ipc_listener.h" #include "ipc/ipc_sender.h" #include "media/base/video_decoder_config.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/size.h" #include "ui/gl/gl_surface.h" diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h index 49a2650..b4e5be5 100644 --- a/content/common/gpu/gpu_messages.h +++ b/content/common/gpu/gpu_messages.h @@ -27,7 +27,7 @@ #include "media/base/video_frame.h" #include "media/video/video_decode_accelerator.h" #include "media/video/video_encode_accelerator.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/size.h" #include "ui/gl/gpu_preference.h" diff --git a/content/common/gpu/image_transport_surface.h b/content/common/gpu/image_transport_surface.h index 7b2d11d..9a7889f 100644 --- a/content/common/gpu/image_transport_surface.h +++ b/content/common/gpu/image_transport_surface.h @@ -15,7 +15,7 @@ #include "content/common/content_export.h" #include "ipc/ipc_listener.h" #include "ipc/ipc_message.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" diff --git a/content/common/input/web_input_event_payload.h b/content/common/input/web_input_event_payload.h index 9857a5a..4d35b16 100644 --- a/content/common/input/web_input_event_payload.h +++ b/content/common/input/web_input_event_payload.h @@ -8,7 +8,7 @@ #include "base/basictypes.h" #include "content/common/content_export.h" #include "content/common/input/input_event.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" namespace WebKit { class WebInputEvent; diff --git a/content/common/input_messages.h b/content/common/input_messages.h index 5e6dd25..5d2e3ed 100644 --- a/content/common/input_messages.h +++ b/content/common/input_messages.h @@ -19,7 +19,7 @@ #include "content/public/common/common_param_traits.h" #include "ipc/ipc_message_macros.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" diff --git a/content/port/browser/event_with_latency_info.h b/content/port/browser/event_with_latency_info.h index 70788f9..a39ae52 100644 --- a/content/port/browser/event_with_latency_info.h +++ b/content/port/browser/event_with_latency_info.h @@ -5,7 +5,7 @@ #ifndef CONTENT_PORT_BROWSER_EVENT_WITH_LATENCY_INFO_H_ #define CONTENT_PORT_BROWSER_EVENT_WITH_LATENCY_INFO_H_ -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" namespace WebKit { class WebGestureEvent; diff --git a/content/renderer/gpu/input_handler_proxy.cc b/content/renderer/gpu/input_handler_proxy.cc index 1f88e62..f1ca2a5 100644 --- a/content/renderer/gpu/input_handler_proxy.cc +++ b/content/renderer/gpu/input_handler_proxy.cc @@ -10,7 +10,7 @@ #include "content/renderer/gpu/input_handler_proxy_client.h" #include "third_party/WebKit/public/platform/Platform.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" using WebKit::WebFloatPoint; using WebKit::WebFloatSize; diff --git a/content/renderer/gpu/input_handler_proxy_unittest.cc b/content/renderer/gpu/input_handler_proxy_unittest.cc index 3e8b8c8..4c74513 100644 --- a/content/renderer/gpu/input_handler_proxy_unittest.cc +++ b/content/renderer/gpu/input_handler_proxy_unittest.cc @@ -14,7 +14,7 @@ #include "third_party/WebKit/public/platform/WebGestureCurve.h" #include "third_party/WebKit/public/platform/WebPoint.h" #include "third_party/WebKit/public/web/WebInputEvent.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" using WebKit::WebActiveWheelFlingParameters; using WebKit::WebFloatPoint; diff --git a/ui/events/event.h b/ui/events/event.h index be2587f..2a8c0df 100644 --- a/ui/events/event.h +++ b/ui/events/event.h @@ -12,10 +12,9 @@ #include "base/time/time.h" #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/gestures/gesture_types.h" -#include "ui/base/latency_info.h" -#include "ui/base/ui_export.h" #include "ui/events/event_constants.h" #include "ui/events/keycodes/keyboard_codes.h" +#include "ui/events/latency_info.h" #include "ui/gfx/point.h" namespace gfx { @@ -25,7 +24,7 @@ class Transform; namespace ui { class EventTarget; -class UI_EXPORT Event { +class EVENTS_EXPORT Event { public: virtual ~Event(); @@ -238,13 +237,13 @@ class UI_EXPORT Event { EventResult result_; }; -class UI_EXPORT CancelModeEvent : public Event { +class EVENTS_EXPORT CancelModeEvent : public Event { public: CancelModeEvent(); virtual ~CancelModeEvent(); }; -class UI_EXPORT LocatedEvent : public Event { +class EVENTS_EXPORT LocatedEvent : public Event { public: // For testing. class TestApi : public Event::TestApi { @@ -311,7 +310,7 @@ class UI_EXPORT LocatedEvent : public Event { gfx::Point root_location_; }; -class UI_EXPORT MouseEvent : public LocatedEvent { +class EVENTS_EXPORT MouseEvent : public LocatedEvent { public: explicit MouseEvent(const base::NativeEvent& native_event); @@ -408,7 +407,7 @@ class UI_EXPORT MouseEvent : public LocatedEvent { class ScrollEvent; -class UI_EXPORT MouseWheelEvent : public MouseEvent { +class EVENTS_EXPORT MouseWheelEvent : public MouseEvent { public: // See |offset| for details. static const int kWheelDelta; @@ -442,7 +441,7 @@ class UI_EXPORT MouseWheelEvent : public MouseEvent { gfx::Vector2d offset_; }; -class UI_EXPORT TouchEvent : public LocatedEvent { +class EVENTS_EXPORT TouchEvent : public LocatedEvent { public: explicit TouchEvent(const base::NativeEvent& native_event); @@ -525,7 +524,7 @@ class UI_EXPORT TouchEvent : public LocatedEvent { float force_; }; -class UI_EXPORT KeyEvent : public Event { +class EVENTS_EXPORT KeyEvent : public Event { public: KeyEvent(const base::NativeEvent& native_event, bool is_char); @@ -585,7 +584,7 @@ class UI_EXPORT KeyEvent : public Event { // TranslatedKeyEvent(VKEY_SPACE) event. If the IME receives a KeyEvent and // it does consume the event, it might dispatch a // TranslatedKeyEvent(VKEY_PROCESSKEY) event as defined in the DOM spec. -class UI_EXPORT TranslatedKeyEvent : public KeyEvent { +class EVENTS_EXPORT TranslatedKeyEvent : public KeyEvent { public: TranslatedKeyEvent(const base::NativeEvent& native_event, bool is_char); @@ -600,7 +599,7 @@ class UI_EXPORT TranslatedKeyEvent : public KeyEvent { DISALLOW_COPY_AND_ASSIGN(TranslatedKeyEvent); }; -class UI_EXPORT DropTargetEvent : public LocatedEvent { +class EVENTS_EXPORT DropTargetEvent : public LocatedEvent { public: DropTargetEvent(const OSExchangeData& data, const gfx::Point& location, @@ -620,7 +619,7 @@ class UI_EXPORT DropTargetEvent : public LocatedEvent { DISALLOW_COPY_AND_ASSIGN(DropTargetEvent); }; -class UI_EXPORT ScrollEvent : public MouseEvent { +class EVENTS_EXPORT ScrollEvent : public MouseEvent { public: explicit ScrollEvent(const base::NativeEvent& native_event); template <class T> @@ -672,7 +671,7 @@ class UI_EXPORT ScrollEvent : public MouseEvent { int finger_count_; }; -class UI_EXPORT GestureEvent : public LocatedEvent { +class EVENTS_EXPORT GestureEvent : public LocatedEvent { public: GestureEvent(EventType type, int x, diff --git a/ui/events/event_conversion_gtk.h b/ui/events/event_conversion_gtk.h index f1019837..aa0b0c0 100644 --- a/ui/events/event_conversion_gtk.h +++ b/ui/events/event_conversion_gtk.h @@ -7,13 +7,13 @@ #include <gtk/gtk.h> -#include "ui/base/ui_export.h" +#include "ui/events/events_export.h" namespace ui { -UI_EXPORT int GdkModifierToEventFlag(GdkModifierType gdk_modifier); +EVENTS_EXPORT int GdkModifierToEventFlag(GdkModifierType gdk_modifier); -UI_EXPORT GdkModifierType EventFlagToGdkModifier(int event_flag); +EVENTS_EXPORT GdkModifierType EventFlagToGdkModifier(int event_flag); } // namespace ui diff --git a/ui/events/event_dispatcher.h b/ui/events/event_dispatcher.h index caaa514..ef8d6b1 100644 --- a/ui/events/event_dispatcher.h +++ b/ui/events/event_dispatcher.h @@ -6,16 +6,16 @@ #define UI_EVENTS_EVENT_DISPATCHER_H_ #include "base/auto_reset.h" -#include "ui/base/ui_export.h" #include "ui/events/event.h" #include "ui/events/event_constants.h" #include "ui/events/event_target.h" +#include "ui/events/events_export.h" namespace ui { class EventDispatcher; -class UI_EXPORT EventDispatcherDelegate { +class EVENTS_EXPORT EventDispatcherDelegate { public: EventDispatcherDelegate(); virtual ~EventDispatcherDelegate(); @@ -42,7 +42,7 @@ class UI_EXPORT EventDispatcherDelegate { }; // Dispatches events to appropriate targets. -class UI_EXPORT EventDispatcher { +class EVENTS_EXPORT EventDispatcher { public: explicit EventDispatcher(EventDispatcherDelegate* delegate); virtual ~EventDispatcher(); diff --git a/ui/events/event_handler.h b/ui/events/event_handler.h index bee8690..088c3f8 100644 --- a/ui/events/event_handler.h +++ b/ui/events/event_handler.h @@ -9,8 +9,8 @@ #include <vector> #include "base/basictypes.h" -#include "ui/base/ui_export.h" #include "ui/events/event_constants.h" +#include "ui/events/events_export.h" namespace ui { @@ -26,7 +26,7 @@ class TouchEvent; // Dispatches events to appropriate targets. The default implementations of // all of the specific handlers (e.g. OnKeyEvent, OnMouseEvent) do nothing. -class UI_EXPORT EventHandler { +class EVENTS_EXPORT EventHandler { public: EventHandler(); virtual ~EventHandler(); diff --git a/ui/events/event_target.h b/ui/events/event_target.h index b37bff1..39671e2 100644 --- a/ui/events/event_target.h +++ b/ui/events/event_target.h @@ -7,14 +7,14 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" -#include "ui/base/ui_export.h" #include "ui/events/event_handler.h" +#include "ui/events/events_export.h" namespace ui { class EventDispatcher; -class UI_EXPORT EventTarget : public EventHandler { +class EVENTS_EXPORT EventTarget : public EventHandler { public: typedef std::vector<EventTarget*> EventTargets; diff --git a/ui/events/event_utils.h b/ui/events/event_utils.h index ed74eb1..bcf1213 100644 --- a/ui/events/event_utils.h +++ b/ui/events/event_utils.h @@ -9,6 +9,7 @@ #include "ui/events/event_constants.h" #include "ui/events/keycodes/keyboard_codes.h" #include "ui/gfx/native_widget_types.h" +#include "ui/events/events_export.h" #if defined(OS_WIN) #include <windows.h> @@ -28,30 +29,31 @@ namespace ui { class Event; // Updates the list of devices for cached properties. -UI_EXPORT void UpdateDeviceList(); +EVENTS_EXPORT void UpdateDeviceList(); // Get the EventType from a native event. -UI_EXPORT EventType EventTypeFromNative(const base::NativeEvent& native_event); +EVENTS_EXPORT EventType EventTypeFromNative( + const base::NativeEvent& native_event); // Get the EventFlags from a native event. -UI_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event); +EVENTS_EXPORT int EventFlagsFromNative(const base::NativeEvent& native_event); // Get the timestamp from a native event. -UI_EXPORT base::TimeDelta EventTimeFromNative( +EVENTS_EXPORT base::TimeDelta EventTimeFromNative( const base::NativeEvent& native_event); // Create a timestamp based on the current time. -UI_EXPORT base::TimeDelta EventTimeForNow(); +EVENTS_EXPORT base::TimeDelta EventTimeForNow(); // Get the location from a native event. The coordinate system of the resultant // |Point| has the origin at top-left of the "root window". The nature of // this "root window" and how it maps to platform-specific drawing surfaces is // defined in ui/aura/root_window.* and ui/aura/root_window_host*. -UI_EXPORT gfx::Point EventLocationFromNative( +EVENTS_EXPORT gfx::Point EventLocationFromNative( const base::NativeEvent& native_event); // Gets the location in native system coordinate space. -UI_EXPORT gfx::Point EventSystemLocationFromNative( +EVENTS_EXPORT gfx::Point EventSystemLocationFromNative( const base::NativeEvent& native_event); #if defined(USE_X11) @@ -59,43 +61,44 @@ UI_EXPORT gfx::Point EventSystemLocationFromNative( // does not take into account any remapping (e.g. using xmodmap), while the // button reported in master events do. This is a utility function to always // return the mapped button. -UI_EXPORT int EventButtonFromNative(const base::NativeEvent& native_event); +EVENTS_EXPORT int EventButtonFromNative(const base::NativeEvent& native_event); #endif // Returns the KeyboardCode from a native event. -UI_EXPORT KeyboardCode KeyboardCodeFromNative( +EVENTS_EXPORT KeyboardCode KeyboardCodeFromNative( const base::NativeEvent& native_event); // Returns true if the message is a mouse event. -UI_EXPORT bool IsMouseEvent(const base::NativeEvent& native_event); +EVENTS_EXPORT bool IsMouseEvent(const base::NativeEvent& native_event); // Returns the flags of the button that changed during a press/release. -UI_EXPORT int GetChangedMouseButtonFlagsFromNative( +EVENTS_EXPORT int GetChangedMouseButtonFlagsFromNative( const base::NativeEvent& native_event); // Gets the mouse wheel offsets from a native event. -UI_EXPORT gfx::Vector2d GetMouseWheelOffset( +EVENTS_EXPORT gfx::Vector2d GetMouseWheelOffset( const base::NativeEvent& native_event); // Gets the touch id from a native event. -UI_EXPORT int GetTouchId(const base::NativeEvent& native_event); +EVENTS_EXPORT int GetTouchId(const base::NativeEvent& native_event); // Clear the touch id from bookkeeping if it is a release/cancel event. -UI_EXPORT void ClearTouchIdIfReleased(const base::NativeEvent& native_event); +EVENTS_EXPORT void ClearTouchIdIfReleased( + const base::NativeEvent& native_event); // Gets the radius along the X/Y axis from a native event. Default is 1.0. -UI_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); -UI_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); +EVENTS_EXPORT float GetTouchRadiusX(const base::NativeEvent& native_event); +EVENTS_EXPORT float GetTouchRadiusY(const base::NativeEvent& native_event); // Gets the angle of the major axis away from the X axis. Default is 0.0. -UI_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); +EVENTS_EXPORT float GetTouchAngle(const base::NativeEvent& native_event); // Gets the force from a native_event. Normalized to be [0, 1]. Default is 0.0. -UI_EXPORT float GetTouchForce(const base::NativeEvent& native_event); +EVENTS_EXPORT float GetTouchForce(const base::NativeEvent& native_event); // Gets the fling velocity from a native event. is_cancel is set to true if // this was a tap down, intended to stop an ongoing fling. -UI_EXPORT bool GetFlingData(const base::NativeEvent& native_event, +EVENTS_EXPORT bool GetFlingData(const base::NativeEvent& native_event, float* vx, float* vy, float* vx_ordinal, @@ -104,49 +107,49 @@ UI_EXPORT bool GetFlingData(const base::NativeEvent& native_event, // Returns whether this is a scroll event and optionally gets the amount to be // scrolled. |x_offset|, |y_offset| and |finger_count| can be NULL. -UI_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, +EVENTS_EXPORT bool GetScrollOffsets(const base::NativeEvent& native_event, float* x_offset, float* y_offset, float* x_offset_ordinal, float* y_offset_ordinal, int* finger_count); -UI_EXPORT bool GetGestureTimes(const base::NativeEvent& native_event, +EVENTS_EXPORT bool GetGestureTimes(const base::NativeEvent& native_event, double* start_time, double* end_time); // Enable/disable natural scrolling for touchpads. -UI_EXPORT void SetNaturalScroll(bool enabled); +EVENTS_EXPORT void SetNaturalScroll(bool enabled); // In natural scrolling enabled for touchpads? -UI_EXPORT bool IsNaturalScrollEnabled(); +EVENTS_EXPORT bool IsNaturalScrollEnabled(); // Was this event generated by a touchpad device? // The caller is responsible for ensuring that this is a mouse/touchpad event // before calling this function. -UI_EXPORT bool IsTouchpadEvent(const base::NativeEvent& event); +EVENTS_EXPORT bool IsTouchpadEvent(const base::NativeEvent& event); // Returns true if event is noop. -UI_EXPORT bool IsNoopEvent(const base::NativeEvent& event); +EVENTS_EXPORT bool IsNoopEvent(const base::NativeEvent& event); // Creates and returns no-op event. -UI_EXPORT base::NativeEvent CreateNoopEvent(); +EVENTS_EXPORT base::NativeEvent CreateNoopEvent(); #if defined(OS_WIN) -UI_EXPORT int GetModifiersFromACCEL(const ACCEL& accel); -UI_EXPORT int GetModifiersFromKeyState(); +EVENTS_EXPORT int GetModifiersFromACCEL(const ACCEL& accel); +EVENTS_EXPORT int GetModifiersFromKeyState(); // Returns true if |message| identifies a mouse event that was generated as the // result of a touch event. -UI_EXPORT bool IsMouseEventFromTouch(UINT message); +EVENTS_EXPORT bool IsMouseEventFromTouch(UINT message); #endif // Returns true if default post-target handling was canceled for |event| after // its dispatch to its target. -UI_EXPORT bool EventCanceledDefaultHandling(const Event& event); +EVENTS_EXPORT bool EventCanceledDefaultHandling(const Event& event); // Registers a custom event type. -UI_EXPORT int RegisterCustomEventType(); +EVENTS_EXPORT int RegisterCustomEventType(); } // namespace ui diff --git a/ui/events/events_export.h b/ui/events/events_export.h new file mode 100644 index 0000000..84d96a6 --- /dev/null +++ b/ui/events/events_export.h @@ -0,0 +1,33 @@ +// 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_EXPORT_H_ +#define UI_EVENTS_EVENTS_EXPORT_H_ + +// TODO(beng): remove include once events dependencies have been corrected. + +#include "ui/base/ui_export.h" + +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(UI_IMPLEMENTATION) +#define EVENTS_EXPORT __declspec(dllexport) +#else +#define EVENTS_EXPORT __declspec(dllimport) +#endif // defined(UI_IMPLEMENTATION) + +#else // defined(WIN32) +#if defined(UI_IMPLEMENTATION) +#define EVENTS_EXPORT __attribute__((visibility("default"))) +#else +#define EVENTS_EXPORT +#endif +#endif + +#else // defined(COMPONENT_BUILD) +#define EVENTS_EXPORT +#endif + +#endif // UI_EVENTS_EVENTS_EXPORT_H_ diff --git a/ui/events/keycodes/keyboard_code_conversion.h b/ui/events/keycodes/keyboard_code_conversion.h index 0dd5a12..87baf88 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/base/ui_export.h" +#include "ui/events/events_export.h" #include "ui/events/keycodes/keyboard_codes.h" namespace ui { @@ -31,7 +31,7 @@ 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). -UI_EXPORT uint16 GetCharacterFromKeyCode(KeyboardCode key_code, int flags); +EVENTS_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 8be44c8..f064393 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/base/ui_export.h" +#include "ui/events/events_export.h" #include "ui/events/keycodes/keyboard_codes_posix.h" namespace ui { -UI_EXPORT KeyboardCode KeyboardCodeFromAndroidKeyCode(int keycode); +EVENTS_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 a01bff7..c9b6a8d 100644 --- a/ui/events/keycodes/keyboard_code_conversion_gtk.h +++ b/ui/events/keycodes/keyboard_code_conversion_gtk.h @@ -36,20 +36,20 @@ #ifndef UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_GTK_H_ #define UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_GTK_H_ -#include "ui/base/ui_export.h" +#include "ui/events/events_export.h" #include "ui/events/keycodes/keyboard_codes_posix.h" typedef struct _GdkEventKey GdkEventKey; namespace ui { -UI_EXPORT KeyboardCode WindowsKeyCodeForGdkKeyCode(int keycode); +EVENTS_EXPORT KeyboardCode WindowsKeyCodeForGdkKeyCode(int keycode); -UI_EXPORT int GdkKeyCodeForWindowsKeyCode(KeyboardCode keycode, bool shift); +EVENTS_EXPORT int GdkKeyCodeForWindowsKeyCode(KeyboardCode keycode, bool shift); // For WebKit DRT testing: simulate the native keycode for the given // input |keycode|. Return the native keycode. -UI_EXPORT int GdkNativeKeyCodeForWindowsKeyCode(KeyboardCode keycode, +EVENTS_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 92e6b13..d7c05b0 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/base/ui_export.h" +#include "ui/events/events_export.h" #include "ui/events/keycodes/keyboard_codes_posix.h" namespace ui { @@ -25,7 +25,7 @@ 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. -UI_EXPORT int MacKeyCodeForWindowsKeyCode(KeyboardCode keycode, +EVENTS_EXPORT int MacKeyCodeForWindowsKeyCode(KeyboardCode keycode, NSUInteger flags, unichar* character, unichar* characterIgnoringModifiers); @@ -34,7 +34,7 @@ UI_EXPORT int MacKeyCodeForWindowsKeyCode(KeyboardCode keycode, // 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. -UI_EXPORT KeyboardCode KeyboardCodeFromNSEvent(NSEvent* event); +EVENTS_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 9964138..9d1c5d7 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/base/ui_export.h" +#include "ui/events/events_export.h" #include "ui/events/keycodes/keyboard_codes.h" namespace ui { // Methods to convert ui::KeyboardCode/Windows virtual key type methods. -UI_EXPORT WORD WindowsKeyCodeForKeyboardCode(KeyboardCode keycode); -UI_EXPORT KeyboardCode KeyboardCodeForWindowsKeyCode(WORD keycode); +EVENTS_EXPORT WORD WindowsKeyCodeForKeyboardCode(KeyboardCode keycode); +EVENTS_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 8fd1e84..80b3806 100644 --- a/ui/events/keycodes/keyboard_code_conversion_x.h +++ b/ui/events/keycodes/keyboard_code_conversion_x.h @@ -6,22 +6,22 @@ #define UI_EVENTS_KEYCODES_KEYBOARD_CODE_CONVERSION_X_H_ #include "base/basictypes.h" -#include "ui/base/ui_export.h" +#include "ui/events/events_export.h" #include "ui/events/keycodes/keyboard_codes_posix.h" typedef union _XEvent XEvent; namespace ui { -UI_EXPORT KeyboardCode KeyboardCodeFromXKeyEvent(XEvent* xev); +EVENTS_EXPORT KeyboardCode KeyboardCodeFromXKeyEvent(XEvent* xev); -UI_EXPORT KeyboardCode KeyboardCodeFromXKeysym(unsigned int keysym); +EVENTS_EXPORT KeyboardCode KeyboardCodeFromXKeysym(unsigned int keysym); // Returns a character on a standard US PC keyboard from an XEvent. -UI_EXPORT uint16 GetCharacterFromXEvent(XEvent* xev); +EVENTS_EXPORT uint16 GetCharacterFromXEvent(XEvent* xev); // Converts a KeyboardCode into an X KeySym. -UI_EXPORT int XKeysymForWindowsKeyCode(KeyboardCode keycode, bool shift); +EVENTS_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/base/latency_info.cc b/ui/events/latency_info.cc index 9551450..796f442 100644 --- a/ui/base/latency_info.cc +++ b/ui/events/latency_info.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/latency_info.h" +#include "ui/events/latency_info.h" #include <algorithm> diff --git a/ui/base/latency_info.h b/ui/events/latency_info.h index 3482a50..8bf5610 100644 --- a/ui/base/latency_info.h +++ b/ui/events/latency_info.h @@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_BASE_LATENCY_INFO_H_ -#define UI_BASE_LATENCY_INFO_H_ +#ifndef UI_EVENTS_LATENCY_INFO_H_ +#define UI_EVENTS_LATENCY_INFO_H_ #include <map> #include <utility> #include "base/basictypes.h" #include "base/time/time.h" -#include "ui/base/ui_export.h" +#include "ui/events/events_export.h" namespace ui { @@ -35,7 +35,7 @@ enum LatencyComponentType { INPUT_EVENT_LATENCY_ACKED_COMPONENT }; -struct UI_EXPORT LatencyInfo { +struct EVENTS_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 @@ -93,4 +93,4 @@ struct UI_EXPORT LatencyInfo { } // namespace ui -#endif // UI_BASE_LATENCY_INFO_H_ +#endif // UI_EVENTS_LATENCY_INFO_H_ diff --git a/ui/base/latency_info_unittest.cc b/ui/events/latency_info_unittest.cc index bb83478..32bb869 100644 --- a/ui/base/latency_info_unittest.cc +++ b/ui/events/latency_info_unittest.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/latency_info.h" +#include "ui/events/latency_info.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/ui/surface/accelerated_surface_win.cc b/ui/surface/accelerated_surface_win.cc index 3faf01d..15d78c0 100644 --- a/ui/surface/accelerated_surface_win.cc +++ b/ui/surface/accelerated_surface_win.cc @@ -25,8 +25,8 @@ #include "media/base/video_frame.h" #include "media/base/video_util.h" #include "third_party/skia/include/core/SkBitmap.h" -#include "ui/base/latency_info.h" #include "ui/base/win/shell.h" +#include "ui/events/latency_info.h" #include "ui/gfx/rect.h" #include "ui/gfx/win/dpi.h" #include "ui/gfx/win/hwnd_util.h" diff --git a/ui/surface/accelerated_surface_win.h b/ui/surface/accelerated_surface_win.h index 110e206..7c4164b 100644 --- a/ui/surface/accelerated_surface_win.h +++ b/ui/surface/accelerated_surface_win.h @@ -14,7 +14,7 @@ #include "base/synchronization/waitable_event.h" #include "base/time/time.h" #include "base/win/scoped_comptr.h" -#include "ui/base/latency_info.h" +#include "ui/events/latency_info.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/size.h" #include "ui/surface/surface_export.h" @@ -203,8 +203,6 @@ 'base/gtk/scoped_region.cc', 'base/gtk/scoped_region.h', 'base/hit_test.h', - 'base/latency_info.cc', - 'base/latency_info.h', 'base/l10n/l10n_font_util.cc', 'base/l10n/l10n_font_util.h', 'base/l10n/l10n_util.cc', @@ -367,6 +365,7 @@ 'events/event_target.h', 'events/event_utils.cc', 'events/event_utils.h', + 'events/events_export.h', 'events/keycodes/keyboard_code_conversion.cc', 'events/keycodes/keyboard_code_conversion.h', 'events/keycodes/keyboard_code_conversion_android.cc', @@ -380,6 +379,8 @@ 'events/keycodes/keyboard_code_conversion_x.cc', 'events/keycodes/keyboard_code_conversion_x.h', 'events/keycodes/keyboard_codes.h', + 'events/latency_info.cc', + 'events/latency_info.h', 'gfx/android/device_display_info.cc', 'gfx/android/device_display_info.h', 'gfx/android/java_bitmap.cc', diff --git a/ui/ui_unittests.gypi b/ui/ui_unittests.gypi index 629fbd9..a64bd88 100644 --- a/ui/ui_unittests.gypi +++ b/ui/ui_unittests.gypi @@ -157,7 +157,6 @@ 'base/gtk/gtk_expanded_container_unittest.cc', 'base/gtk/gtk_im_context_util_unittest.cc', 'base/keycodes/keycode_converter_unittest.cc', - 'base/latency_info_unittest.cc', 'base/models/list_model_unittest.cc', 'base/models/list_selection_model_unittest.cc', 'base/models/tree_node_model_unittest.cc', @@ -168,6 +167,7 @@ 'base/view_prop_unittest.cc', 'events/event_dispatcher_unittest.cc', 'events/event_unittest.cc', + 'events/latency_info_unittest.cc', 'gfx/blit_unittest.cc', 'gfx/break_list_unittest.cc', 'gfx/canvas_unittest.cc', |