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

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

Issue 2502763003: Introduce ViewRoot to forward input/view events to native (Closed)
Patch Set: addressed comments Created 4 years 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/view_android.h" 16 #include "ui/android/view_android.h"
17 #include "ui/android/view_client.h"
17 #include "ui/gfx/geometry/rect_f.h" 18 #include "ui/gfx/geometry/rect_f.h"
18 19
19 namespace content { 20 namespace content {
20 class ContentViewCoreImpl; 21 class ContentViewCoreImpl;
21 class SynchronousCompositorClient; 22 class SynchronousCompositorClient;
22 class WebContentsImpl; 23 class WebContentsImpl;
23 24
24 // Android-specific implementation of the WebContentsView. 25 // Android-specific implementation of the WebContentsView.
25 class WebContentsViewAndroid : public WebContentsView, 26 class WebContentsViewAndroid : public WebContentsView,
26 public RenderViewHostDelegateView { 27 public RenderViewHostDelegateView,
28 public ui::ViewClient {
27 public: 29 public:
28 WebContentsViewAndroid(WebContentsImpl* web_contents, 30 WebContentsViewAndroid(WebContentsImpl* web_contents,
29 WebContentsViewDelegate* delegate); 31 WebContentsViewDelegate* delegate);
30 ~WebContentsViewAndroid() override; 32 ~WebContentsViewAndroid() override;
31 33
32 // Sets the interface to the view system. ContentViewCoreImpl is owned 34 // Sets the interface to the view system. ContentViewCoreImpl is owned
33 // by its Java ContentViewCore counterpart, whose lifetime is managed 35 // by its Java ContentViewCore counterpart, whose lifetime is managed
34 // by the UI frontend. 36 // by the UI frontend.
35 void SetContentViewCore(ContentViewCoreImpl* content_view_core); 37 void SetContentViewCore(ContentViewCoreImpl* content_view_core);
36 38
(...skipping 23 matching lines...) Expand all
60 RenderWidgetHostViewBase* CreateViewForWidget( 62 RenderWidgetHostViewBase* CreateViewForWidget(
61 RenderWidgetHost* render_widget_host, 63 RenderWidgetHost* render_widget_host,
62 bool is_guest_view_hack) override; 64 bool is_guest_view_hack) override;
63 RenderWidgetHostViewBase* CreateViewForPopupWidget( 65 RenderWidgetHostViewBase* CreateViewForPopupWidget(
64 RenderWidgetHost* render_widget_host) override; 66 RenderWidgetHost* render_widget_host) override;
65 void SetPageTitle(const base::string16& title) override; 67 void SetPageTitle(const base::string16& title) override;
66 void RenderViewCreated(RenderViewHost* host) override; 68 void RenderViewCreated(RenderViewHost* host) override;
67 void RenderViewSwappedIn(RenderViewHost* host) override; 69 void RenderViewSwappedIn(RenderViewHost* host) override;
68 void SetOverscrollControllerEnabled(bool enabled) override; 70 void SetOverscrollControllerEnabled(bool enabled) override;
69 71
72 // ViewAndroid::ViewClient implementation.
73 bool OnPhysicalBackingSizeChanged(int width, int height);
74
70 // Backend implementation of RenderViewHostDelegateView. 75 // Backend implementation of RenderViewHostDelegateView.
71 void ShowContextMenu(RenderFrameHost* render_frame_host, 76 void ShowContextMenu(RenderFrameHost* render_frame_host,
72 const ContextMenuParams& params) override; 77 const ContextMenuParams& params) override;
73 void ShowPopupMenu(RenderFrameHost* render_frame_host, 78 void ShowPopupMenu(RenderFrameHost* render_frame_host,
74 const gfx::Rect& bounds, 79 const gfx::Rect& bounds,
75 int item_height, 80 int item_height,
76 double item_font_size, 81 double item_font_size,
77 int selected_item, 82 int selected_item,
78 const std::vector<MenuItem>& items, 83 const std::vector<MenuItem>& items,
79 bool right_aligned, 84 bool right_aligned,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 120
116 // Interface used to get notified of events from the synchronous compositor. 121 // Interface used to get notified of events from the synchronous compositor.
117 SynchronousCompositorClient* synchronous_compositor_client_; 122 SynchronousCompositorClient* synchronous_compositor_client_;
118 123
119 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAndroid); 124 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAndroid);
120 }; 125 };
121 126
122 } // namespace content 127 } // namespace content
123 128
124 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_ 129 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698