| 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 #include "content/plugin/webplugin_proxy.h" | 5 #include "content/plugin/webplugin_proxy.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // delegate. | 169 // delegate. |
| 170 if (!windowless_context()) { | 170 if (!windowless_context()) { |
| 171 delegate_->PluginDidInvalidate(); | 171 delegate_->PluginDidInvalidate(); |
| 172 return; | 172 return; |
| 173 } | 173 } |
| 174 | 174 |
| 175 // Some plugins will send invalidates larger than their own rect when | 175 // Some plugins will send invalidates larger than their own rect when |
| 176 // offscreen, so constrain invalidates to the plugin rect. | 176 // offscreen, so constrain invalidates to the plugin rect. |
| 177 gfx::Rect plugin_rect = delegate_->GetRect(); | 177 gfx::Rect plugin_rect = delegate_->GetRect(); |
| 178 plugin_rect.set_origin(gfx::Point(0, 0)); | 178 plugin_rect.set_origin(gfx::Point(0, 0)); |
| 179 const gfx::Rect invalidate_rect(rect.Intersect(plugin_rect)); | 179 plugin_rect.Intersect(rect); |
| 180 const gfx::Rect invalidate_rect(plugin_rect); |
| 180 #else | 181 #else |
| 181 const gfx::Rect invalidate_rect(rect); | 182 const gfx::Rect invalidate_rect(rect); |
| 182 #endif | 183 #endif |
| 183 damaged_rect_ = damaged_rect_.Union(invalidate_rect); | 184 damaged_rect_.Union(invalidate_rect); |
| 184 // Ignore NPN_InvalidateRect calls with empty rects. Also don't send an | 185 // Ignore NPN_InvalidateRect calls with empty rects. Also don't send an |
| 185 // invalidate if it's outside the clipping region, since if we did it won't | 186 // invalidate if it's outside the clipping region, since if we did it won't |
| 186 // lead to a paint and we'll be stuck waiting forever for a DidPaint response. | 187 // lead to a paint and we'll be stuck waiting forever for a DidPaint response. |
| 187 // | 188 // |
| 188 // TODO(piman): There is a race condition here, because this test assumes | 189 // TODO(piman): There is a race condition here, because this test assumes |
| 189 // that when the paint actually occurs, the clip rect will not have changed. | 190 // that when the paint actually occurs, the clip rect will not have changed. |
| 190 // This is not true because scrolling (or window resize) could occur and be | 191 // This is not true because scrolling (or window resize) could occur and be |
| 191 // handled by the renderer before it receives the InvalidateRect message, | 192 // handled by the renderer before it receives the InvalidateRect message, |
| 192 // changing the clip rect and then not painting. | 193 // changing the clip rect and then not painting. |
| 193 if (damaged_rect_.IsEmpty() || | 194 if (damaged_rect_.IsEmpty() || |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 int input_type; | 783 int input_type; |
| 783 gfx::Rect caret_rect; | 784 gfx::Rect caret_rect; |
| 784 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) | 785 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) |
| 785 return; | 786 return; |
| 786 | 787 |
| 787 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); | 788 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); |
| 788 } | 789 } |
| 789 #endif | 790 #endif |
| 790 | 791 |
| 791 } // namespace content | 792 } // namespace content |
| OLD | NEW |