| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 10 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
| 11 #include "content/browser/web_contents/web_contents_view.h" | 11 #include "content/browser/web_contents/web_contents_view.h" |
| 12 #include "content/public/browser/web_contents_view_delegate.h" | 12 #include "content/public/browser/web_contents_view_delegate.h" |
| 13 #include "content/public/common/context_menu_params.h" | 13 #include "content/public/common/context_menu_params.h" |
| 14 #include "content/public/common/drop_data.h" |
| 14 #include "ui/gfx/geometry/rect_f.h" | 15 #include "ui/gfx/geometry/rect_f.h" |
| 15 | 16 |
| 17 namespace ui { |
| 18 class DropTargetEvent; |
| 19 } |
| 20 |
| 16 namespace content { | 21 namespace content { |
| 17 class ContentViewCoreImpl; | 22 class ContentViewCoreImpl; |
| 18 class WebContentsImpl; | 23 class WebContentsImpl; |
| 19 | 24 |
| 20 // Android-specific implementation of the WebContentsView. | 25 // Android-specific implementation of the WebContentsView. |
| 21 class WebContentsViewAndroid : public WebContentsView, | 26 class WebContentsViewAndroid : public WebContentsView, |
| 22 public RenderViewHostDelegateView { | 27 public RenderViewHostDelegateView { |
| 23 public: | 28 public: |
| 24 WebContentsViewAndroid(WebContentsImpl* web_contents, | 29 WebContentsViewAndroid(WebContentsImpl* web_contents, |
| 25 WebContentsViewDelegate* delegate); | 30 WebContentsViewDelegate* delegate); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 void HidePopupMenu() override; | 73 void HidePopupMenu() override; |
| 69 void StartDragging(const DropData& drop_data, | 74 void StartDragging(const DropData& drop_data, |
| 70 blink::WebDragOperationsMask allowed_ops, | 75 blink::WebDragOperationsMask allowed_ops, |
| 71 const gfx::ImageSkia& image, | 76 const gfx::ImageSkia& image, |
| 72 const gfx::Vector2d& image_offset, | 77 const gfx::Vector2d& image_offset, |
| 73 const DragEventSourceInfo& event_info) override; | 78 const DragEventSourceInfo& event_info) override; |
| 74 void UpdateDragCursor(blink::WebDragOperation operation) override; | 79 void UpdateDragCursor(blink::WebDragOperation operation) override; |
| 75 void GotFocus() override; | 80 void GotFocus() override; |
| 76 void TakeFocus(bool reverse) override; | 81 void TakeFocus(bool reverse) override; |
| 77 | 82 |
| 83 void OnDragEntered(const ui::DropTargetEvent& event); |
| 84 void OnDragUpdated(const ui::DropTargetEvent& event); |
| 85 void OnDragExited(); |
| 86 void OnPerformDrop(const ui::DropTargetEvent& event); |
| 87 |
| 78 private: | 88 private: |
| 79 // The WebContents whose contents we display. | 89 // The WebContents whose contents we display. |
| 80 WebContentsImpl* web_contents_; | 90 WebContentsImpl* web_contents_; |
| 81 | 91 |
| 92 scoped_ptr<DropData> current_drop_data_; |
| 93 |
| 82 // ContentViewCoreImpl is our interface to the view system. | 94 // ContentViewCoreImpl is our interface to the view system. |
| 83 ContentViewCoreImpl* content_view_core_; | 95 ContentViewCoreImpl* content_view_core_; |
| 84 | 96 |
| 85 // Interface for extensions to WebContentsView. Used to show the context menu. | 97 // Interface for extensions to WebContentsView. Used to show the context menu. |
| 86 scoped_ptr<WebContentsViewDelegate> delegate_; | 98 scoped_ptr<WebContentsViewDelegate> delegate_; |
| 87 | 99 |
| 88 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAndroid); | 100 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAndroid); |
| 89 }; | 101 }; |
| 90 | 102 |
| 91 } // namespace content | 103 } // namespace content |
| 92 | 104 |
| 93 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_ | 105 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_ANDROID_H_ |
| OLD | NEW |