| Index: content/browser/renderer_host/render_widget_host_view_win.cc
|
| diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc
|
| index 97ec948cf275a63038860c905070e1d750ff1d31..f0b25b3367f1e39c7a233f40caa6418208917b08 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_win.cc
|
| +++ b/content/browser/renderer_host/render_widget_host_view_win.cc
|
| @@ -83,9 +83,9 @@
|
| using base::TimeDelta;
|
| using base::TimeTicks;
|
| using ui::ViewProp;
|
| -using WebKit::WebInputEvent;
|
| -using WebKit::WebMouseEvent;
|
| -using WebKit::WebTextDirection;
|
| +using blink::WebInputEvent;
|
| +using blink::WebMouseEvent;
|
| +using blink::WebTextDirection;
|
|
|
| namespace content {
|
| namespace {
|
| @@ -202,10 +202,10 @@ bool DecodeScrollGesture(const GESTUREINFO& gi,
|
| return true;
|
| }
|
|
|
| -WebKit::WebMouseWheelEvent MakeFakeScrollWheelEvent(HWND hwnd,
|
| +blink::WebMouseWheelEvent MakeFakeScrollWheelEvent(HWND hwnd,
|
| POINT start,
|
| POINT delta) {
|
| - WebKit::WebMouseWheelEvent result;
|
| + blink::WebMouseWheelEvent result;
|
| result.type = WebInputEvent::MouseWheel;
|
| result.timeStampSeconds = ::GetMessageTime() / 1000.0;
|
| result.button = WebMouseEvent::ButtonNone;
|
| @@ -236,17 +236,17 @@ inline void SetTouchType(TOUCHINPUT* point, int type) {
|
| point->dwFlags = (point->dwFlags & kTouchMask) | type;
|
| }
|
|
|
| -ui::EventType ConvertToUIEvent(WebKit::WebTouchPoint::State t) {
|
| +ui::EventType ConvertToUIEvent(blink::WebTouchPoint::State t) {
|
| switch (t) {
|
| - case WebKit::WebTouchPoint::StatePressed:
|
| + case blink::WebTouchPoint::StatePressed:
|
| return ui::ET_TOUCH_PRESSED;
|
| - case WebKit::WebTouchPoint::StateMoved:
|
| + case blink::WebTouchPoint::StateMoved:
|
| return ui::ET_TOUCH_MOVED;
|
| - case WebKit::WebTouchPoint::StateStationary:
|
| + case blink::WebTouchPoint::StateStationary:
|
| return ui::ET_TOUCH_STATIONARY;
|
| - case WebKit::WebTouchPoint::StateReleased:
|
| + case blink::WebTouchPoint::StateReleased:
|
| return ui::ET_TOUCH_RELEASED;
|
| - case WebKit::WebTouchPoint::StateCancelled:
|
| + case blink::WebTouchPoint::StateCancelled:
|
| return ui::ET_TOUCH_CANCELLED;
|
| default:
|
| DCHECK(false) << "Unexpected ui type. " << t;
|
| @@ -255,9 +255,9 @@ ui::EventType ConvertToUIEvent(WebKit::WebTouchPoint::State t) {
|
| }
|
|
|
| // Creates a WebGestureEvent corresponding to the given |gesture|
|
| -WebKit::WebGestureEvent CreateWebGestureEvent(HWND hwnd,
|
| +blink::WebGestureEvent CreateWebGestureEvent(HWND hwnd,
|
| const ui::GestureEvent& gesture) {
|
| - WebKit::WebGestureEvent gesture_event =
|
| + blink::WebGestureEvent gesture_event =
|
| MakeWebGestureEventFromUIEvent(gesture);
|
|
|
| POINT client_point = gesture.location().ToPOINT();
|
| @@ -272,17 +272,17 @@ WebKit::WebGestureEvent CreateWebGestureEvent(HWND hwnd,
|
| return gesture_event;
|
| }
|
|
|
| -WebKit::WebGestureEvent CreateFlingCancelEvent(double time_stamp) {
|
| - WebKit::WebGestureEvent gesture_event;
|
| +blink::WebGestureEvent CreateFlingCancelEvent(double time_stamp) {
|
| + blink::WebGestureEvent gesture_event;
|
| gesture_event.timeStampSeconds = time_stamp;
|
| - gesture_event.type = WebKit::WebGestureEvent::GestureFlingCancel;
|
| - gesture_event.sourceDevice = WebKit::WebGestureEvent::Touchscreen;
|
| + gesture_event.type = blink::WebGestureEvent::GestureFlingCancel;
|
| + gesture_event.sourceDevice = blink::WebGestureEvent::Touchscreen;
|
| return gesture_event;
|
| }
|
|
|
| class TouchEventFromWebTouchPoint : public ui::TouchEvent {
|
| public:
|
| - TouchEventFromWebTouchPoint(const WebKit::WebTouchPoint& touch_point,
|
| + TouchEventFromWebTouchPoint(const blink::WebTouchPoint& touch_point,
|
| base::TimeDelta& timestamp)
|
| : ui::TouchEvent(ConvertToUIEvent(touch_point.state),
|
| touch_point.position,
|
| @@ -307,7 +307,7 @@ bool ShouldSendPinchGesture() {
|
| }
|
|
|
| void GetScreenInfoForWindow(gfx::NativeViewId id,
|
| - WebKit::WebScreenInfo* results) {
|
| + blink::WebScreenInfo* results) {
|
| HWND window = gfx::NativeViewFromId(id);
|
|
|
| HMONITOR monitor = MonitorFromWindow(window, MONITOR_DEFAULTTOPRIMARY);
|
| @@ -322,7 +322,7 @@ void GetScreenInfoForWindow(gfx::NativeViewId id,
|
| dev_mode.dmDriverExtra = 0;
|
| EnumDisplaySettings(monitor_info.szDevice, ENUM_CURRENT_SETTINGS, &dev_mode);
|
|
|
| - WebKit::WebScreenInfo screen_info;
|
| + blink::WebScreenInfo screen_info;
|
| screen_info.depth = dev_mode.dmBitsPerPel;
|
| screen_info.depthPerComponent = 8;
|
| screen_info.deviceScaleFactor = gfx::win::GetDeviceScaleFactor();
|
| @@ -351,18 +351,18 @@ class WebTouchState {
|
| bool ReleaseTouchPoints();
|
|
|
| // The contained WebTouchEvent.
|
| - const WebKit::WebTouchEvent& touch_event() { return touch_event_; }
|
| + const blink::WebTouchEvent& touch_event() { return touch_event_; }
|
|
|
| // Returns if any touches are modified in the event.
|
| bool is_changed() { return touch_event_.changedTouchesLength != 0; }
|
|
|
| private:
|
| // Adds a touch point or returns NULL if there's not enough space.
|
| - WebKit::WebTouchPoint* AddTouchPoint(TOUCHINPUT* touch_input);
|
| + blink::WebTouchPoint* AddTouchPoint(TOUCHINPUT* touch_input);
|
|
|
| // Copy details from a TOUCHINPUT to an existing WebTouchPoint, returning
|
| // true if the resulting point is a stationary move.
|
| - bool UpdateTouchPoint(WebKit::WebTouchPoint* touch_point,
|
| + bool UpdateTouchPoint(blink::WebTouchPoint* touch_point,
|
| TOUCHINPUT* touch_input);
|
|
|
| // Find (or create) a mapping for _os_touch_id_.
|
| @@ -371,7 +371,7 @@ class WebTouchState {
|
| // Remove any mappings that are no longer in use.
|
| void RemoveExpiredMappings();
|
|
|
| - WebKit::WebTouchEvent touch_event_;
|
| + blink::WebTouchEvent touch_event_;
|
| const RenderWidgetHostViewWin* const window_;
|
|
|
| ui::SequentialIDGenerator id_generator_;
|
| @@ -595,7 +595,7 @@ void RenderWidgetHostViewWin::CleanupCompositorWindow() {
|
|
|
| bool RenderWidgetHostViewWin::IsActivatable() const {
|
| // Popups should not be activated.
|
| - return popup_type_ == WebKit::WebPopupTypeNone;
|
| + return popup_type_ == blink::WebPopupTypeNone;
|
| }
|
|
|
| void RenderWidgetHostViewWin::Focus() {
|
| @@ -962,9 +962,9 @@ void RenderWidgetHostViewWin::DispatchCancelTouchEvent(
|
| !render_widget_host_->ShouldForwardTouchEvent()) {
|
| return;
|
| }
|
| - DCHECK(event->type() == WebKit::WebInputEvent::TouchCancel);
|
| - WebKit::WebTouchEvent cancel_event;
|
| - cancel_event.type = WebKit::WebInputEvent::TouchCancel;
|
| + DCHECK(event->type() == blink::WebInputEvent::TouchCancel);
|
| + blink::WebTouchEvent cancel_event;
|
| + cancel_event.type = blink::WebInputEvent::TouchCancel;
|
| cancel_event.timeStampSeconds = event->time_stamp().InSecondsF();
|
| render_widget_host_->ForwardTouchEventWithLatencyInfo(
|
| cancel_event, *event->latency());
|
| @@ -987,12 +987,12 @@ void RenderWidgetHostViewWin::SetCompositionText(
|
| if (!render_widget_host_)
|
| return;
|
| // ui::CompositionUnderline should be identical to
|
| - // WebKit::WebCompositionUnderline, so that we can do reinterpret_cast safely.
|
| + // blink::WebCompositionUnderline, so that we can do reinterpret_cast safely.
|
| COMPILE_ASSERT(sizeof(ui::CompositionUnderline) ==
|
| - sizeof(WebKit::WebCompositionUnderline),
|
| + sizeof(blink::WebCompositionUnderline),
|
| ui_CompositionUnderline__WebKit_WebCompositionUnderline_diff);
|
| - const std::vector<WebKit::WebCompositionUnderline>& underlines =
|
| - reinterpret_cast<const std::vector<WebKit::WebCompositionUnderline>&>(
|
| + const std::vector<blink::WebCompositionUnderline>& underlines =
|
| + reinterpret_cast<const std::vector<blink::WebCompositionUnderline>&>(
|
| composition.underlines);
|
| render_widget_host_->ImeSetComposition(composition.text, underlines,
|
| composition.selection.end(),
|
| @@ -1664,9 +1664,9 @@ LRESULT RenderWidgetHostViewWin::OnImeComposition(
|
| imm32_manager_->UpdateImeWindow(m_hWnd);
|
|
|
| // ui::CompositionUnderline should be identical to
|
| - // WebKit::WebCompositionUnderline, so that we can do reinterpret_cast safely.
|
| + // blink::WebCompositionUnderline, so that we can do reinterpret_cast safely.
|
| COMPILE_ASSERT(sizeof(ui::CompositionUnderline) ==
|
| - sizeof(WebKit::WebCompositionUnderline),
|
| + sizeof(blink::WebCompositionUnderline),
|
| ui_CompositionUnderline__WebKit_WebCompositionUnderline_diff);
|
|
|
| // Retrieve the result string and its attributes of the ongoing composition
|
| @@ -1690,8 +1690,8 @@ LRESULT RenderWidgetHostViewWin::OnImeComposition(
|
|
|
| // TODO(suzhe): convert both renderer_host and renderer to use
|
| // ui::CompositionText.
|
| - const std::vector<WebKit::WebCompositionUnderline>& underlines =
|
| - reinterpret_cast<const std::vector<WebKit::WebCompositionUnderline>&>(
|
| + const std::vector<blink::WebCompositionUnderline>& underlines =
|
| + reinterpret_cast<const std::vector<blink::WebCompositionUnderline>&>(
|
| composition.underlines);
|
| render_widget_host_->ImeSetComposition(
|
| composition.text, underlines,
|
| @@ -1928,8 +1928,8 @@ LRESULT RenderWidgetHostViewWin::OnKeyEvent(UINT message, WPARAM wparam,
|
| if (ui::IMM32Manager::IsCtrlShiftPressed(&dir)) {
|
| render_widget_host_->UpdateTextDirection(
|
| dir == base::i18n::RIGHT_TO_LEFT ?
|
| - WebKit::WebTextDirectionRightToLeft :
|
| - WebKit::WebTextDirectionLeftToRight);
|
| + blink::WebTextDirectionRightToLeft :
|
| + blink::WebTextDirectionLeftToRight);
|
| }
|
| } else if (wparam != VK_CONTROL) {
|
| // Bug 9762: http://crbug.com/9762 A user pressed a key except shift
|
| @@ -2006,7 +2006,7 @@ LRESULT RenderWidgetHostViewWin::OnWheelEvent(UINT message, WPARAM wparam,
|
| }
|
|
|
| if (render_widget_host_) {
|
| - WebKit::WebMouseWheelEvent wheel_event =
|
| + blink::WebMouseWheelEvent wheel_event =
|
| WebMouseWheelEventBuilder::Build(m_hWnd, message, wparam, lparam);
|
| float scale = gfx::win::GetDeviceScaleFactor();
|
| wheel_event.x /= scale;
|
| @@ -2032,14 +2032,14 @@ size_t WebTouchState::UpdateTouchPoints(
|
| // and alter/add any touchpoints (from the touch input buffer) that we can
|
| // coalesce into a single message. The return value is the number of consumed
|
| // input message.
|
| - WebKit::WebTouchPoint* point = touch_event_.touches;
|
| - WebKit::WebTouchPoint* end = point + touch_event_.touchesLength;
|
| + blink::WebTouchPoint* point = touch_event_.touches;
|
| + blink::WebTouchPoint* end = point + touch_event_.touchesLength;
|
| while (point < end) {
|
| - if (point->state == WebKit::WebTouchPoint::StateReleased) {
|
| + if (point->state == blink::WebTouchPoint::StateReleased) {
|
| *point = *(--end);
|
| --touch_event_.touchesLength;
|
| } else {
|
| - point->state = WebKit::WebTouchPoint::StateStationary;
|
| + point->state = blink::WebTouchPoint::StateStationary;
|
| point++;
|
| }
|
| }
|
| @@ -2052,7 +2052,7 @@ size_t WebTouchState::UpdateTouchPoints(
|
| for (size_t i = 0; i < count; ++i) {
|
| unsigned int mapped_id = GetMappedTouch(points[i].dwID);
|
|
|
| - WebKit::WebTouchPoint* point = NULL;
|
| + blink::WebTouchPoint* point = NULL;
|
| for (unsigned j = 0; j < touch_event_.touchesLength; ++j) {
|
| if (static_cast<DWORD>(touch_event_.touches[j].id) == mapped_id) {
|
| point = &touch_event_.touches[j];
|
| @@ -2076,26 +2076,26 @@ size_t WebTouchState::UpdateTouchPoints(
|
| case TOUCHEVENTF_DOWN: {
|
| if (!(point = AddTouchPoint(&points[i])))
|
| continue;
|
| - touch_event_.type = WebKit::WebInputEvent::TouchStart;
|
| + touch_event_.type = blink::WebInputEvent::TouchStart;
|
| break;
|
| }
|
|
|
| case TOUCHEVENTF_UP: {
|
| if (!point) // Just throw away a stray up.
|
| continue;
|
| - point->state = WebKit::WebTouchPoint::StateReleased;
|
| + point->state = blink::WebTouchPoint::StateReleased;
|
| UpdateTouchPoint(point, &points[i]);
|
| - touch_event_.type = WebKit::WebInputEvent::TouchEnd;
|
| + touch_event_.type = blink::WebInputEvent::TouchEnd;
|
| break;
|
| }
|
|
|
| case TOUCHEVENTF_MOVE: {
|
| if (point) {
|
| - point->state = WebKit::WebTouchPoint::StateMoved;
|
| + point->state = blink::WebTouchPoint::StateMoved;
|
| // Don't update the message if the point didn't really move.
|
| if (UpdateTouchPoint(point, &points[i]))
|
| continue;
|
| - touch_event_.type = WebKit::WebInputEvent::TouchMove;
|
| + touch_event_.type = blink::WebInputEvent::TouchMove;
|
| } else if (touch_event_.changedTouchesLength) {
|
| RemoveExpiredMappings();
|
| // Can't add a point if we're already handling move events.
|
| @@ -2106,7 +2106,7 @@ size_t WebTouchState::UpdateTouchPoints(
|
| continue;
|
| last_type = TOUCHEVENTF_DOWN;
|
| SetTouchType(&points[i], TOUCHEVENTF_DOWN);
|
| - touch_event_.type = WebKit::WebInputEvent::TouchStart;
|
| + touch_event_.type = blink::WebInputEvent::TouchStart;
|
| }
|
| break;
|
| }
|
| @@ -2123,10 +2123,10 @@ size_t WebTouchState::UpdateTouchPoints(
|
| }
|
|
|
| void WebTouchState::RemoveExpiredMappings() {
|
| - WebKit::WebTouchPoint* point = touch_event_.touches;
|
| - WebKit::WebTouchPoint* end = point + touch_event_.touchesLength;
|
| + blink::WebTouchPoint* point = touch_event_.touches;
|
| + blink::WebTouchPoint* end = point + touch_event_.touchesLength;
|
| for (; point < end; ++point) {
|
| - if (point->state == WebKit::WebTouchPoint::StateReleased)
|
| + if (point->state == blink::WebTouchPoint::StateReleased)
|
| id_generator_.ReleaseGeneratedID(point->id);
|
| }
|
| }
|
| @@ -2136,34 +2136,34 @@ bool WebTouchState::ReleaseTouchPoints() {
|
| if (touch_event_.touchesLength == 0)
|
| return false;
|
| // Mark every active touchpoint as released.
|
| - touch_event_.type = WebKit::WebInputEvent::TouchEnd;
|
| + touch_event_.type = blink::WebInputEvent::TouchEnd;
|
| touch_event_.changedTouchesLength = touch_event_.touchesLength;
|
| for (unsigned int i = 0; i < touch_event_.touchesLength; ++i) {
|
| - touch_event_.touches[i].state = WebKit::WebTouchPoint::StateReleased;
|
| + touch_event_.touches[i].state = blink::WebTouchPoint::StateReleased;
|
| touch_event_.changedTouches[i].state =
|
| - WebKit::WebTouchPoint::StateReleased;
|
| + blink::WebTouchPoint::StateReleased;
|
| }
|
|
|
| return true;
|
| }
|
|
|
| -WebKit::WebTouchPoint* WebTouchState::AddTouchPoint(
|
| +blink::WebTouchPoint* WebTouchState::AddTouchPoint(
|
| TOUCHINPUT* touch_input) {
|
| DCHECK(touch_event_.touchesLength <
|
| - WebKit::WebTouchEvent::touchesLengthCap);
|
| + blink::WebTouchEvent::touchesLengthCap);
|
| if (touch_event_.touchesLength >=
|
| - WebKit::WebTouchEvent::touchesLengthCap)
|
| + blink::WebTouchEvent::touchesLengthCap)
|
| return NULL;
|
| - WebKit::WebTouchPoint* point =
|
| + blink::WebTouchPoint* point =
|
| &touch_event_.touches[touch_event_.touchesLength++];
|
| - point->state = WebKit::WebTouchPoint::StatePressed;
|
| + point->state = blink::WebTouchPoint::StatePressed;
|
| point->id = GetMappedTouch(touch_input->dwID);
|
| UpdateTouchPoint(point, touch_input);
|
| return point;
|
| }
|
|
|
| bool WebTouchState::UpdateTouchPoint(
|
| - WebKit::WebTouchPoint* touch_point,
|
| + blink::WebTouchPoint* touch_point,
|
| TOUCHINPUT* touch_input) {
|
| CPoint coordinates(
|
| TOUCH_COORD_TO_PIXEL(touch_input->x) /
|
| @@ -2188,7 +2188,7 @@ bool WebTouchState::UpdateTouchPoint(
|
| touch_point->screenPosition.y == coordinates.y &&
|
| touch_point->radiusX == radius_x &&
|
| touch_point->radiusY == radius_y) {
|
| - touch_point->state = WebKit::WebTouchPoint::StateStationary;
|
| + touch_point->state = blink::WebTouchPoint::StateStationary;
|
| return true;
|
| }
|
|
|
| @@ -2223,8 +2223,8 @@ LRESULT RenderWidgetHostViewWin::OnTouchEvent(UINT message, WPARAM wparam,
|
|
|
| // TODO(jschuh): Add support for an arbitrary number of touchpoints.
|
| size_t total = std::min(static_cast<int>(LOWORD(wparam)),
|
| - static_cast<int>(WebKit::WebTouchEvent::touchesLengthCap));
|
| - TOUCHINPUT points[WebKit::WebTouchEvent::touchesLengthCap];
|
| + static_cast<int>(blink::WebTouchEvent::touchesLengthCap));
|
| + TOUCHINPUT points[blink::WebTouchEvent::touchesLengthCap];
|
|
|
| if (!total || !ui::GetTouchInputInfoWrapper((HTOUCHINPUT)lparam, total,
|
| points, sizeof(TOUCHINPUT))) {
|
| @@ -2252,7 +2252,7 @@ LRESULT RenderWidgetHostViewWin::OnTouchEvent(UINT message, WPARAM wparam,
|
| render_widget_host_->ForwardTouchEventWithLatencyInfo(
|
| touch_state_->touch_event(), ui::LatencyInfo());
|
| } else {
|
| - const WebKit::WebTouchEvent& touch_event = touch_state_->touch_event();
|
| + const blink::WebTouchEvent& touch_event = touch_state_->touch_event();
|
| base::TimeDelta timestamp = base::TimeDelta::FromMilliseconds(
|
| touch_event.timeStampSeconds * 1000);
|
| for (size_t i = 0; i < touch_event.touchesLength; ++i) {
|
| @@ -2483,7 +2483,7 @@ void RenderWidgetHostViewWin::AcceleratedPaint(HDC dc) {
|
| accelerated_surface_->Present(dc);
|
| }
|
|
|
| -void RenderWidgetHostViewWin::GetScreenInfo(WebKit::WebScreenInfo* results) {
|
| +void RenderWidgetHostViewWin::GetScreenInfo(blink::WebScreenInfo* results) {
|
| GetScreenInfoForWindow(GetNativeViewId(), results);
|
| }
|
|
|
| @@ -2875,10 +2875,10 @@ bool RenderWidgetHostViewWin::ForwardGestureEventToRenderer(
|
| return true;
|
| }
|
|
|
| - WebKit::WebGestureEvent web_gesture = CreateWebGestureEvent(m_hWnd, *gesture);
|
| - if (web_gesture.type == WebKit::WebGestureEvent::Undefined)
|
| + blink::WebGestureEvent web_gesture = CreateWebGestureEvent(m_hWnd, *gesture);
|
| + if (web_gesture.type == blink::WebGestureEvent::Undefined)
|
| return false;
|
| - if (web_gesture.type == WebKit::WebGestureEvent::GestureTapDown) {
|
| + if (web_gesture.type == blink::WebGestureEvent::GestureTapDown) {
|
| render_widget_host_->ForwardGestureEvent(
|
| CreateFlingCancelEvent(gesture->time_stamp().InSecondsF()));
|
| }
|
| @@ -3204,7 +3204,7 @@ RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
|
|
|
| // static
|
| void RenderWidgetHostViewPort::GetDefaultScreenInfo(
|
| - WebKit::WebScreenInfo* results) {
|
| + blink::WebScreenInfo* results) {
|
| GetScreenInfoForWindow(0, results);
|
| }
|
|
|
|
|