diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-05 16:56:50 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-05 16:56:50 +0000 |
commit | 2116103d79615836d746554fb8618fab860db7ef (patch) | |
tree | 9bfac3cc0041b1cdfe4bad0bd02c02d012afbd9c /content/browser/renderer_host | |
parent | 94a0924fa2465aedf46d60cb7d092b4124adb703 (diff) | |
download | chromium_src-2116103d79615836d746554fb8618fab860db7ef.zip chromium_src-2116103d79615836d746554fb8618fab860db7ef.tar.gz chromium_src-2116103d79615836d746554fb8618fab860db7ef.tar.bz2 |
Move some interfaces from content/port to internal content since they're not referenced in content/port anymore.
BUG=304341
R=avi@chromium.org
Review URL: https://codereview.chromium.org/264033002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268206 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host')
18 files changed, 165 insertions, 24 deletions
diff --git a/content/browser/renderer_host/event_with_latency_info.h b/content/browser/renderer_host/event_with_latency_info.h new file mode 100644 index 0000000..483c4cf --- /dev/null +++ b/content/browser/renderer_host/event_with_latency_info.h @@ -0,0 +1,59 @@ +// Copyright 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 CONTENT_BROWSER_RENDERER_HOST_EVENT_WITH_LATENCY_INFO_H_ +#define CONTENT_BROWSER_RENDERER_HOST_EVENT_WITH_LATENCY_INFO_H_ + +#include "ui/events/latency_info.h" + +#include "content/common/input/web_input_event_traits.h" + +namespace blink { +class WebGestureEvent; +class WebMouseEvent; +class WebMouseWheelEvent; +class WebTouchEvent; +} + +namespace content { + +template <typename T> +class EventWithLatencyInfo { + public: + T event; + ui::LatencyInfo latency; + + EventWithLatencyInfo(const T& e, const ui::LatencyInfo& l) + : event(e), latency(l) {} + + EventWithLatencyInfo() {} + + bool CanCoalesceWith(const EventWithLatencyInfo& other) + const WARN_UNUSED_RESULT { + return WebInputEventTraits::CanCoalesce(other.event, event); + } + + void CoalesceWith(const EventWithLatencyInfo& other) { + WebInputEventTraits::Coalesce(other.event, &event); + // When coalescing two input events, we keep the oldest LatencyInfo + // for Telemetry latency test since it will represent the longest + // latency. + if (other.latency.trace_id >= 0 && + (latency.trace_id < 0 || other.latency.trace_id < latency.trace_id)) + latency = other.latency; + } +}; + +typedef EventWithLatencyInfo<blink::WebGestureEvent> + GestureEventWithLatencyInfo; +typedef EventWithLatencyInfo<blink::WebMouseWheelEvent> + MouseWheelEventWithLatencyInfo; +typedef EventWithLatencyInfo<blink::WebMouseEvent> + MouseEventWithLatencyInfo; +typedef EventWithLatencyInfo<blink::WebTouchEvent> + TouchEventWithLatencyInfo; + +} // namespace content + +#endif // CONTENT_BROWSER_RENDERER_HOST_EVENT_WITH_LATENCY_INFO_H_ diff --git a/content/browser/renderer_host/input/gesture_event_queue.h b/content/browser/renderer_host/input/gesture_event_queue.h index 4832a29..a0a8146 100644 --- a/content/browser/renderer_host/input/gesture_event_queue.h +++ b/content/browser/renderer_host/input/gesture_event_queue.h @@ -10,12 +10,12 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/timer/timer.h" +#include "content/browser/renderer_host/event_with_latency_info.h" #include "content/browser/renderer_host/input/tap_suppression_controller.h" #include "content/browser/renderer_host/input/touchpad_tap_suppression_controller.h" #include "content/browser/renderer_host/input/touchscreen_tap_suppression_controller.h" #include "content/common/content_export.h" -#include "content/port/browser/event_with_latency_info.h" -#include "content/port/common/input_event_ack_state.h" +#include "content/common/input/input_event_ack_state.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/gfx/transform.h" diff --git a/content/browser/renderer_host/input/gesture_event_queue_unittest.cc b/content/browser/renderer_host/input/gesture_event_queue_unittest.cc index 28d6995..2deb555 100644 --- a/content/browser/renderer_host/input/gesture_event_queue_unittest.cc +++ b/content/browser/renderer_host/input/gesture_event_queue_unittest.cc @@ -11,8 +11,8 @@ #include "base/time/time.h" #include "content/browser/renderer_host/input/gesture_event_queue.h" #include "content/browser/renderer_host/input/touchpad_tap_suppression_controller.h" +#include "content/common/input/input_event_ack_state.h" #include "content/common/input/synthetic_web_input_event_builders.h" -#include "content/port/common/input_event_ack_state.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/public/web/WebInputEvent.h" diff --git a/content/browser/renderer_host/input/input_ack_handler.h b/content/browser/renderer_host/input/input_ack_handler.h index 7917bff..0e34b82 100644 --- a/content/browser/renderer_host/input/input_ack_handler.h +++ b/content/browser/renderer_host/input/input_ack_handler.h @@ -6,8 +6,8 @@ #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ACK_HANDLER_H_ #include "base/basictypes.h" -#include "content/port/browser/event_with_latency_info.h" -#include "content/port/common/input_event_ack_state.h" +#include "content/browser/renderer_host/event_with_latency_info.h" +#include "content/common/input/input_event_ack_state.h" #include "content/public/browser/native_web_keyboard_event.h" #include "third_party/WebKit/public/web/WebInputEvent.h" diff --git a/content/browser/renderer_host/input/input_router.h b/content/browser/renderer_host/input/input_router.h index 2dbb4ed..bb3bd03 100644 --- a/content/browser/renderer_host/input/input_router.h +++ b/content/browser/renderer_host/input/input_router.h @@ -6,8 +6,8 @@ #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_H_ #include "base/basictypes.h" -#include "content/port/browser/event_with_latency_info.h" -#include "content/port/common/input_event_ack_state.h" +#include "content/browser/renderer_host/event_with_latency_info.h" +#include "content/common/input/input_event_ack_state.h" #include "content/public/browser/native_web_keyboard_event.h" #include "ipc/ipc_listener.h" #include "third_party/WebKit/public/web/WebInputEvent.h" diff --git a/content/browser/renderer_host/input/input_router_client.h b/content/browser/renderer_host/input/input_router_client.h index fefcb10..647c081 100644 --- a/content/browser/renderer_host/input/input_router_client.h +++ b/content/browser/renderer_host/input/input_router_client.h @@ -5,9 +5,9 @@ #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_CLIENT_H_ #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_CLIENT_H_ +#include "content/browser/renderer_host/event_with_latency_info.h" #include "content/common/content_export.h" -#include "content/port/browser/event_with_latency_info.h" -#include "content/port/common/input_event_ack_state.h" +#include "content/common/input/input_event_ack_state.h" #include "content/public/browser/native_web_keyboard_event.h" #include "third_party/WebKit/public/web/WebInputEvent.h" diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc index 97e68f4..08b9e45 100644 --- a/content/browser/renderer_host/input/input_router_impl.cc +++ b/content/browser/renderer_host/input/input_router_impl.cc @@ -18,11 +18,11 @@ #include "content/browser/renderer_host/overscroll_controller.h" #include "content/common/content_constants_internal.h" #include "content/common/edit_command.h" +#include "content/common/input/input_event_ack_state.h" #include "content/common/input/touch_action.h" #include "content/common/input/web_touch_event_traits.h" #include "content/common/input_messages.h" #include "content/common/view_messages.h" -#include "content/port/common/input_event_ack_state.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" #include "content/public/browser/user_metrics.h" diff --git a/content/browser/renderer_host/input/touch_action_filter_unittest.cc b/content/browser/renderer_host/input/touch_action_filter_unittest.cc index 71a3c1e..e099c9b 100644 --- a/content/browser/renderer_host/input/touch_action_filter_unittest.cc +++ b/content/browser/renderer_host/input/touch_action_filter_unittest.cc @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "content/browser/renderer_host/event_with_latency_info.h" #include "content/browser/renderer_host/input/touch_action_filter.h" +#include "content/common/input/input_event_ack_state.h" #include "content/common/input/synthetic_web_input_event_builders.h" -#include "content/port/browser/event_with_latency_info.h" -#include "content/port/common/input_event_ack_state.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/public/web/WebInputEvent.h" diff --git a/content/browser/renderer_host/input/touch_emulator.h b/content/browser/renderer_host/input/touch_emulator.h index 9ee6500..af1e056 100644 --- a/content/browser/renderer_host/input/touch_emulator.h +++ b/content/browser/renderer_host/input/touch_emulator.h @@ -7,7 +7,7 @@ #include "content/browser/renderer_host/input/touch_emulator_client.h" #include "content/common/cursors/webcursor.h" -#include "content/port/common/input_event_ack_state.h" +#include "content/common/input/input_event_ack_state.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/events/gesture_detection/filtered_gesture_provider.h" diff --git a/content/browser/renderer_host/input/touch_event_queue.h b/content/browser/renderer_host/input/touch_event_queue.h index e491a62..0e24073 100644 --- a/content/browser/renderer_host/input/touch_event_queue.h +++ b/content/browser/renderer_host/input/touch_event_queue.h @@ -10,9 +10,9 @@ #include "base/basictypes.h" #include "base/time/time.h" +#include "content/browser/renderer_host/event_with_latency_info.h" #include "content/common/content_export.h" -#include "content/port/browser/event_with_latency_info.h" -#include "content/port/common/input_event_ack_state.h" +#include "content/common/input/input_event_ack_state.h" #include "third_party/WebKit/public/web/WebInputEvent.h" #include "ui/gfx/geometry/point_f.h" diff --git a/content/browser/renderer_host/input/touchpad_tap_suppression_controller.h b/content/browser/renderer_host/input/touchpad_tap_suppression_controller.h index 23e3ee4..da74dfd 100644 --- a/content/browser/renderer_host/input/touchpad_tap_suppression_controller.h +++ b/content/browser/renderer_host/input/touchpad_tap_suppression_controller.h @@ -5,10 +5,10 @@ #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCHPAD_TAP_SUPPRESSION_CONTROLLER_H_ #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCHPAD_TAP_SUPPRESSION_CONTROLLER_H_ +#include "content/browser/renderer_host/event_with_latency_info.h" #include "content/browser/renderer_host/input/tap_suppression_controller.h" #include "content/browser/renderer_host/input/tap_suppression_controller_client.h" #include "content/common/content_export.h" -#include "content/port/browser/event_with_latency_info.h" #include "third_party/WebKit/public/web/WebInputEvent.h" namespace content { diff --git a/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.h b/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.h index a9e09f4..706e9d8 100644 --- a/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.h +++ b/content/browser/renderer_host/input/touchscreen_tap_suppression_controller.h @@ -6,9 +6,9 @@ #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLLER_H_ #include "base/memory/scoped_ptr.h" +#include "content/browser/renderer_host/event_with_latency_info.h" #include "content/browser/renderer_host/input/tap_suppression_controller.h" #include "content/browser/renderer_host/input/tap_suppression_controller_client.h" -#include "content/port/browser/event_with_latency_info.h" namespace content { diff --git a/content/browser/renderer_host/render_view_host_delegate_view.h b/content/browser/renderer_host/render_view_host_delegate_view.h new file mode 100644 index 0000000..fb2babd --- /dev/null +++ b/content/browser/renderer_host/render_view_host_delegate_view.h @@ -0,0 +1,82 @@ +// Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_VIEW_H_ +#define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_VIEW_H_ + +#include <vector> + +#include "base/basictypes.h" +#include "content/common/content_export.h" +#include "content/common/drag_event_source_info.h" +#include "third_party/WebKit/public/web/WebDragOperation.h" + +class SkBitmap; + +namespace gfx { +class ImageSkia; +class Rect; +class Vector2d; +} + +namespace content { +class RenderFrameHost; +struct ContextMenuParams; +struct DropData; +struct MenuItem; + +// This class provides a way for the RenderViewHost to reach out to its +// delegate's view. It only needs to be implemented by embedders if they don't +// use the default WebContentsView implementations. +class CONTENT_EXPORT RenderViewHostDelegateView { + public: + // A context menu should be shown, to be built using the context information + // provided in the supplied params. + virtual void ShowContextMenu(RenderFrameHost* render_frame_host, + const ContextMenuParams& params) {} + + // Shows a popup menu with the specified items. + // This method should call RenderViewHost::DidSelectPopupMenuItem[s]() or + // RenderViewHost::DidCancelPopupMenu() based on the user action. + virtual void ShowPopupMenu(const gfx::Rect& bounds, + int item_height, + double item_font_size, + int selected_item, + const std::vector<MenuItem>& items, + bool right_aligned, + bool allow_multiple_selection) {}; + + // Hides a popup menu opened by ShowPopupMenu(). + virtual void HidePopupMenu() {}; + + // The user started dragging content of the specified type within the + // RenderView. Contextual information about the dragged content is supplied + // by DropData. If the delegate's view cannot start the drag for /any/ + // reason, it must inform the renderer that the drag has ended; otherwise, + // this results in bugs like http://crbug.com/157134. + virtual void StartDragging(const DropData& drop_data, + blink::WebDragOperationsMask allowed_ops, + const gfx::ImageSkia& image, + const gfx::Vector2d& image_offset, + const DragEventSourceInfo& event_info) {} + + // The page wants to update the mouse cursor during a drag & drop operation. + // |operation| describes the current operation (none, move, copy, link.) + virtual void UpdateDragCursor(blink::WebDragOperation operation) {} + + // Notification that view for this delegate got the focus. + virtual void GotFocus() {} + + // Callback to inform the browser that the page is returning the focus to + // the browser's chrome. If reverse is true, it means the focus was + // retrieved by doing a Shift-Tab. + virtual void TakeFocus(bool reverse) {} + + protected: + virtual ~RenderViewHostDelegateView() {} +}; + +} // namespace content + +#endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_VIEW_H_ diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 5337318..c329fb07f 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -39,6 +39,7 @@ #include "content/browser/renderer_host/media/audio_renderer_host.h" #include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/renderer_host/render_view_host_delegate.h" +#include "content/browser/renderer_host/render_view_host_delegate_view.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/common/accessibility_messages.h" #include "content/common/browser_plugin/browser_plugin_messages.h" @@ -52,7 +53,6 @@ #include "content/common/swapped_out_messages.h" #include "content/common/view_messages.h" #include "content/common/web_ui_setup.mojom.h" -#include "content/port/browser/render_view_host_delegate_view.h" #include "content/public/browser/ax_event_notification_details.h" #include "content/public/browser/browser_accessibility_state.h" #include "content/public/browser/browser_context.h" diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc index cb5e52b..836540c 100644 --- a/content/browser/renderer_host/render_view_host_unittest.cc +++ b/content/browser/renderer_host/render_view_host_unittest.cc @@ -6,9 +6,9 @@ #include "base/strings/utf_string_conversions.h" #include "content/browser/child_process_security_policy_impl.h" #include "content/browser/frame_host/render_frame_host_impl.h" +#include "content/browser/renderer_host/render_view_host_delegate_view.h" #include "content/common/input_messages.h" #include "content/common/view_messages.h" -#include "content/port/browser/render_view_host_delegate_view.h" #include "content/public/browser/navigation_entry.h" #include "content/public/common/bindings_policy.h" #include "content/public/common/drop_data.h" diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index b4f391a..139ea3b 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h @@ -25,14 +25,14 @@ #include "build/build_config.h" #include "cc/resources/shared_bitmap.h" #include "content/browser/accessibility/browser_accessibility_manager.h" +#include "content/browser/renderer_host/event_with_latency_info.h" #include "content/browser/renderer_host/input/input_ack_handler.h" #include "content/browser/renderer_host/input/input_router_client.h" #include "content/browser/renderer_host/input/synthetic_gesture.h" #include "content/browser/renderer_host/input/touch_emulator_client.h" +#include "content/common/input/input_event_ack_state.h" #include "content/common/input/synthetic_gesture_packet.h" #include "content/common/view_message_enums.h" -#include "content/port/browser/event_with_latency_info.h" -#include "content/port/common/input_event_ack_state.h" #include "content/public/browser/render_widget_host.h" #include "content/public/common/page_zoom.h" #include "ipc/ipc_listener.h" diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h index 2c17dff..1b86fdc 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -17,9 +17,9 @@ #include "base/process/kill.h" #include "base/timer/timer.h" #include "cc/output/compositor_frame.h" +#include "content/browser/renderer_host/event_with_latency_info.h" #include "content/common/content_export.h" -#include "content/port/browser/event_with_latency_info.h" -#include "content/port/common/input_event_ack_state.h" +#include "content/common/input/input_event_ack_state.h" #include "content/public/browser/render_widget_host_view.h" #include "ipc/ipc_listener.h" #include "third_party/WebKit/public/web/WebPopupType.h" diff --git a/content/browser/renderer_host/ui_events_helper.h b/content/browser/renderer_host/ui_events_helper.h index a7f2eaa..883ba48 100644 --- a/content/browser/renderer_host/ui_events_helper.h +++ b/content/browser/renderer_host/ui_events_helper.h @@ -6,8 +6,8 @@ #define CONTENT_BROWSER_RENDERER_HOST_UI_EVENTS_HELPER_H_ #include "base/memory/scoped_vector.h" +#include "content/browser/renderer_host/event_with_latency_info.h" #include "content/common/content_export.h" -#include "content/port/browser/event_with_latency_info.h" namespace blink { class WebGestureEvent; |