| 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. It has a | 9 // BrowserPluginGuest lives on the UI thread of the browser process. It has a |
| 10 // helper, BrowserPluginGuestHelper, which is a RenderViewHostObserver. The | 10 // helper, BrowserPluginGuestHelper, which is a RenderViewHostObserver. The |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 #include <map> | 24 #include <map> |
| 25 #include <queue> | 25 #include <queue> |
| 26 | 26 |
| 27 #include "base/compiler_specific.h" | 27 #include "base/compiler_specific.h" |
| 28 #include "base/id_map.h" | 28 #include "base/id_map.h" |
| 29 #include "base/memory/weak_ptr.h" | 29 #include "base/memory/weak_ptr.h" |
| 30 #include "base/shared_memory.h" | 30 #include "base/shared_memory.h" |
| 31 #include "base/time.h" | 31 #include "base/time.h" |
| 32 #include "content/common/browser_plugin/browser_plugin_message_enums.h" | 32 #include "content/common/browser_plugin/browser_plugin_message_enums.h" |
| 33 #include "content/common/edit_command.h" |
| 33 #include "content/port/common/input_event_ack_state.h" | 34 #include "content/port/common/input_event_ack_state.h" |
| 34 #include "content/public/browser/notification_observer.h" | 35 #include "content/public/browser/notification_observer.h" |
| 35 #include "content/public/browser/notification_registrar.h" | 36 #include "content/public/browser/notification_registrar.h" |
| 36 #include "content/public/browser/render_view_host_observer.h" | 37 #include "content/public/browser/render_view_host_observer.h" |
| 37 #include "content/public/browser/web_contents_delegate.h" | 38 #include "content/public/browser/web_contents_delegate.h" |
| 38 #include "content/public/browser/web_contents_observer.h" | 39 #include "content/public/browser/web_contents_observer.h" |
| 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" |
| 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h" |
| 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 42 #include "ui/gfx/rect.h" | 43 #include "ui/gfx/rect.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 // Overriden in tests. | 358 // Overriden in tests. |
| 358 virtual void OnSetFocus(int instance_id, bool focused); | 359 virtual void OnSetFocus(int instance_id, bool focused); |
| 359 // Sets the name of the guest so that other guests in the same partition can | 360 // Sets the name of the guest so that other guests in the same partition can |
| 360 // access it. | 361 // access it. |
| 361 void OnSetName(int instance_id, const std::string& name); | 362 void OnSetName(int instance_id, const std::string& name); |
| 362 // Updates the size state of the guest. | 363 // Updates the size state of the guest. |
| 363 void OnSetSize( | 364 void OnSetSize( |
| 364 int instance_id, | 365 int instance_id, |
| 365 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, | 366 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, |
| 366 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); | 367 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); |
| 368 void OnSetEditCommandsForNextKeyEvent( |
| 369 int instance_id, |
| 370 const std::vector<EditCommand>& edit_commands); |
| 367 // The guest WebContents is visible if both its embedder is visible and | 371 // The guest WebContents is visible if both its embedder is visible and |
| 368 // the browser plugin element is visible. If either one is not then the | 372 // the browser plugin element is visible. If either one is not then the |
| 369 // WebContents is marked as hidden. A hidden WebContents will consume | 373 // WebContents is marked as hidden. A hidden WebContents will consume |
| 370 // fewer GPU and CPU resources. | 374 // fewer GPU and CPU resources. |
| 371 // | 375 // |
| 372 // When every WebContents in a RenderProcessHost is hidden, it will lower | 376 // When every WebContents in a RenderProcessHost is hidden, it will lower |
| 373 // the priority of the process (see RenderProcessHostImpl::WidgetHidden). | 377 // the priority of the process (see RenderProcessHostImpl::WidgetHidden). |
| 374 // | 378 // |
| 375 // It will also send a message to the guest renderer process to cleanup | 379 // It will also send a message to the guest renderer process to cleanup |
| 376 // resources such as dropping back buffers and adjusting memory limits (if in | 380 // resources such as dropping back buffers and adjusting memory limits (if in |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 // This is a queue of messages that are destined to be sent to the embedder | 505 // This is a queue of messages that are destined to be sent to the embedder |
| 502 // once the guest is attached to a particular embedder. | 506 // once the guest is attached to a particular embedder. |
| 503 std::queue<IPC::Message*> pending_messages_; | 507 std::queue<IPC::Message*> pending_messages_; |
| 504 | 508 |
| 505 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 509 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 506 }; | 510 }; |
| 507 | 511 |
| 508 } // namespace content | 512 } // namespace content |
| 509 | 513 |
| 510 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 514 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |