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 BrowserPluginGuest is the browser side of a browser <--> embedder | 5 // A BrowserPluginGuest is the browser side of a browser <--> embedder |
6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder | 6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder |
7 // renderer side of browser <--> embedder renderer communication. | 7 // renderer side of browser <--> embedder renderer communication. |
8 // | 8 // |
9 // BrowserPluginGuest lives on the UI thread of the browser process. Any | 9 // BrowserPluginGuest lives on the UI thread of the browser process. Any |
10 // messages about the guest render process that the embedder might be interested | 10 // messages about the guest render process that the embedder might be interested |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 149 |
150 bool OnMessageReceivedFromEmbedder(const IPC::Message& message); | 150 bool OnMessageReceivedFromEmbedder(const IPC::Message& message); |
151 | 151 |
152 WebContentsImpl* embedder_web_contents() const { | 152 WebContentsImpl* embedder_web_contents() const { |
153 return attached_ ? owner_web_contents_ : nullptr; | 153 return attached_ ? owner_web_contents_ : nullptr; |
154 } | 154 } |
155 | 155 |
156 // Returns the embedder's RenderWidgetHostView if it is available. | 156 // Returns the embedder's RenderWidgetHostView if it is available. |
157 // Returns nullptr otherwise. | 157 // Returns nullptr otherwise. |
158 RenderWidgetHostView* GetOwnerRenderWidgetHostView(); | 158 RenderWidgetHostView* GetOwnerRenderWidgetHostView(); |
| 159 RenderWidgetHostView* GetTopLevelRenderWidgetHostView(); |
159 | 160 |
160 bool focused() const { return focused_; } | 161 bool focused() const { return focused_; } |
161 bool visible() const { return guest_visible_; } | 162 bool visible() const { return guest_visible_; } |
162 bool is_in_destruction() { return is_in_destruction_; } | 163 bool is_in_destruction() { return is_in_destruction_; } |
163 | 164 |
164 void UpdateVisibility(); | 165 void UpdateVisibility(); |
165 | 166 |
166 BrowserPluginGuestManager* GetBrowserPluginGuestManager() const; | 167 BrowserPluginGuestManager* GetBrowserPluginGuestManager() const; |
167 | 168 |
168 // WebContentsObserver implementation. | 169 // WebContentsObserver implementation. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 247 |
247 // Find the given |search_text| in the page. Returns true if the find request | 248 // Find the given |search_text| in the page. Returns true if the find request |
248 // is handled by this browser plugin guest. | 249 // is handled by this browser plugin guest. |
249 bool HandleFindForEmbedder(int request_id, | 250 bool HandleFindForEmbedder(int request_id, |
250 const base::string16& search_text, | 251 const base::string16& search_text, |
251 const blink::WebFindOptions& options); | 252 const blink::WebFindOptions& options); |
252 bool HandleStopFindingForEmbedder(StopFindAction action); | 253 bool HandleStopFindingForEmbedder(StopFindAction action); |
253 | 254 |
254 void ResendEventToEmbedder(const blink::WebInputEvent& event); | 255 void ResendEventToEmbedder(const blink::WebInputEvent& event); |
255 | 256 |
| 257 // TODO(ekaramad): This is used in forcing MimeHandlerView use BrowserPlugin |
| 258 // even when --use-cross-process-frames-for-guests is used. Remove this once |
| 259 // MimeHandlerView uses OOPIF (https://crbug.com/563285). |
| 260 bool IsMimeHandlerViewGuest() const; |
| 261 |
256 protected: | 262 protected: |
257 | 263 |
258 // BrowserPluginGuest is a WebContentsObserver of |web_contents| and | 264 // BrowserPluginGuest is a WebContentsObserver of |web_contents| and |
259 // |web_contents| has to stay valid for the lifetime of BrowserPluginGuest. | 265 // |web_contents| has to stay valid for the lifetime of BrowserPluginGuest. |
260 // Constructor protected for testing. | 266 // Constructor protected for testing. |
261 BrowserPluginGuest(bool has_render_view, | 267 BrowserPluginGuest(bool has_render_view, |
262 WebContentsImpl* web_contents, | 268 WebContentsImpl* web_contents, |
263 BrowserPluginGuestDelegate* delegate); | 269 BrowserPluginGuestDelegate* delegate); |
264 | 270 |
265 // Protected for testing. | 271 // Protected for testing. |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 | 445 |
440 // Ignore the URL dragged into guest that is coming from guest. | 446 // Ignore the URL dragged into guest that is coming from guest. |
441 bool ignore_dragged_url_; | 447 bool ignore_dragged_url_; |
442 | 448 |
443 // This is a queue of messages that are destined to be sent to the embedder | 449 // This is a queue of messages that are destined to be sent to the embedder |
444 // once the guest is attached to a particular embedder. | 450 // once the guest is attached to a particular embedder. |
445 std::deque<linked_ptr<IPC::Message> > pending_messages_; | 451 std::deque<linked_ptr<IPC::Message> > pending_messages_; |
446 | 452 |
447 BrowserPluginGuestDelegate* const delegate_; | 453 BrowserPluginGuestDelegate* const delegate_; |
448 | 454 |
| 455 bool is_mime_handler_view_guest_; |
| 456 |
449 // Weak pointer used to ask GeolocationPermissionContext about geolocation | 457 // Weak pointer used to ask GeolocationPermissionContext about geolocation |
450 // permission. | 458 // permission. |
451 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; | 459 base::WeakPtrFactory<BrowserPluginGuest> weak_ptr_factory_; |
452 | 460 |
453 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 461 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
454 }; | 462 }; |
455 | 463 |
456 } // namespace content | 464 } // namespace content |
457 | 465 |
458 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 466 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |