Commit 236230f5 authored by sadrul@chromium.org's avatar sadrul@chromium.org

ui: Remove some unnecessary functions from the API.

. There is only X11 implementation of IsTouchpadEvent(), and it is used
  by DeviceUMA. But DeviceUMA also talks to DeviceDataManagerX11. So
  remove ui::IsTouchpadEvent(), and directly query DDMX11 whether the
  event is a touchpad event.

. Remove SetNaturalScroll() and IsNaturalScrollEnabled() since nothing uses
  these anymore (and there are no implementations of these either).

BUG=none
R=derat@chromium.org

Review URL: https://codereview.chromium.org/405683002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284306 0039d316-1c4b-4281-b951-d872f2087c98
parent 30c311f6
......@@ -85,9 +85,12 @@ void DeviceUMA::CheckTouchpadEvent(XEvent* native_event) {
void DeviceUMA::CheckIncomingEvent(XEvent* event) {
switch (event->type) {
case GenericEvent: {
if (ui::DeviceDataManagerX11::GetInstance()->IsXIDeviceEvent(event) &&
ui::IsTouchpadEvent(event))
ui::DeviceDataManagerX11* devices =
ui::DeviceDataManagerX11::GetInstance();
if (devices->IsXIDeviceEvent(event) &&
devices->IsTouchpadXInputEvent(event)) {
CheckTouchpadEvent(event);
}
break;
}
default:
......
......@@ -204,20 +204,6 @@ bool GetGestureTimes(const base::NativeEvent& native_event,
return false;
}
void SetNaturalScroll(bool enabled) {
NOTIMPLEMENTED();
}
bool IsNaturalScrollEnabled() {
NOTIMPLEMENTED();
return false;
}
bool IsTouchpadEvent(const base::NativeEvent& native_event) {
NOTIMPLEMENTED();
return false;
}
KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) {
return KeyboardCodeFromNSEvent(native_event);
}
......
......@@ -148,11 +148,6 @@ EVENTS_EXPORT bool ShouldDefaultToNaturalScroll();
// Returns whether or not the internal display produces touch events.
EVENTS_EXPORT gfx::Display::TouchSupport GetInternalDisplayTouchSupport();
// 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.
EVENTS_EXPORT bool IsTouchpadEvent(const base::NativeEvent& event);
#if defined(OS_WIN)
EVENTS_EXPORT int GetModifiersFromACCEL(const ACCEL& accel);
EVENTS_EXPORT int GetModifiersFromKeyState();
......
......@@ -125,20 +125,6 @@ bool GetGestureTimes(const base::NativeEvent& native_event,
return false;
}
void SetNaturalScroll(bool enabled) {
NOTIMPLEMENTED();
}
bool IsNaturalScrollEnabled() {
NOTIMPLEMENTED();
return false;
}
bool IsTouchpadEvent(const base::NativeEvent& native_event) {
NOTIMPLEMENTED();
return false;
}
KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) {
NOTIMPLEMENTED();
return static_cast<KeyboardCode>(0);
......
......@@ -144,15 +144,6 @@ bool GetGestureTimes(const base::NativeEvent& native_event,
return false;
}
void SetNaturalScroll(bool /* enabled */) { NOTIMPLEMENTED(); }
bool IsNaturalScrollEnabled() { return false; }
bool IsTouchpadEvent(const base::NativeEvent& event) {
NOTIMPLEMENTED();
return false;
}
int GetModifiersFromKeyState() {
NOTIMPLEMENTED();
return 0;
......
......@@ -352,20 +352,6 @@ bool GetGestureTimes(const base::NativeEvent& native_event,
return false;
}
void SetNaturalScroll(bool enabled) {
NOTIMPLEMENTED();
}
bool IsNaturalScrollEnabled() {
NOTIMPLEMENTED();
return false;
}
bool IsTouchpadEvent(const base::NativeEvent& event) {
NOTIMPLEMENTED();
return false;
}
int GetModifiersFromACCEL(const ACCEL& accel) {
int modifiers = EF_NONE;
if (accel.fVirt & FSHIFT)
......
......@@ -371,17 +371,17 @@ EventType EventTypeFromNative(const base::NativeEvent& native_event) {
}
case XI_Motion: {
bool is_cancel;
if (GetFlingData(native_event, NULL, NULL, NULL, NULL, &is_cancel)) {
DeviceDataManagerX11* devices = DeviceDataManagerX11::GetInstance();
if (GetFlingData(native_event, NULL, NULL, NULL, NULL, &is_cancel))
return is_cancel ? ET_SCROLL_FLING_CANCEL : ET_SCROLL_FLING_START;
} else if (DeviceDataManagerX11::GetInstance()->IsScrollEvent(
native_event)) {
return IsTouchpadEvent(native_event) ? ET_SCROLL : ET_MOUSEWHEEL;
} else if (DeviceDataManagerX11::GetInstance()->IsCMTMetricsEvent(
native_event)) {
if (devices->IsScrollEvent(native_event)) {
return devices->IsTouchpadXInputEvent(native_event) ? ET_SCROLL
: ET_MOUSEWHEEL;
}
if (devices->IsCMTMetricsEvent(native_event))
return ET_UMA_DATA;
} else if (GetButtonMaskForX2Event(xievent)) {
if (GetButtonMaskForX2Event(xievent))
return ET_MOUSE_DRAGGED;
}
return ET_MOUSE_MOVED;
}
case XI_KeyPress:
......@@ -808,8 +808,4 @@ bool GetGestureTimes(const base::NativeEvent& native_event,
return true;
}
bool IsTouchpadEvent(const base::NativeEvent& event) {
return DeviceDataManagerX11::GetInstance()->IsTouchpadXInputEvent(event);
}
} // namespace ui
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment