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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 11361052: Browser Plugin: Implement autosize (Embedder-side code) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: BrowserPluginHostMsg_AutoSize_Params had an int instead of bool for enable: fixed 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/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 4919b1ff5c39ac27c7039d9706454190b627052b..c0a09e6872dc603060c6b5ac8c9c859811f7c50d 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -39,11 +39,11 @@ namespace {
const int kGuestHangTimeoutMs = 5000;
}
-BrowserPluginGuest::BrowserPluginGuest(int instance_id,
- WebContentsImpl* web_contents,
- RenderViewHost* render_view_host,
- bool focused,
- bool visible)
+BrowserPluginGuest::BrowserPluginGuest(
+ int instance_id,
+ WebContentsImpl* web_contents,
+ RenderViewHost* render_view_host,
+ const BrowserPluginHostMsg_CreateGuest_Params& params)
: WebContentsObserver(web_contents),
embedder_web_contents_(NULL),
instance_id_(instance_id),
@@ -54,8 +54,13 @@ BrowserPluginGuest::BrowserPluginGuest(int instance_id,
pending_update_counter_(0),
guest_hang_timeout_(
base::TimeDelta::FromMilliseconds(kGuestHangTimeoutMs)),
- focused_(focused),
- visible_(visible) {
+ focused_(params.focused),
+ visible_(params.visible),
+ auto_size_(params.auto_size.enable),
+ max_height_(params.auto_size.max_height),
+ max_width_(params.auto_size.max_width),
+ min_height_(params.auto_size.min_height),
+ min_width_(params.auto_size.min_width) {
DCHECK(web_contents);
// |render_view_host| manages the ownership of this BrowserPluginGuestHelper.
new BrowserPluginGuestHelper(this, render_view_host);
@@ -73,18 +78,16 @@ BrowserPluginGuest* BrowserPluginGuest::Create(
int instance_id,
WebContentsImpl* web_contents,
content::RenderViewHost* render_view_host,
- bool focused,
- bool visible) {
+ const BrowserPluginHostMsg_CreateGuest_Params& params) {
RecordAction(UserMetricsAction("BrowserPlugin.Guest.Create"));
if (factory_) {
return factory_->CreateBrowserPluginGuest(instance_id,
web_contents,
render_view_host,
- focused,
- visible);
+ params);
}
return new BrowserPluginGuest(
- instance_id, web_contents, render_view_host, focused, visible);
+ instance_id, web_contents, render_view_host, params);
}
void BrowserPluginGuest::Observe(int type,

Powered by Google App Engine
This is Rietveld 408576698