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 // A BrowserPluginEmbedder handles messages coming from a BrowserPlugin's | 5 // A BrowserPluginEmbedder handles messages coming from a BrowserPlugin's |
6 // embedder that are not directed at any particular existing guest process. | 6 // embedder that are not directed at any particular existing guest process. |
7 // In the beginning, when a BrowserPlugin instance in the embedder renderer | 7 // In the beginning, when a BrowserPlugin instance in the embedder renderer |
8 // process requests an initial navigation, the WebContents for that renderer | 8 // process requests an initial navigation, the WebContents for that renderer |
9 // renderer creates a BrowserPluginEmbedder for itself. The | 9 // renderer creates a BrowserPluginEmbedder for itself. The |
10 // BrowserPluginEmbedder, in turn, forwards the requests to a | 10 // BrowserPluginEmbedder, in turn, forwards the requests to a |
(...skipping 14 matching lines...) Expand all Loading... | |
25 struct BrowserPluginHostMsg_Attach_Params; | 25 struct BrowserPluginHostMsg_Attach_Params; |
26 struct BrowserPluginHostMsg_ResizeGuest_Params; | 26 struct BrowserPluginHostMsg_ResizeGuest_Params; |
27 | 27 |
28 namespace gfx { | 28 namespace gfx { |
29 class Point; | 29 class Point; |
30 } | 30 } |
31 | 31 |
32 namespace content { | 32 namespace content { |
33 | 33 |
34 class BrowserPluginGuest; | 34 class BrowserPluginGuest; |
35 class BrowserPluginGuestManager; | 35 class BrowserPluginGuestManager; |
lazyboy
2014/05/05 21:40:54
Remove.
Fady Samuel
2014/05/07 17:32:59
Done.
| |
36 class BrowserPluginGuestManagerDelegate; | |
36 class BrowserPluginHostFactory; | 37 class BrowserPluginHostFactory; |
37 class RenderWidgetHostImpl; | 38 class RenderWidgetHostImpl; |
38 class WebContentsImpl; | 39 class WebContentsImpl; |
39 struct NativeWebKeyboardEvent; | 40 struct NativeWebKeyboardEvent; |
40 | 41 |
41 class CONTENT_EXPORT BrowserPluginEmbedder : public WebContentsObserver { | 42 class CONTENT_EXPORT BrowserPluginEmbedder : public WebContentsObserver { |
42 public: | 43 public: |
43 virtual ~BrowserPluginEmbedder(); | 44 virtual ~BrowserPluginEmbedder(); |
44 | 45 |
45 static BrowserPluginEmbedder* Create(WebContentsImpl* web_contents); | 46 static BrowserPluginEmbedder* Create(WebContentsImpl* web_contents); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 | 82 |
82 // Sends EndSystemDrag message to the guest that initiated the last drag/drop | 83 // Sends EndSystemDrag message to the guest that initiated the last drag/drop |
83 // operation, if there's any. | 84 // operation, if there's any. |
84 void SystemDragEnded(); | 85 void SystemDragEnded(); |
85 | 86 |
86 private: | 87 private: |
87 friend class TestBrowserPluginEmbedder; | 88 friend class TestBrowserPluginEmbedder; |
88 | 89 |
89 explicit BrowserPluginEmbedder(WebContentsImpl* web_contents); | 90 explicit BrowserPluginEmbedder(WebContentsImpl* web_contents); |
90 | 91 |
91 BrowserPluginGuestManager* GetBrowserPluginGuestManager() const; | 92 BrowserPluginGuestManagerDelegate* GetBrowserPluginGuestManager() const; |
92 | 93 |
93 bool DidSendScreenRectsCallback(BrowserPluginGuest* guest); | 94 bool DidSendScreenRectsCallback(WebContents* guest_web_contents); |
94 | 95 |
95 bool SetZoomLevelCallback(double level, BrowserPluginGuest* guest); | 96 bool SetZoomLevelCallback(double level, WebContents* guest_web_contents); |
96 | 97 |
97 bool UnlockMouseIfNecessaryCallback(const NativeWebKeyboardEvent& event, | 98 bool UnlockMouseIfNecessaryCallback(const NativeWebKeyboardEvent& event, |
98 BrowserPluginGuest* guest); | 99 WebContents* guest); |
99 | 100 |
100 void GuestCallback(int instance_id, | 101 void GuestCallback(int instance_id, |
101 const BrowserPluginHostMsg_Attach_Params& params, | 102 const BrowserPluginHostMsg_Attach_Params& params, |
102 const base::DictionaryValue* extra_params, | 103 const base::DictionaryValue* extra_params, |
103 BrowserPluginGuest* guest); | 104 WebContents* guest_web_contents); |
104 | 105 |
105 // Message handlers. | 106 // Message handlers. |
106 | 107 |
107 void OnAllocateInstanceID(int request_id); | 108 void OnAllocateInstanceID(int request_id); |
108 void OnAttach(int instance_id, | 109 void OnAttach(int instance_id, |
109 const BrowserPluginHostMsg_Attach_Params& params, | 110 const BrowserPluginHostMsg_Attach_Params& params, |
110 const base::DictionaryValue& extra_params); | 111 const base::DictionaryValue& extra_params); |
111 void OnPluginAtPositionResponse(int instance_id, | 112 void OnPluginAtPositionResponse(int instance_id, |
112 int request_id, | 113 int request_id, |
113 const gfx::Point& position); | 114 const gfx::Point& position); |
(...skipping 13 matching lines...) Expand all Loading... | |
127 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; | 128 base::WeakPtr<BrowserPluginGuest> guest_started_drag_; |
128 | 129 |
129 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; | 130 base::WeakPtrFactory<BrowserPluginEmbedder> weak_ptr_factory_; |
130 | 131 |
131 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); | 132 DISALLOW_COPY_AND_ASSIGN(BrowserPluginEmbedder); |
132 }; | 133 }; |
133 | 134 |
134 } // namespace content | 135 } // namespace content |
135 | 136 |
136 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ | 137 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_ |
OLD | NEW |