Index: content/browser/browser_plugin/browser_plugin_guest.h |
diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h |
index 438fc1694e1f03694d4955aef3c73eab21e33f81..c7108036c03a053e58965038ddd117e305f86368 100644 |
--- a/content/browser/browser_plugin/browser_plugin_guest.h |
+++ b/content/browser/browser_plugin/browser_plugin_guest.h |
@@ -190,6 +190,12 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost, |
// Returns whether the guest is attached to an embedder. |
bool attached() const { return attached_; } |
+ // Returns true when an attachment has taken place since the last time the |
+ // compositor surface was set. |
+ bool has_attached_since_surface_set() const { |
+ return has_attached_since_surface_set_; |
+ } |
+ |
// Attaches this BrowserPluginGuest to the provided |embedder_web_contents| |
// and initializes the guest with the provided |params|. Attaching a guest |
// to an embedder implies that this guest's lifetime is no longer managed |
@@ -245,6 +251,15 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost, |
WebContentsImpl* web_contents, |
BrowserPluginGuestDelegate* delegate); |
+ // Protected for testing. |
+ void set_has_attached_since_surface_set_for_test(bool has_attached) { |
+ has_attached_since_surface_set_ = has_attached; |
+ } |
+ |
+ void set_attached_for_test(bool attached) { |
+ attached_ = attached; |
+ } |
+ |
private: |
class EmbedderVisibilityObserver; |
@@ -373,6 +388,10 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost, |
// Indicates whether this guest has been attached to a container. |
bool attached_; |
+ // Used to signal if a browser plugin has been attached since the last time |
+ // the compositing surface was set. |
+ bool has_attached_since_surface_set_; |
+ |
// An identifier that uniquely identifies a browser plugin within an embedder. |
int browser_plugin_instance_id_; |
gfx::Rect guest_window_rect_; |