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/child/npapi/webplugin_delegate_impl.h" | 5 #include "content/child/npapi/webplugin_delegate_impl.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #import <QuartzCore/QuartzCore.h> | 8 #import <QuartzCore/QuartzCore.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 | 10 |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 new PluginWebEventConverter); | 347 new PluginWebEventConverter); |
348 if (!event_converter->InitWithEvent(event)) { | 348 if (!event_converter->InitWithEvent(event)) { |
349 // Silently consume any keyboard event types that aren't handled, so that | 349 // Silently consume any keyboard event types that aren't handled, so that |
350 // they don't fall through to the page. | 350 // they don't fall through to the page. |
351 if (WebInputEvent::isKeyboardEventType(event.type)) | 351 if (WebInputEvent::isKeyboardEventType(event.type)) |
352 return true; | 352 return true; |
353 return false; | 353 return false; |
354 } | 354 } |
355 NPCocoaEvent* plugin_event = event_converter->plugin_event(); | 355 NPCocoaEvent* plugin_event = event_converter->plugin_event(); |
356 | 356 |
357 // The plugin host recieves events related to drags starting outside the | 357 // The plugin host receives events related to drags starting outside the |
358 // plugin, but the NPAPI Cocoa event model spec says plugins shouldn't receive | 358 // plugin, but the NPAPI Cocoa event model spec says plugins shouldn't receive |
359 // them, so filter them out. | 359 // them, so filter them out. |
360 // If WebKit adds a page capture mode (like the plugin capture mode that | 360 // If WebKit adds a page capture mode (like the plugin capture mode that |
361 // handles drags starting inside) this can be removed. | 361 // handles drags starting inside) this can be removed. |
362 bool drag_related = external_drag_tracker_->EventIsRelatedToDrag(event); | 362 bool drag_related = external_drag_tracker_->EventIsRelatedToDrag(event); |
363 external_drag_tracker_->UpdateDragStateFromEvent(event); | 363 external_drag_tracker_->UpdateDragStateFromEvent(event); |
364 if (drag_related) { | 364 if (drag_related) { |
365 if (event.type == WebInputEvent::MouseUp && | 365 if (event.type == WebInputEvent::MouseUp && |
366 !external_drag_tracker_->IsDragInProgress()) { | 366 !external_drag_tracker_->IsDragInProgress()) { |
367 // When an external drag ends, we need to synthesize a MouseEntered. | 367 // When an external drag ends, we need to synthesize a MouseEntered. |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 window_rect_.width(), window_rect_.height())]; | 719 window_rect_.width(), window_rect_.height())]; |
720 [CATransaction commit]; | 720 [CATransaction commit]; |
721 | 721 |
722 [renderer_ setBounds:[layer_ bounds]]; | 722 [renderer_ setBounds:[layer_ bounds]]; |
723 surface_->SetSize(window_rect_.size()); | 723 surface_->SetSize(window_rect_.size()); |
724 // Kick off the drawing timer, if necessary. | 724 // Kick off the drawing timer, if necessary. |
725 PluginVisibilityChanged(); | 725 PluginVisibilityChanged(); |
726 } | 726 } |
727 | 727 |
728 } // namespace content | 728 } // namespace content |
OLD | NEW |