| 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/view_android.h" | 17 #include "ui/android/view_android.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 RenderWidgetHostViewAndroid; | 22 class RenderWidgetHostViewAndroid; | 
| 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. | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 36   void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 37   void SetContentViewCore(ContentViewCoreImpl* content_view_core); | 
| 37 | 38 | 
| 38   void set_synchronous_compositor_client(SynchronousCompositorClient* client) { | 39   void set_synchronous_compositor_client(SynchronousCompositorClient* client) { | 
| 39     synchronous_compositor_client_ = client; | 40     synchronous_compositor_client_ = client; | 
| 40   } | 41   } | 
| 41 | 42 | 
| 42   SynchronousCompositorClient* synchronous_compositor_client() const { | 43   SynchronousCompositorClient* synchronous_compositor_client() const { | 
| 43     return synchronous_compositor_client_; | 44     return synchronous_compositor_client_; | 
| 44   } | 45   } | 
| 45 | 46 | 
|  | 47   void SetOverscrollRefreshHandler( | 
|  | 48       const base::android::JavaParamRef<jobject>& overscroll_refresh_handler) { | 
|  | 49     overscroll_refresh_handler_.Reset(nullptr, overscroll_refresh_handler); | 
|  | 50   } | 
|  | 51 | 
| 46   // WebContentsView implementation -------------------------------------------- | 52   // WebContentsView implementation -------------------------------------------- | 
| 47   gfx::NativeView GetNativeView() const override; | 53   gfx::NativeView GetNativeView() const override; | 
| 48   gfx::NativeView GetContentNativeView() const override; | 54   gfx::NativeView GetContentNativeView() const override; | 
| 49   gfx::NativeWindow GetTopLevelNativeWindow() const override; | 55   gfx::NativeWindow GetTopLevelNativeWindow() const override; | 
| 50   void GetScreenInfo(ScreenInfo* screen_info) const override; | 56   void GetScreenInfo(ScreenInfo* screen_info) const override; | 
| 51   void GetContainerBounds(gfx::Rect* out) const override; | 57   void GetContainerBounds(gfx::Rect* out) const override; | 
| 52   void SizeContents(const gfx::Size& size) override; | 58   void SizeContents(const gfx::Size& size) override; | 
| 53   void Focus() override; | 59   void Focus() override; | 
| 54   void SetInitialFocus() override; | 60   void SetInitialFocus() override; | 
| 55   void StoreFocus() override; | 61   void StoreFocus() override; | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 101                      const gfx::Point& screen_location); | 107                      const gfx::Point& screen_location); | 
| 102   void OnDragEnded(); | 108   void OnDragEnded(); | 
| 103 | 109 | 
| 104  private: | 110  private: | 
| 105   // The WebContents whose contents we display. | 111   // The WebContents whose contents we display. | 
| 106   WebContentsImpl* web_contents_; | 112   WebContentsImpl* web_contents_; | 
| 107 | 113 | 
| 108   // ContentViewCoreImpl is our interface to the view system. | 114   // ContentViewCoreImpl is our interface to the view system. | 
| 109   ContentViewCoreImpl* content_view_core_; | 115   ContentViewCoreImpl* content_view_core_; | 
| 110 | 116 | 
|  | 117   // Handles "overscroll to refresh" events | 
|  | 118   base::android::ScopedJavaGlobalRef<jobject> overscroll_refresh_handler_; | 
|  | 119 | 
| 111   // Interface for extensions to WebContentsView. Used to show the context menu. | 120   // Interface for extensions to WebContentsView. Used to show the context menu. | 
| 112   std::unique_ptr<WebContentsViewDelegate> delegate_; | 121   std::unique_ptr<WebContentsViewDelegate> delegate_; | 
| 113 | 122 | 
| 114   // The native view associated with the contents of the web. | 123   // The native view associated with the contents of the web. | 
| 115   ui::ViewAndroid view_; | 124   ui::ViewAndroid view_; | 
| 116 | 125 | 
| 117   // Interface used to get notified of events from the synchronous compositor. | 126   // Interface used to get notified of events from the synchronous compositor. | 
| 118   SynchronousCompositorClient* synchronous_compositor_client_; | 127   SynchronousCompositorClient* synchronous_compositor_client_; | 
| 119 | 128 | 
| 120   DISALLOW_COPY_AND_ASSIGN(WebContentsViewAndroid); | 129   DISALLOW_COPY_AND_ASSIGN(WebContentsViewAndroid); | 
| 121 }; | 130 }; | 
| 122 | 131 | 
| 123 } // namespace content | 132 } // namespace content | 
| 124 | 133 | 
| 125 #endif  // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_ | 134 #endif  // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_ | 
| OLD | NEW | 
|---|