| 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/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 | 1072 |
| 1073 bool PepperPluginInstanceImpl::HandleInputEvent( | 1073 bool PepperPluginInstanceImpl::HandleInputEvent( |
| 1074 const blink::WebInputEvent& event, | 1074 const blink::WebInputEvent& event, |
| 1075 WebCursorInfo* cursor_info) { | 1075 WebCursorInfo* cursor_info) { |
| 1076 TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::HandleInputEvent"); | 1076 TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::HandleInputEvent"); |
| 1077 | 1077 |
| 1078 if (!has_been_clicked_ && is_flash_plugin_ && | 1078 if (!has_been_clicked_ && is_flash_plugin_ && |
| 1079 event.type == blink::WebInputEvent::MouseDown && | 1079 event.type == blink::WebInputEvent::MouseDown && |
| 1080 (event.modifiers & blink::WebInputEvent::LeftButtonDown)) { | 1080 (event.modifiers & blink::WebInputEvent::LeftButtonDown)) { |
| 1081 has_been_clicked_ = true; | 1081 has_been_clicked_ = true; |
| 1082 blink::WebRect bounds = container()->element().boundsInViewportSpace(); | 1082 blink::WebRect bounds = container()->element().boundsInViewport(); |
| 1083 RecordFlashClickSizeMetric(bounds.width, bounds.height); | 1083 RecordFlashClickSizeMetric(bounds.width, bounds.height); |
| 1084 } | 1084 } |
| 1085 | 1085 |
| 1086 if (throttler_ && throttler_->ConsumeInputEvent(event)) | 1086 if (throttler_ && throttler_->ConsumeInputEvent(event)) |
| 1087 return true; | 1087 return true; |
| 1088 | 1088 |
| 1089 if (!render_frame_) | 1089 if (!render_frame_) |
| 1090 return false; | 1090 return false; |
| 1091 if (WebInputEvent::isMouseEventType(event.type)) { | 1091 if (WebInputEvent::isMouseEventType(event.type)) { |
| 1092 render_frame_->PepperDidReceiveMouseEvent(this); | 1092 render_frame_->PepperDidReceiveMouseEvent(this); |
| (...skipping 2181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3274 | 3274 |
| 3275 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { | 3275 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { |
| 3276 if (initialized_ && !javascript_used_ && is_flash_plugin_) { | 3276 if (initialized_ && !javascript_used_ && is_flash_plugin_) { |
| 3277 javascript_used_ = true; | 3277 javascript_used_ = true; |
| 3278 RenderThread::Get()->RecordAction( | 3278 RenderThread::Get()->RecordAction( |
| 3279 base::UserMetricsAction("Flash.JavaScriptUsed")); | 3279 base::UserMetricsAction("Flash.JavaScriptUsed")); |
| 3280 } | 3280 } |
| 3281 } | 3281 } |
| 3282 | 3282 |
| 3283 } // namespace content | 3283 } // namespace content |
| OLD | NEW |