Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: content/browser/web_contents/web_contents_view_android.h

Issue 2708613002: Add EventForwarder for routing touch events (Closed)
Patch Set: EventForwarder... Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 11 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
12 #include "content/browser/web_contents/web_contents_view.h" 12 #include "content/browser/web_contents/web_contents_view.h"
13 #include "content/public/browser/web_contents_view_delegate.h" 13 #include "content/public/browser/web_contents_view_delegate.h"
14 #include "content/public/common/context_menu_params.h" 14 #include "content/public/common/context_menu_params.h"
15 #include "content/public/common/drop_data.h" 15 #include "content/public/common/drop_data.h"
16 #include "ui/android/overscroll_refresh.h" 16 #include "ui/android/overscroll_refresh.h"
17 #include "ui/android/view_android.h" 17 #include "ui/android/view_android.h"
18 #include "ui/android/view_client.h"
18 #include "ui/gfx/geometry/rect_f.h" 19 #include "ui/gfx/geometry/rect_f.h"
19 20
20 namespace content { 21 namespace content {
21 class ContentViewCoreImpl; 22 class ContentViewCoreImpl;
22 class SynchronousCompositorClient; 23 class SynchronousCompositorClient;
23 class WebContentsImpl; 24 class WebContentsImpl;
24 25
25 // Android-specific implementation of the WebContentsView. 26 // Android-specific implementation of the WebContentsView.
26 class WebContentsViewAndroid : public WebContentsView, 27 class WebContentsViewAndroid : public WebContentsView,
27 public RenderViewHostDelegateView { 28 public RenderViewHostDelegateView,
29 public ui::ViewClient {
28 public: 30 public:
29 WebContentsViewAndroid(WebContentsImpl* web_contents, 31 WebContentsViewAndroid(WebContentsImpl* web_contents,
30 WebContentsViewDelegate* delegate); 32 WebContentsViewDelegate* delegate);
31 ~WebContentsViewAndroid() override; 33 ~WebContentsViewAndroid() override;
32 34
33 // Sets the interface to the view system. ContentViewCoreImpl is owned 35 // Sets the interface to the view system. ContentViewCoreImpl is owned
34 // by its Java ContentViewCore counterpart, whose lifetime is managed 36 // by its Java ContentViewCore counterpart, whose lifetime is managed
35 // by the UI frontend. 37 // by the UI frontend.
36 void SetContentViewCore(ContentViewCoreImpl* content_view_core); 38 void SetContentViewCore(ContentViewCoreImpl* content_view_core);
37 39
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 const gfx::Point& location, 100 const gfx::Point& location,
99 const gfx::Point& screen_location); 101 const gfx::Point& screen_location);
100 void OnDragUpdated(const gfx::Point& location, 102 void OnDragUpdated(const gfx::Point& location,
101 const gfx::Point& screen_location); 103 const gfx::Point& screen_location);
102 void OnDragExited(); 104 void OnDragExited();
103 void OnPerformDrop(DropData* drop_data, 105 void OnPerformDrop(DropData* drop_data,
104 const gfx::Point& location, 106 const gfx::Point& location,
105 const gfx::Point& screen_location); 107 const gfx::Point& screen_location);
106 void OnDragEnded(); 108 void OnDragEnded();
107 109
110 // ui::ViewClient implementation.
111 bool OnTouchEvent(const ui::MotionEventAndroid& event,
112 bool for_touch_handle) override;
113
108 private: 114 private:
109 // The WebContents whose contents we display. 115 // The WebContents whose contents we display.
110 WebContentsImpl* web_contents_; 116 WebContentsImpl* web_contents_;
111 117
112 // ContentViewCoreImpl is our interface to the view system. 118 // ContentViewCoreImpl is our interface to the view system.
113 ContentViewCoreImpl* content_view_core_; 119 ContentViewCoreImpl* content_view_core_;
114 120
115 // Handles "overscroll to refresh" events 121 // Handles "overscroll to refresh" events
116 std::unique_ptr<ui::OverscrollRefreshHandler> overscroll_refresh_handler_; 122 std::unique_ptr<ui::OverscrollRefreshHandler> overscroll_refresh_handler_;
117 123
118 // Interface for extensions to WebContentsView. Used to show the context menu. 124 // Interface for extensions to WebContentsView. Used to show the context menu.
119 std::unique_ptr<WebContentsViewDelegate> delegate_; 125 std::unique_ptr<WebContentsViewDelegate> delegate_;
120 126
121 // The native view associated with the contents of the web. 127 // The native view associated with the contents of the web.
122 ui::ViewAndroid view_; 128 ui::ViewAndroid view_;
123 129
124 // Interface used to get notified of events from the synchronous compositor. 130 // Interface used to get notified of events from the synchronous compositor.
125 SynchronousCompositorClient* synchronous_compositor_client_; 131 SynchronousCompositorClient* synchronous_compositor_client_;
126 132
127 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAndroid); 133 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAndroid);
128 }; 134 };
129 135
130 } // namespace content 136 } // namespace content
131 137
132 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_ 138 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_android.cc ('k') | content/browser/web_contents/web_contents_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698