Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2015)

Unified Diff: content/renderer/browser_plugin/browser_plugin.h

Issue 11360106: Browser Plugin: Implement AutoSize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reupload Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/browser_plugin/browser_plugin.h
diff --git a/content/renderer/browser_plugin/browser_plugin.h b/content/renderer/browser_plugin/browser_plugin.h
index b8267ffb7594a73ed40e69902b3c8e677d7a135d..083ca936b804f2a4064f83e83ca46fbd0a6e19e6 100644
--- a/content/renderer/browser_plugin/browser_plugin.h
+++ b/content/renderer/browser_plugin/browser_plugin.h
@@ -59,6 +59,7 @@ class CONTENT_EXPORT BrowserPlugin :
int min_width_attribute() const { return min_width_; }
// Set the minwidth attribute value.
void SetMinWidthAttribute(int minwidth);
+ bool InAutoSizeBounds(const gfx::Size& size) const;
// Get the guest's DOMWindow proxy.
NPObject* GetContentWindow() const;
@@ -226,12 +227,21 @@ class CONTENT_EXPORT BrowserPlugin :
virtual TransportDIB* CreateTransportDIB(const size_t size);
// Frees up the damage buffer. Overridden in tests.
virtual void FreeDamageBuffer();
+ // Populates BrowserPluginHostMsg_ResizeGuest_Params with resize state and
+ // returns the newly allocated TransportDIB.
+ TransportDIB* PopulateResizeGuestParameters(
+ BrowserPluginHostMsg_ResizeGuest_Params* params,
+ int view_width, int view_height);
// Populates BrowserPluginHostMsg_AutoSize_Params object with autosize state.
void PopulateAutoSizeParameters(
- BrowserPluginHostMsg_AutoSize_Params* params) const;
+ BrowserPluginHostMsg_AutoSize_Params* params);
+
// Informs the guest of an updated autosize state.
- void UpdateGuestAutoSizeState() const;
+ void UpdateGuestAutoSizeState();
+
+ // Informs the BrowserPlugin that guest has changed its size in autosize mode.
+ void SizeChanged(const gfx::Size& old_view_size);
int instance_id_;
base::WeakPtr<RenderViewImpl> render_view_;
@@ -269,6 +279,8 @@ class CONTENT_EXPORT BrowserPlugin :
typedef std::vector<v8::Persistent<v8::Function> > EventListeners;
typedef std::map<std::string, EventListeners> EventListenerMap;
EventListenerMap event_listener_map_;
+ gfx::Size last_view_size_;
+ bool size_changed_in_flight_;
// Important: Do not add more history state here.
// We strongly discourage storing additional history state (such as page IDs)
// in the embedder process, at the risk of having incorrect information that

Powered by Google App Engine
This is Rietveld 408576698