OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 #import <QuartzCore/QuartzCore.h> | 6 #import <QuartzCore/QuartzCore.h> |
7 | 7 |
8 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 8 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 // Check our plugin location before we send the event to the plugin, just | 506 // Check our plugin location before we send the event to the plugin, just |
507 // in case we somehow missed a plugin frame change. | 507 // in case we somehow missed a plugin frame change. |
508 const WebMouseEvent* mouse_event = | 508 const WebMouseEvent* mouse_event = |
509 static_cast<const WebMouseEvent*>(&event); | 509 static_cast<const WebMouseEvent*>(&event); |
510 gfx::Point content_origin( | 510 gfx::Point content_origin( |
511 mouse_event->globalX - mouse_event->x - window_rect_.x(), | 511 mouse_event->globalX - mouse_event->x - window_rect_.x(), |
512 mouse_event->globalY - mouse_event->y - window_rect_.y()); | 512 mouse_event->globalY - mouse_event->y - window_rect_.y()); |
513 if (content_origin.x() != content_area_origin_.x() || | 513 if (content_origin.x() != content_area_origin_.x() || |
514 content_origin.y() != content_area_origin_.y()) { | 514 content_origin.y() != content_area_origin_.y()) { |
515 DLOG(WARNING) << "Stale plugin content area location: " | 515 DLOG(WARNING) << "Stale plugin content area location: " |
516 << content_area_origin_ << " instead of " | 516 << content_area_origin_.ToString() << " instead of " |
517 << content_origin; | 517 << content_origin.ToString(); |
518 SetContentAreaOrigin(content_origin); | 518 SetContentAreaOrigin(content_origin); |
519 } | 519 } |
520 | 520 |
521 current_windowless_cursor_.GetCursorInfo(cursor_info); | 521 current_windowless_cursor_.GetCursorInfo(cursor_info); |
522 } | 522 } |
523 | 523 |
524 // Per the Cocoa Plugin IME spec, plugins shoudn't receive keydown or keyup | 524 // Per the Cocoa Plugin IME spec, plugins shoudn't receive keydown or keyup |
525 // events while composition is in progress. Treat them as handled, however, | 525 // events while composition is in progress. Treat them as handled, however, |
526 // since IME is consuming them on behalf of the plugin. | 526 // since IME is consuming them on behalf of the plugin. |
527 if ((event.type == WebInputEvent::KeyDown && ime_enabled_) || | 527 if ((event.type == WebInputEvent::KeyDown && ime_enabled_) || |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 qd_manager_->SetFastPathEnabled(enabled); | 1209 qd_manager_->SetFastPathEnabled(enabled); |
1210 qd_port_.port = qd_manager_->port(); | 1210 qd_port_.port = qd_manager_->port(); |
1211 WindowlessSetWindow(); | 1211 WindowlessSetWindow(); |
1212 // Send a paint event so that the new buffer gets updated immediately. | 1212 // Send a paint event so that the new buffer gets updated immediately. |
1213 WindowlessPaint(buffer_context_, clip_rect_); | 1213 WindowlessPaint(buffer_context_, clip_rect_); |
1214 } | 1214 } |
1215 #endif // !NP_NO_QUICKDRAW | 1215 #endif // !NP_NO_QUICKDRAW |
1216 | 1216 |
1217 } // namespace npapi | 1217 } // namespace npapi |
1218 } // namespace webkit | 1218 } // namespace webkit |
OLD | NEW |