OLD | NEW |
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 26 matching lines...) Expand all Loading... |
64 RenderWidgetHostViewBase* CreateViewForWidget( | 66 RenderWidgetHostViewBase* CreateViewForWidget( |
65 RenderWidgetHost* render_widget_host, | 67 RenderWidgetHost* render_widget_host, |
66 bool is_guest_view_hack) override; | 68 bool is_guest_view_hack) override; |
67 RenderWidgetHostViewBase* CreateViewForPopupWidget( | 69 RenderWidgetHostViewBase* CreateViewForPopupWidget( |
68 RenderWidgetHost* render_widget_host) override; | 70 RenderWidgetHost* render_widget_host) override; |
69 void SetPageTitle(const base::string16& title) override; | 71 void SetPageTitle(const base::string16& title) override; |
70 void RenderViewCreated(RenderViewHost* host) override; | 72 void RenderViewCreated(RenderViewHost* host) override; |
71 void RenderViewSwappedIn(RenderViewHost* host) override; | 73 void RenderViewSwappedIn(RenderViewHost* host) override; |
72 void SetOverscrollControllerEnabled(bool enabled) override; | 74 void SetOverscrollControllerEnabled(bool enabled) override; |
73 | 75 |
| 76 // ui::ViewClient implementation. |
| 77 void OnPhysicalBackingSizeChanged(int width, int height) override; |
| 78 |
74 // Backend implementation of RenderViewHostDelegateView. | 79 // Backend implementation of RenderViewHostDelegateView. |
75 void ShowContextMenu(RenderFrameHost* render_frame_host, | 80 void ShowContextMenu(RenderFrameHost* render_frame_host, |
76 const ContextMenuParams& params) override; | 81 const ContextMenuParams& params) override; |
77 void ShowPopupMenu(RenderFrameHost* render_frame_host, | 82 void ShowPopupMenu(RenderFrameHost* render_frame_host, |
78 const gfx::Rect& bounds, | 83 const gfx::Rect& bounds, |
79 int item_height, | 84 int item_height, |
80 double item_font_size, | 85 double item_font_size, |
81 int selected_item, | 86 int selected_item, |
82 const std::vector<MenuItem>& items, | 87 const std::vector<MenuItem>& items, |
83 bool right_aligned, | 88 bool right_aligned, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 128 |
124 // Interface used to get notified of events from the synchronous compositor. | 129 // Interface used to get notified of events from the synchronous compositor. |
125 SynchronousCompositorClient* synchronous_compositor_client_; | 130 SynchronousCompositorClient* synchronous_compositor_client_; |
126 | 131 |
127 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAndroid); | 132 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAndroid); |
128 }; | 133 }; |
129 | 134 |
130 } // namespace content | 135 } // namespace content |
131 | 136 |
132 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_ | 137 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_ |
OLD | NEW |