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_GUEST_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_GUEST_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_GUEST_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_GUEST_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 13 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
14 #include "content/browser/web_contents/web_contents_view.h" | 14 #include "content/browser/web_contents/web_contents_view.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/common/drag_event_source_info.h" | 16 #include "content/common/drag_event_source_info.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class WebContents; | 20 class WebContents; |
21 class WebContentsImpl; | 21 class WebContentsImpl; |
22 class BrowserPluginGuest; | 22 class BrowserPluginGuest; |
23 | 23 |
24 class WebContentsViewGuest : public WebContentsView, | 24 class WebContentsViewGuest : public WebContentsView, |
25 public RenderViewHostDelegateView { | 25 public RenderViewHostDelegateView { |
26 public: | 26 public: |
27 // The corresponding WebContentsImpl is passed in the constructor, and manages | 27 // The corresponding WebContentsImpl is passed in the constructor, and manages |
28 // our lifetime. This doesn't need to be the case, but is this way currently | 28 // our lifetime. This doesn't need to be the case, but is this way currently |
29 // because that's what was easiest when they were split. | 29 // because that's what was easiest when they were split. |
30 // WebContentsViewGuest always has a backing platform dependent view, | 30 // WebContentsViewGuest always has a backing platform dependent view, |
31 // |platform_view|. | 31 // |platform_view|. |
32 WebContentsViewGuest(WebContentsImpl* web_contents, | 32 WebContentsViewGuest(WebContentsImpl* web_contents, |
33 BrowserPluginGuest* guest, | 33 BrowserPluginGuest* guest, |
34 scoped_ptr<WebContentsView> platform_view, | 34 std::unique_ptr<WebContentsView> platform_view, |
35 RenderViewHostDelegateView** delegate_view); | 35 RenderViewHostDelegateView** delegate_view); |
36 ~WebContentsViewGuest() override; | 36 ~WebContentsViewGuest() override; |
37 | 37 |
38 WebContents* web_contents(); | 38 WebContents* web_contents(); |
39 | 39 |
40 void OnGuestAttached(WebContentsView* parent_view); | 40 void OnGuestAttached(WebContentsView* parent_view); |
41 | 41 |
42 void OnGuestDetached(WebContentsView* old_parent_view); | 42 void OnGuestDetached(WebContentsView* old_parent_view); |
43 | 43 |
44 // WebContentsView implementation -------------------------------------------- | 44 // WebContentsView implementation -------------------------------------------- |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 void UpdateDragCursor(blink::WebDragOperation operation) override; | 82 void UpdateDragCursor(blink::WebDragOperation operation) override; |
83 void GotFocus() override; | 83 void GotFocus() override; |
84 void TakeFocus(bool reverse) override; | 84 void TakeFocus(bool reverse) override; |
85 | 85 |
86 private: | 86 private: |
87 // The WebContentsImpl whose contents we display. | 87 // The WebContentsImpl whose contents we display. |
88 WebContentsImpl* web_contents_; | 88 WebContentsImpl* web_contents_; |
89 BrowserPluginGuest* guest_; | 89 BrowserPluginGuest* guest_; |
90 // The platform dependent view backing this WebContentsView. | 90 // The platform dependent view backing this WebContentsView. |
91 // Calls to this WebContentsViewGuest are forwarded to |platform_view_|. | 91 // Calls to this WebContentsViewGuest are forwarded to |platform_view_|. |
92 scoped_ptr<WebContentsView> platform_view_; | 92 std::unique_ptr<WebContentsView> platform_view_; |
93 gfx::Size size_; | 93 gfx::Size size_; |
94 | 94 |
95 // Delegate view for guest's platform view. | 95 // Delegate view for guest's platform view. |
96 RenderViewHostDelegateView* platform_view_delegate_view_; | 96 RenderViewHostDelegateView* platform_view_delegate_view_; |
97 | 97 |
98 DISALLOW_COPY_AND_ASSIGN(WebContentsViewGuest); | 98 DISALLOW_COPY_AND_ASSIGN(WebContentsViewGuest); |
99 }; | 99 }; |
100 | 100 |
101 } // namespace content | 101 } // namespace content |
102 | 102 |
103 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_GUEST_H_ | 103 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_GUEST_H_ |
OLD | NEW |