Commit 3daa1f47 authored by levin@chromium.org's avatar levin@chromium.org

This likely broke the nacl_integration test, so reverting.

Revert 98511 - Don't send DidChangeView to the plugin unless the parameters have actually changed.

Apparently WebKit sends the update for every layout, even if nothing has changed.
Review URL: http://codereview.chromium.org/7761005

TBR=brettw@google.com
Review URL: http://codereview.chromium.org/7762014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98531 0039d316-1c4b-4281-b951-d872f2087c98
parent e07808b1
...@@ -217,7 +217,6 @@ PluginInstance::PluginInstance( ...@@ -217,7 +217,6 @@ PluginInstance::PluginInstance(
pp_instance_(0), pp_instance_(0),
container_(NULL), container_(NULL),
full_frame_(false), full_frame_(false),
sent_did_change_view_(false),
has_webkit_focus_(false), has_webkit_focus_(false),
has_content_area_focus_(false), has_content_area_focus_(false),
find_identifier_(-1), find_identifier_(-1),
...@@ -506,22 +505,18 @@ PP_Var PluginInstance::GetInstanceObject() { ...@@ -506,22 +505,18 @@ PP_Var PluginInstance::GetInstanceObject() {
void PluginInstance::ViewChanged(const gfx::Rect& position, void PluginInstance::ViewChanged(const gfx::Rect& position,
const gfx::Rect& clip) { const gfx::Rect& clip) {
// WebKit can give weird (x,y) positions for empty clip rects (since the
// position technically doesn't matter). But we want to make these
// consistent since this is given to the plugin, so force everything to 0
// in the "everything is clipped" case.
gfx::Rect new_clip;
if (!clip.IsEmpty())
new_clip = clip;
// Don't notify the plugin if we've already sent these same params before.
if (sent_did_change_view_ && position == position_ && new_clip == clip_)
return;
sent_did_change_view_ = true;
position_ = position;
clip_ = new_clip;
fullscreen_ = (fullscreen_container_ != NULL); fullscreen_ = (fullscreen_container_ != NULL);
position_ = position;
if (clip.IsEmpty()) {
// WebKit can give weird (x,y) positions for empty clip rects (since the
// position technically doesn't matter). But we want to make these
// consistent since this is given to the plugin, so force everything to 0
// in the "everything is clipped" case.
clip_ = gfx::Rect();
} else {
clip_ = clip;
}
PP_Rect pp_position, pp_clip; PP_Rect pp_position, pp_clip;
RectToPPRect(position_, &pp_position); RectToPPRect(position_, &pp_position);
......
...@@ -361,11 +361,6 @@ class PluginInstance : public base::RefCounted<PluginInstance>, ...@@ -361,11 +361,6 @@ class PluginInstance : public base::RefCounted<PluginInstance>,
// an entire document rather than an embed tag. // an entire document rather than an embed tag.
bool full_frame_; bool full_frame_;
// Indicates if we've ever sent a didChangeView to the plugin. This ensure we
// always send an initial notification, even if the position and clip are the
// same as the default values.
bool sent_did_change_view_;
// Position in the viewport (which moves as the page is scrolled) of this // Position in the viewport (which moves as the page is scrolled) of this
// plugin. This will be a 0-sized rectangle if the plugin has not yet been // plugin. This will be a 0-sized rectangle if the plugin has not yet been
// laid out. // laid out.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment