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_MUS_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MUS_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MUS_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MUS_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "components/mus/public/cpp/scoped_window_ptr.h" |
| 13 #include "components/mus/public/cpp/window.h" |
12 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 14 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
13 #include "content/browser/web_contents/web_contents_view.h" | 15 #include "content/browser/web_contents/web_contents_view.h" |
14 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
15 #include "content/common/drag_event_source_info.h" | 17 #include "content/common/drag_event_source_info.h" |
16 | 18 |
17 namespace content { | 19 namespace content { |
18 | 20 |
19 class WebContents; | 21 class WebContents; |
20 class WebContentsImpl; | 22 class WebContentsImpl; |
21 | 23 |
22 class WebContentsViewMus : public WebContentsView, | 24 class WebContentsViewMus : public WebContentsView, |
23 public RenderViewHostDelegateView { | 25 public RenderViewHostDelegateView { |
24 public: | 26 public: |
25 // The corresponding WebContentsImpl is passed in the constructor, and manages | 27 // The corresponding WebContentsImpl is passed in the constructor, and manages |
26 // 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 |
27 // because that's what was easiest when they were split. | 29 // because that's what was easiest when they were split. |
28 // WebContentsViewMus always has a backing platform dependent view, | 30 // WebContentsViewMus always has a backing platform dependent view, |
29 // |platform_view|. | 31 // |platform_view|. |
30 WebContentsViewMus(WebContentsImpl* web_contents, | 32 WebContentsViewMus(WebContentsImpl* web_contents, |
| 33 mus::Window* parent_window, |
31 scoped_ptr<WebContentsView> platform_view, | 34 scoped_ptr<WebContentsView> platform_view, |
32 RenderViewHostDelegateView** platform_view_delegate_view); | 35 RenderViewHostDelegateView** platform_view_delegate_view); |
33 ~WebContentsViewMus() override; | 36 ~WebContentsViewMus() override; |
34 | 37 |
35 WebContents* web_contents(); | 38 WebContents* web_contents(); |
36 | 39 |
37 private: | 40 private: |
38 // WebContentsView implementation: | 41 // WebContentsView implementation: |
39 gfx::NativeView GetNativeView() const override; | 42 gfx::NativeView GetNativeView() const override; |
40 gfx::NativeView GetContentNativeView() const override; | 43 gfx::NativeView GetContentNativeView() const override; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 const gfx::ImageSkia& image, | 76 const gfx::ImageSkia& image, |
74 const gfx::Vector2d& image_offset, | 77 const gfx::Vector2d& image_offset, |
75 const DragEventSourceInfo& event_info) override; | 78 const DragEventSourceInfo& event_info) override; |
76 void UpdateDragCursor(blink::WebDragOperation operation) override; | 79 void UpdateDragCursor(blink::WebDragOperation operation) override; |
77 void GotFocus() override; | 80 void GotFocus() override; |
78 void TakeFocus(bool reverse) override; | 81 void TakeFocus(bool reverse) override; |
79 | 82 |
80 // The WebContentsImpl whose contents we display. | 83 // The WebContentsImpl whose contents we display. |
81 WebContentsImpl* web_contents_; | 84 WebContentsImpl* web_contents_; |
82 | 85 |
| 86 scoped_ptr<mus::ScopedWindowPtr> window_; |
| 87 |
83 // The platform dependent view backing this WebContentsView. | 88 // The platform dependent view backing this WebContentsView. |
84 // Calls to this WebContentsViewMus are forwarded to |platform_view_|. | 89 // Calls to this WebContentsViewMus are forwarded to |platform_view_|. |
85 scoped_ptr<WebContentsView> platform_view_; | 90 scoped_ptr<WebContentsView> platform_view_; |
86 gfx::Size size_; | |
87 | 91 |
88 // Delegate view for guest's platform view. | 92 // Delegate view for guest's platform view. |
89 RenderViewHostDelegateView* platform_view_delegate_view_; | 93 RenderViewHostDelegateView* platform_view_delegate_view_; |
90 | 94 |
91 DISALLOW_COPY_AND_ASSIGN(WebContentsViewMus); | 95 DISALLOW_COPY_AND_ASSIGN(WebContentsViewMus); |
92 }; | 96 }; |
93 | 97 |
94 } // namespace content | 98 } // namespace content |
95 | 99 |
96 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MUS_H_ | 100 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_MUS_H_ |
OLD | NEW |