OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/glue/plugins/pepper_plugin_instance.h" | 5 #include "webkit/glue/plugins/pepper_plugin_instance.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #if defined(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
351 } else { | 351 } else { |
352 if (!container_ || position_.IsEmpty()) | 352 if (!container_ || position_.IsEmpty()) |
353 return; // Nothing to do. | 353 return; // Nothing to do. |
354 if (rect.IsEmpty()) | 354 if (rect.IsEmpty()) |
355 container_->invalidate(); | 355 container_->invalidate(); |
356 else | 356 else |
357 container_->invalidateRect(rect); | 357 container_->invalidateRect(rect); |
358 } | 358 } |
359 } | 359 } |
360 | 360 |
361 void PluginInstance::ScrollRect(int dx, int dy, const gfx::Rect& rect) { | |
362 if (fullscreen_container_) { | |
363 fullscreen_container_->ScrollRect(dx, dy, rect); | |
364 } else { | |
365 if (full_frame_) { | |
366 container_->scrollRect(dx, dy, rect); | |
367 } else { | |
368 // Can't do optimized scrolling since there could be other elemetns on top | |
brettw
2010/11/03 01:16:41
elemetns -> elements
| |
369 // of us. | |
370 InvalidateRect(rect); | |
371 } | |
372 } | |
373 } | |
374 | |
361 PP_Var PluginInstance::GetWindowObject() { | 375 PP_Var PluginInstance::GetWindowObject() { |
362 if (!container_) | 376 if (!container_) |
363 return PP_MakeUndefined(); | 377 return PP_MakeUndefined(); |
364 | 378 |
365 WebFrame* frame = container_->element().document().frame(); | 379 WebFrame* frame = container_->element().document().frame(); |
366 if (!frame) | 380 if (!frame) |
367 return PP_MakeUndefined(); | 381 return PP_MakeUndefined(); |
368 | 382 |
369 return ObjectVar::NPObjectToPPVar(module(), frame->windowObject()); | 383 return ObjectVar::NPObjectToPPVar(module(), frame->windowObject()); |
370 } | 384 } |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1084 bounds.size.width = dest_rect.width(); | 1098 bounds.size.width = dest_rect.width(); |
1085 bounds.size.height = dest_rect.height(); | 1099 bounds.size.height = dest_rect.height(); |
1086 | 1100 |
1087 CGContextDrawImage(canvas, bounds, image); | 1101 CGContextDrawImage(canvas, bounds, image); |
1088 CGContextRestoreGState(canvas); | 1102 CGContextRestoreGState(canvas); |
1089 } | 1103 } |
1090 #endif // defined(OS_MACOSX) | 1104 #endif // defined(OS_MACOSX) |
1091 | 1105 |
1092 | 1106 |
1093 } // namespace pepper | 1107 } // namespace pepper |
OLD | NEW |